12#ifndef ZYPP_CORE_BASE_REFERENCECOUNTED_H
13#define ZYPP_CORE_BASE_REFERENCECOUNTED_H
68 { ref_to( ++_counter ); }
98 virtual std::ostream &
dumpOn( std::ostream &
str )
const;
114 void unrefException()
const;
128 {
return obj.dumpOn(
str ); }
137#define IMPL_PTR_TYPE(NAME) \
138void intrusive_ptr_add_ref( const NAME * ptr_r ) \
139{ zypp::base::ReferenceCounted::add_ref( ptr_r ); } \
140void intrusive_ptr_release( const NAME * ptr_r ) \
141{ zypp::base::ReferenceCounted::release( ptr_r ); }
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Base class for reference counted objects.
void ref() const
Add a reference.
virtual void unref_to(unsigned) const
Trigger derived classes after refCount was decreased.
friend std::ostream & operator<<(std::ostream &str, const ReferenceCounted &obj)
Stream output via dumpOn.
void unref() const
Release a reference.
unsigned _counter
The reference counter.
static void add_ref(const ReferenceCounted *ptr_r)
Called by zypp::intrusive_ptr to add a reference.
unsigned refCount() const
Return reference counter value.
virtual void ref_to(unsigned) const
Trigger derived classes after refCount was increased.
ReferenceCounted & operator=(const ReferenceCounted &)
Assignment.
void intrusive_ptr_add_ref(const ReferenceCounted *ptr_r)
intrusive_ptr hook to add_ref.
static void release(const ReferenceCounted *ptr_r)
Called by zypp::intrusive_ptr to add a reference.
void intrusive_ptr_release(const ReferenceCounted *ptr_r)
intrusive_ptr hook to release.
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Provides API related macros.