My Project
Public Member Functions | Protected Attributes | List of all members
ParaEngine::weak_ref_object< T > Class Template Reference

DONOT use this class directly, use weak_ptr instead. More...

#include <PERef.h>

Inheritance diagram for ParaEngine::weak_ref_object< T >:
ParaEngine::CRefCounted

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.
 
- Public Member Functions inherited from ParaEngine::CRefCounted
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 ()
 
CRefCountedAddToAutoReleasePool ()
 addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More...
 

Protected Attributes

T * m_watched_object
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 

Detailed Description

template<typename T>
class ParaEngine::weak_ref_object< T >

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.


The documentation for this class was generated from the following file: