libcamgm
|
#include <ReferenceCounted.hpp>
Public Member Functions | |
ReferenceCounted () | |
ReferenceCounted (const ReferenceCounted &rhs) | |
virtual | ~ReferenceCounted () |
ReferenceCounted & | operator= (const ReferenceCounted &) |
unsigned | refCount () const |
void | ref () const |
void | unref () const |
Static Public Member Functions | |
static void | add_ref (const ReferenceCounted *ptr_r) |
static void | release (const ReferenceCounted *ptr_r) |
Protected Member Functions | |
virtual std::ostream & | dumpOn (std::ostream &str) const |
virtual void | ref_to (unsigned) const |
virtual void | unref_to (unsigned) const |
Private Member Functions | |
void | unrefException () const |
Private Attributes | |
unsigned | _counter |
Friends | |
std::ostream & | operator<< (std::ostream &str, const ReferenceCounted &obj) |
Related Functions | |
(Note that these are not member functions.) | |
void | intrusive_ptr_add_ref (const ReferenceCounted *ptr_r) |
void | intrusive_ptr_release (const ReferenceCounted *ptr_r) |
std::ostream & | operator<< (std::ostream &str, const ReferenceCounted &obj) |
Base class for reference counted objects.
ca_mgm::ReferenceCounted::ReferenceCounted | ( | ) |
Default ctor. Initial reference count is zero.
ca_mgm::ReferenceCounted::ReferenceCounted | ( | const ReferenceCounted & | rhs | ) |
Copy ctor. Initial reference count is zero.
|
virtual |
Dtor.
std::out_of_range | if reference count is not zero. |
|
inlinestatic |
Called by zypp::intrusive_ptr to add a reference.
References ref().
Referenced by intrusive_ptr_add_ref().
|
protectedvirtual |
Overload to realize std::ostream & operator<<.
Referenced by operator<<(), and release().
|
inline |
Assignment. Reference count remains untouched.
|
inline |
|
inlineprotectedvirtual |
Trigger derived classes after refCount was increased.
Referenced by ref().
|
inline |
Return reference counter value.
References _counter.
|
inlinestatic |
Called by zypp::intrusive_ptr to add a reference.
References dumpOn(), and unref().
Referenced by intrusive_ptr_release().
|
inline |
Release a reference. Deletes the object if reference count gets zero.
std::out_of_range | if reference count is zero. |
References _counter, unref_to(), and unrefException().
Referenced by release().
|
inlineprotectedvirtual |
Trigger derived classes after refCount was decreased. No trigger is sent, if refCount got zero (i.e. the object is deleted).
Referenced by unref().
|
private |
|
related |
intrusive_ptr hook to add_ref.
References add_ref().
|
related |
intrusive_ptr hook to release.
References release().
|
friend |
Stream output via dumpOn.
|
related |
Stream output.
References dumpOn().
|
mutableprivate |
The reference counter.
Referenced by ref(), refCount(), and unref().