Base class for reference counted objects.
More...
#include <zypp-core/base/ReferenceCounted.h>
|
| virtual std::ostream & | dumpOn (std::ostream &str) const |
| | Overload to realize std::ostream & operator<<.
|
| |
| virtual void | ref_to (unsigned) const |
| | Trigger derived classes after refCount was increased.
|
| |
| virtual void | unref_to (unsigned) const |
| | Trigger derived classes after refCount was decreased.
|
| |
|
| unsigned | _counter |
| | The reference counter.
|
| |
Base class for reference counted objects.
- Todo
- Make counter thread safe.
Definition at line 34 of file ReferenceCounted.h.
◆ ReferenceCounted() [1/2]
| zypp::base::ReferenceCounted::ReferenceCounted |
( |
| ) |
|
◆ ReferenceCounted() [2/2]
◆ ~ReferenceCounted()
| zypp::base::ReferenceCounted::~ReferenceCounted |
( |
| ) |
|
|
virtual |
Dtor.
- Exceptions
-
| std::out_of_range | if reference count is not zero. |
Definition at line 33 of file ReferenceCounted.cc.
◆ operator=()
◆ refCount()
| unsigned zypp::base::ReferenceCounted::refCount |
( |
| ) |
const |
|
inline |
◆ ref()
| void zypp::base::ReferenceCounted::ref |
( |
| ) |
const |
|
inline |
◆ unref()
| void zypp::base::ReferenceCounted::unref |
( |
| ) |
const |
|
inline |
Release a reference.
Deletes the object if reference count gets zero.
- Exceptions
-
| std::out_of_range | if reference count is zero. |
Definition at line 74 of file ReferenceCounted.h.
◆ add_ref()
| static void zypp::base::ReferenceCounted::add_ref |
( |
const ReferenceCounted * | ptr_r | ) |
|
|
inlinestatic |
◆ release()
| static void zypp::base::ReferenceCounted::release |
( |
const ReferenceCounted * | ptr_r | ) |
|
|
inlinestatic |
◆ dumpOn()
| std::ostream & zypp::base::ReferenceCounted::dumpOn |
( |
std::ostream & | str | ) |
const |
|
protectedvirtual |
◆ ref_to()
| virtual void zypp::base::ReferenceCounted::ref_to |
( |
unsigned | | ) |
const |
|
inlineprotectedvirtual |
◆ unref_to()
| virtual void zypp::base::ReferenceCounted::unref_to |
( |
unsigned | | ) |
const |
|
inlineprotectedvirtual |
◆ unrefException()
| void zypp::base::ReferenceCounted::unrefException |
( |
| ) |
const |
|
private |
◆ operator<< [1/2]
Stream output via dumpOn.
◆ intrusive_ptr_add_ref()
◆ intrusive_ptr_release()
◆ operator<<() [2/2]
◆ _counter
| unsigned zypp::base::ReferenceCounted::_counter |
|
mutableprivate |
The documentation for this class was generated from the following files: