12 #ifndef ZYPP_CORE_BASE_REFERENCECOUNTED_H 13 #define ZYPP_CORE_BASE_REFERENCECOUNTED_H 68 { ref_to( ++_counter ); }
88 {
if( ptr_r ) ptr_r->
ref(); }
94 {
if( ptr_r ) ptr_r->
unref(); }
98 virtual std::ostream &
dumpOn( std::ostream &
str )
const;
114 void unrefException()
const;
137 #define IMPL_PTR_TYPE(NAME) \ 138 void intrusive_ptr_add_ref( const NAME * ptr_r ) \ 139 { zypp::base::ReferenceCounted::add_ref( ptr_r ); } \ 140 void intrusive_ptr_release( const NAME * ptr_r ) \ 141 { zypp::base::ReferenceCounted::release( ptr_r ); } 144 #endif // ZYPP_CORE_BASE_REFERENCECOUNTED_H virtual std::ostream & dumpOn(std::ostream &str) const
Overload to realize std::ostream & operator<<.
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const Flags< TEnum > &obj)
unsigned refCount() const
Return reference counter value.
Provides API related macros.
virtual void ref_to(unsigned) const
Trigger derived classes after refCount was increased.
void intrusive_ptr_add_ref(const ReferenceCounted *ptr_r)
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
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.
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
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.
static void add_ref(const ReferenceCounted *ptr_r)
Called by zypp::intrusive_ptr to add a reference.
void ref() const
Add a reference.
std::ostream & operator<<(std::ostream &str, const ReferenceCounted &obj)