20 #ifndef FASTUIDRAW_REFERENCE_COUNTED_HPP 21 #define FASTUIDRAW_REFERENCE_COUNTED_HPP 60 fake_function(
void)
const 83 T::add_reference(m_p);
96 T::add_reference(m_p);
112 T::add_reference(m_p);
134 T::remove_reference(m_p);
171 T::remove_reference(m_p);
254 operator unspecified_bool_type()
const 256 return m_p ? &reference_counted_ptr::fake_function : 0;
280 return m_p == rhs.
get();
305 return m_p != rhs.
get();
315 return get() < rhs.
get();
330 T::remove_reference(m_p);
342 return static_cast<U*
>(
get());
353 return const_cast<U*
>(
get());
364 return dynamic_cast<U*
>(
get());
376 template<
typename T,
typename S>
382 return lhs == rhs.
get();
390 template<
typename T,
typename S>
396 return lhs != rhs.
get();
432 template<
typename T,
typename Counter>
455 p->m_counter.add_reference();
468 if (p->m_counter.remove_reference())
476 mutable Counter m_counter;
bool operator!=(const reference_counted_ptr< U > &rhs) const
file fastuidraw_memory.hpp
reference_counted_base< T, reference_count_atomic > concurrent
Typedef to reference counting which is thread safe by atomically adding and removing reference...
Base class to use for reference counted objects, for using reference_counted_ptr. See also reference_...
reference_counted_ptr< U > static_cast_ptr(void) const
reference_counted_ptr(void)
reference_counted_ptr(reference_counted_ptr &&obj)
all classes and functions of FastUIDraw are in the namespace fastuidraw.
reference_counted_ptr< U > const_cast_ptr(void) const
static void add_reference(const reference_counted_base< T, Counter > *p)
A wrapper over a pointer to implement reference counting.
T * operator->(void) const
void swap(reference_counted_ptr &rhs)
bool operator<(const reference_counted_ptr &rhs) const
reference_counted_ptr(T *p)
reference_counted_ptr< U > dynamic_cast_ptr(void) const
static void remove_reference(const reference_counted_base< T, Counter > *p)
file reference_count_atomic.hpp
reference_counted_base(void)
reference_counted_ptr(const reference_counted_ptr &obj)
reference_counted_ptr & operator=(const reference_counted_ptr &rhs)
bool operator==(U *rhs) const
reference_counted_base< T, reference_count_non_concurrent > non_concurrent
Typedef to reference counting which is NOT thread safe.
file reference_count_non_concurrent.hpp
T & operator*(void) const
reference_counted_ptr(const reference_counted_ptr< U > &obj)
reference_counted_ptr & operator=(T *rhs)
reference_counted_ptr & operator=(const reference_counted_ptr< U > &rhs)
A common base class to use for resources that need to be saved opaquely.
Defines default reference counting base classes.
bool operator!=(U *rhs) const
#define FASTUIDRAWdelete(ptr)
reference_counted_ptr & operator=(reference_counted_ptr &&rhs)
Class for which copy ctor and assignment operator are private functions.
#define FASTUIDRAWassert(X)
bool operator==(const reference_counted_ptr< U > &rhs) const