26 #define REFPTR_DEBUG 0 28 #define REFERER_PARAM( x ) 41 unsigned int count()
const;
43 unsigned int instance()
const;
49 unsigned int _cumulative_references;
50 unsigned int _instance;
51 static unsigned int _ctor_calls;
61 extern unsigned int refptr_count;
76 T* operator->()
const;
79 bool operator!()
const;
113 _cumulative_references( 0 ),
114 _instance( ++_ctor_calls )
122 ++_cumulative_references;
135 inline unsigned int ref_counted::instance()
const 199 return get() == rptr.
get();
204 return get() != rptr.
get();
209 return get() < rptr.
get();
214 return get() <= rptr.
get();
219 return get() > rptr.
get();
224 return get() >= rptr.
get();
271 _ptr = rptr._ptr.exchange(
nullptr );
291 T* Pointee =
_ptr.load();
300 T* Pointee =
_ptr.exchange(
nullptr );
313 return ptr == rptr.
get();
319 return ptr != rptr.
get();
323 bool operator<( T* ptr, const ref_ptr<T>& rptr )
325 return ptr < rptr.get();
329 bool operator<=( T* ptr, const ref_ptr<T>& rptr )
331 return ptr <= rptr.get();
337 return ptr > rptr.
get();
343 return ptr >= rptr.
get();
bool operator>(T *ptr, const ref_ptr< T > &rptr)
std::atomic< unsigned int > _count
bool operator<(T *ptr, const ref_ptr< T > &rptr)
bool operator==(T *ptr, const ref_ptr< T > &rptr)
ref_counted & operator=(const ref_counted &)
ref_ptr & operator=(const ref_ptr &rptr)
bool operator<(const ref_ptr &rptr) const
bool operator>(const ref_ptr &rptr) const
bool operator>=(T *ptr, const ref_ptr< T > &rptr)
unsigned int count() const
bool operator<=(const ref_ptr &rptr) const
bool operator>=(const ref_ptr &rptr) const
bool operator!=(const ref_ptr &rptr) const
bool operator!=(T *ptr, const ref_ptr< T > &rptr)
bool operator<=(T *ptr, const ref_ptr< T > &rptr)
bool operator==(const ref_ptr &rptr) const