My Project
|
DONOT use this class directly, use weak_ptr instead. More...
#include <PERef.h>
Public Member Functions | |
weak_ref_object (T *pWatchedObject) | |
bool | expired () const |
bool | IsValid () const |
T * | get () const |
get the watched real object pointer | |
operator T* () | |
void | UnWatch () |
this is usually called in the destructor of type T, so that we know that the pointer is invalid. | |
![]() | |
void | addref () const |
add reference count of the object. More... | |
bool | delref () const |
decrease reference count of the object. More... | |
int | GetRefCount () const |
get the reference count | |
virtual int | Release () |
CRefCounted * | AddToAutoReleasePool () |
addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More... | |
Protected Attributes | |
T * | m_watched_object |
![]() | |
int | m_refcount |
DONOT use this class directly, use weak_ptr instead.
single threaded weak reference class to work with intrusive reference count class T. T is usually CRefCounted derived class like CBaseObject.