28 #ifndef OVR_RefCount_h
29 #define OVR_RefCount_h
82 #ifdef OVR_BUILD_DEBUG
83 static void OVR_CDECL reportInvalidDelete(
void *pmem);
87 reportInvalidDelete(pmem);
117 #ifdef OVR_BUILD_DEBUG
118 static void OVR_CDECL reportInvalidDelete(
void *pmem);
122 reportInvalidDelete(pmem);
182 #ifdef OVR_DEFINE_NEW
186 #ifdef OVR_BUILD_DEBUG
188 #define OVR_REFCOUNTALLOC_CHECK_DELETE(class_name, p) \
189 do {if (p) Base::checkInvalidDelete((class_name*)p); } while(0)
191 #define OVR_REFCOUNTALLOC_CHECK_DELETE(class_name, p)
197 #undef OVR_REFCOUNTALLOC_CHECK_DELETE
199 #ifdef OVR_DEFINE_NEW
200 #define new OVR_DEFINE_NEW
217 #ifdef OVR_DEFINE_NEW
221 #define OVR_REFCOUNTALLOC_CHECK_DELETE(class_name, p)
226 #undef OVR_REFCOUNTALLOC_CHECK_DELETE
228 #ifdef OVR_DEFINE_NEW
229 #define new OVR_DEFINE_NEW
249 class RefCountBase :
public RefCountBaseStatImpl<RefCountImpl>
277 class RefCountBaseNTS :
public RefCountBaseStatImpl<RefCountNTSImpl>
288 template <
typename T>
300 template <
typename OT>
329 template <
typename T>
347 static C* ReturnArg(
void* p) {
return (C*)
ReturnArg0(p); }
375 if (pobj) pobj->AddRef();
387 if (src) src->AddRef();
416 if (src) src->AddRef();
424 if (src) src->AddRef();
432 if (psrc) psrc->AddRef();
457 if (src) src->AddRef();
465 if (src) src->AddRef();
OVR_FORCE_INLINE RefCountImplCore()
OVR_FORCE_INLINE Ptr< C > & SetPtr(const Ptr< R > &src)
OVR_FORCE_INLINE bool operator==(const Ptr &other) const
OVR_FORCE_INLINE void Clear()
OVR_FORCE_INLINE Ptr< C > & SetPtr(Pickable< C > src)
OVR_FORCE_INLINE bool operator<(const Ptr &other) const
void operator=(const RefCountNTSImplCore &)
#define OVR_MEMORY_REDEFINE_NEW_IMPL(class_name, check_delete)
OVR_FORCE_INLINE C * operator->() const
OVR_FORCE_INLINE RefCountBaseV()
OVR_FORCE_INLINE RefCountNTSImplCore()
OVR_FORCE_INLINE C * GetPtr() const
Pickable(const Pickable< OT > &other)
OVR_FORCE_INLINE const Ptr< C > & operator=(const Ptr< R > &src)
OVR_FORCE_INLINE Ptr(const Ptr< C > &src)
OVR_FORCE_INLINE Ptr< C > & Pick(Pickable< R > v)
OVR_FORCE_INLINE Ptr< C > & Pick(C *p)
virtual ~RefCountImplCore()
OVR_FORCE_INLINE void AddRef() const
static OVR_FORCE_INLINE void checkInvalidDelete(RefCountNTSImplCore *)
OVR_FORCE_INLINE Ptr< C > & SetPtr(C *psrc)
OVR_FORCE_INLINE Ptr< C > & Pick(Pickable< C > v)
OVR_FORCE_INLINE C & operator*() const
OVR_FORCE_INLINE bool operator!=(const Ptr &other) const
void * ReturnArg0(void *p)
OVR_FORCE_INLINE Ptr< C > & SetPtr(const Ptr< C > &src)
OVR_FORCE_INLINE Ptr< C > & Pick(Ptr< C > &other)
virtual ~RefCountNTSImplCore()
OVR_FORCE_INLINE C *& GetRawRef()
void operator=(const RefCountImplCore &)
OVR_FORCE_INLINE Ptr(Pickable< C > v)
OVR_FORCE_INLINE Ptr(Ptr< C > &other, PickType)
OVR_FORCE_INLINE Ptr(Pickable< R > v)
#define OVR_REFCOUNTALLOC_CHECK_DELETE(class_name, p)
static void checkInvalidDelete(RefCountImplCore *)
OVR_FORCE_INLINE RefCountBaseNTS()
OVR_FORCE_INLINE RefCountBase()
OVR_FORCE_INLINE Pickable< T > MakePickable(T *p)
OVR_FORCE_INLINE Ptr(Ptr< R > &src)
OVR_FORCE_INLINE Ptr(C *pobj)
OVR_FORCE_INLINE Ptr< C > & SetPtr(C &src)
OVR_FORCE_INLINE void NullWithoutRelease()
Pickable & operator=(const Pickable &other)