Base class for reference counted objects.
More...
#include <ReferenceCounted.h>
|
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...
|
|
Base class for reference counted objects.
- Todo:
- Make counter thread safe.
Definition at line 33 of file ReferenceCounted.h.
zypp::base::ReferenceCounted::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.
unsigned zypp::base::ReferenceCounted::refCount |
( |
| ) |
const |
|
inline |
void zypp::base::ReferenceCounted::ref |
( |
| ) |
const |
|
inline |
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 73 of file ReferenceCounted.h.
static void zypp::base::ReferenceCounted::add_ref |
( |
const ReferenceCounted * |
ptr_r | ) |
|
|
inlinestatic |
static void zypp::base::ReferenceCounted::release |
( |
const ReferenceCounted * |
ptr_r | ) |
|
|
inlinestatic |
std::ostream & zypp::base::ReferenceCounted::dumpOn |
( |
std::ostream & |
str | ) |
const |
|
protectedvirtual |
Overload to realize std::ostream & operator<<.
Reimplemented in zypp::target::rpm::RpmDb, zypp::media::MediaAccess, zypp::target::rpm::librpmDb, zypp::MediaSetAccess, zypp::Target, zypp::target::rpm::RpmHeader, zypp::target::TargetImpl, zypp::target::rpm::BinHeader, zypp::ResObject, zypp::Resolvable, and zypp::parser::susetags::RepoIndex.
Definition at line 48 of file ReferenceCounted.cc.
virtual void zypp::base::ReferenceCounted::ref_to |
( |
unsigned |
| ) |
const |
|
inlineprotectedvirtual |
virtual void zypp::base::ReferenceCounted::unref_to |
( |
unsigned |
| ) |
const |
|
inlineprotectedvirtual |
void zypp::base::ReferenceCounted::unrefException |
( |
| ) |
const |
|
private |
Stream output via dumpOn.
unsigned zypp::base::ReferenceCounted::_counter |
|
mutableprivate |
The documentation for this class was generated from the following files: