11 #ifndef _REFCOUNTEDPTR_H_ 12 #define _REFCOUNTEDPTR_H_ 83 inline bool isNull()
const;
94 inline operator const T* ()
const;
117 static const std::string&
name()
145 template <
class T>
inline 148 #ifdef CH_USE_MEMORY_TRACKING 157 template <
class T>
inline 160 #ifdef CH_USE_MEMORY_TRACKING 165 template <
class T>
inline 174 MayDay::Error(
"RefCountedPtr::RefCountedPtr(T* ptr) out of memory");
180 template <
class T>
inline 189 template <
class T>
inline 203 template <
class T>
inline 222 template <
class T>
inline 228 template <
class T>
inline 232 MayDay::Error(
"RefCountedPtr<T>::operator ->() on null pointer");
236 template <
class T>
inline 240 MayDay::Error(
"RefCountedPtr<T>::operator ->() on null pointer");
244 template <
class T>
inline 248 MayDay::Error(
"RefCountedPtr<T>::operator *() on null pointer");
252 template <
class T>
inline 259 MayDay::Error(
"RefCountedPtr<T>::operator *() on null pointer");
263 template <
class T>
inline 269 template <
class T>
inline 275 template <
class T>
inline 288 T2* t2 =
dynamic_cast<T2*
>(
ptr_);
292 #ifdef CH_USE_MEMORY_TRACKING 304 template <
class T>
inline 317 template <
class T>
inline const RefCountedPtr< T > & operator=(const RefCountedPtr< T > &rhs)
assignement operator. copies pointer member
Definition: RefCountedPtr.H:204
int * refCount_
Definition: RefCountedPtr.H:126
bool isNonUnique() const
true when refcount is one.
Definition: RefCountedPtr.H:270
static std::string name_
Definition: RefCountedPtr.H:127
A reference-counting handle class.
Definition: RefCountedPtr.H:66
#define CH_assert(cond)
Definition: CHArray.H:37
bool isNull() const
Definition: RefCountedPtr.H:223
T * operator->()
dereference access operator. use like a pointer derefence access function.
Definition: RefCountedPtr.H:229
void swap(RefCountedPtr< T > &b)
Definition: RefCountedPtr.H:305
void increment()
Definition: RefCountedPtr.H:146
void neverDelete()
Definition: RefCountedPtr.H:318
~RefCountedPtr()
Definition: RefCountedPtr.H:190
A Concrete Class for Dynamic Memory Management.
Definition: Arena.H:124
static int size_
Definition: RefCountedPtr.H:129
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
static BArena s_Arena
Definition: RefCountedPtr.H:128
T * ptr_
Definition: RefCountedPtr.H:125
T & operator*()
pointer dereference.
Definition: RefCountedPtr.H:245
static const std::string & name()
Definition: RefCountedPtr.H:117
void decrement()
Definition: RefCountedPtr.H:158
int refCount() const
Definition: RefCountedPtr.H:276
friend class RefCountedPtr
Definition: RefCountedPtr.H:115