12 #ifndef ZYPP_BASE_REFERENCECOUNTED_H 13 #define ZYPP_BASE_REFERENCECOUNTED_H 87 {
if( ptr_r ) ptr_r->
ref(); }
93 {
if( ptr_r ) ptr_r->
unref(); }
97 virtual std::ostream &
dumpOn( std::ostream &
str )
const;
136 #define IMPL_PTR_TYPE(NAME) \ 137 void intrusive_ptr_add_ref( const NAME * ptr_r ) \ 138 { zypp::base::ReferenceCounted::add_ref( ptr_r ); } \ 139 void intrusive_ptr_release( const NAME * ptr_r ) \ 140 { zypp::base::ReferenceCounted::release( ptr_r ); } 143 #endif // ZYPP_BASE_REFERENCECOUNTED_H void unrefException() const
Throws Exception on unref.
virtual std::ostream & dumpOn(std::ostream &str) const
Overload to realize std::ostream & operator<<.
String related utilities and Regular expression matching.
unsigned refCount() const
Return reference counter value.
virtual void ref_to(unsigned) const
Trigger derived classes after refCount was increased.
void intrusive_ptr_add_ref(const ReferenceCounted *ptr_r)
virtual ~ReferenceCounted()
Dtor.
static void release(const ReferenceCounted *ptr_r)
Called by zypp::intrusive_ptr to add a reference.
void intrusive_ptr_release(const ReferenceCounted *ptr_r)
unsigned _counter
The reference counter.
Base class for reference counted objects.
ReferenceCounted & operator=(const ReferenceCounted &)
Assignment.
void unref() const
Release a reference.
virtual void unref_to(unsigned) const
Trigger derived classes after refCount was decreased.
Easy-to use interface to the ZYPP dependency resolver.
ReferenceCounted()
Default ctor.
static void add_ref(const ReferenceCounted *ptr_r)
Called by zypp::intrusive_ptr to add a reference.
friend std::ostream & operator<<(std::ostream &str, const ReferenceCounted &obj)
Stream output via dumpOn.
void ref() const
Add a reference.
std::ostream & operator<<(std::ostream &str, const ReferenceCounted &obj)