libzypp
13.10.6
|
Base class for reference counted objects. More...
#include <ReferenceCounted.h>
Public Member Functions | |
ReferenceCounted () | |
Default ctor. More... | |
ReferenceCounted (const ReferenceCounted &rhs) | |
Copy ctor. More... | |
virtual | ~ReferenceCounted () |
Dtor. More... | |
ReferenceCounted & | operator= (const ReferenceCounted &) |
Assignment. More... | |
unsigned | refCount () const |
Return reference counter value. More... | |
void | ref () const |
Add a reference. More... | |
void | unref () const |
Release a reference. More... | |
Static Public Member Functions | |
static void | add_ref (const ReferenceCounted *ptr_r) |
Called by zypp::intrusive_ptr to add a reference. More... | |
static void | release (const ReferenceCounted *ptr_r) |
Called by zypp::intrusive_ptr to add a reference. More... | |
Protected Member Functions | |
virtual std::ostream & | dumpOn (std::ostream &str) const |
Overload to realize std::ostream & operator<<. More... | |
virtual void | ref_to (unsigned) const |
Trigger derived classes after refCount was increased. More... | |
virtual void | unref_to (unsigned) const |
Trigger derived classes after refCount was decreased. More... | |
Private Member Functions | |
void | unrefException () const |
Throws Exception on unref. More... | |
Private Attributes | |
unsigned | _counter |
The reference counter. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &str, const ReferenceCounted &obj) |
Stream output via dumpOn. More... | |
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.
Definition at line 33 of file ReferenceCounted.h.
zypp::base::ReferenceCounted::ReferenceCounted | ( | ) |
zypp::base::ReferenceCounted::ReferenceCounted | ( | const ReferenceCounted & | rhs | ) |
|
virtual |
Dtor.
std::out_of_range | if reference count is not zero. |
Definition at line 33 of file ReferenceCounted.cc.
|
inline |
|
inline |
Return reference counter value.
Definition at line 62 of file ReferenceCounted.h.
|
inline |
Add a reference.
Definition at line 66 of file ReferenceCounted.h.
|
inline |
Release a reference.
Deletes the object if reference count gets zero.
std::out_of_range | if reference count is zero. |
Definition at line 73 of file ReferenceCounted.h.
|
inlinestatic |
Called by zypp::intrusive_ptr to add a reference.
Definition at line 86 of file ReferenceCounted.h.
|
inlinestatic |
Called by zypp::intrusive_ptr to add a reference.
Definition at line 92 of file ReferenceCounted.h.
|
protectedvirtual |
Overload to realize std::ostream & operator<<.
Reimplemented in zypp::target::rpm::RpmDb, zypp::media::MediaAccess, zypp::target::rpm::librpmDb, zypp::MediaSetAccess, zypp::ResObject, zypp::Target, zypp::target::rpm::RpmHeader, zypp::solver::detail::Resolver, zypp::solver::detail::InjectSolutionAction, zypp::ZYpp, zypp::Resolvable, zypp::solver::detail::SATResolver, zypp::target::TargetImpl, zypp::solver::detail::TransactionSolutionAction, zypp::target::rpm::BinHeader, zypp::solver::detail::SolverQueueItem, zypp::parser::susetags::RepoIndex, zypp::solver::detail::SolverQueueItemInstallOneOf, zypp::solver::detail::SolverQueueItemDelete, zypp::solver::detail::SolverQueueItemInstall, zypp::solver::detail::SolverQueueItemLock, zypp::solver::detail::SolverQueueItemUpdate, and zypp::solver::detail::SolutionAction.
Definition at line 48 of file ReferenceCounted.cc.
|
inlineprotectedvirtual |
Trigger derived classes after refCount was increased.
Definition at line 100 of file ReferenceCounted.h.
|
inlineprotectedvirtual |
Trigger derived classes after refCount was decreased.
No trigger is sent, if refCount got zero (i.e. the object is deleted).
Reimplemented in zypp::target::rpm::librpmDb.
Definition at line 106 of file ReferenceCounted.h.
|
private |
Throws Exception on unref.
Definition at line 42 of file ReferenceCounted.cc.
|
friend |
Stream output via dumpOn.
|
related |
intrusive_ptr hook to add_ref.
Definition at line 118 of file ReferenceCounted.h.
|
related |
intrusive_ptr hook to release.
Definition at line 122 of file ReferenceCounted.h.
|
related |
Stream output.
Definition at line 126 of file ReferenceCounted.h.
|
mutableprivate |
The reference counter.
Definition at line 110 of file ReferenceCounted.h.