My Project
Public Types | Public Member Functions | List of all members
ParaEngine::weak_ptr< RealT, DefaultPointerClass > Struct Template Reference

weak reference ptr use in a class like this: weak_ptr<CRefCounted> p; e.g. More...

#include <PERef.h>

Public Types

typedef weak_ref_object< RealT > WeakRefObject_type
 

Public Member Functions

 weak_ptr (WeakRefObject_type *p)
 
template<class Y >
 weak_ptr (Y *p)
 Y must be derived class of RealT. More...
 
 weak_ptr (const weak_ptr &r)
 
weak_ptroperator= (const weak_ptr &r)
 
weak_ptroperator= (WeakRefObject_type *r)
 
template<class Y >
weak_ptroperator= (Y *r)
 Y must be derived class of RealT. More...
 
template<class Y >
 operator Y* () const
 Y must be derived class of RealT. More...
 
DefaultPointerClass & operator* () const
 
DefaultPointerClass * operator-> () const
 
DefaultPointerClass * get () const
 
WeakRefObject_typeget_weak_ref_object () const
 
 operator bool () const
 
bool operator! () const
 
int use_count () const
 
bool unique () const
 
void reset ()
 
bool operator== (weak_ptr const &b) const
 
bool operator!= (weak_ptr const &b) const
 
void UnWatch ()
 

Detailed Description

template<class RealT, class DefaultPointerClass = RealT>
struct ParaEngine::weak_ptr< RealT, DefaultPointerClass >

weak reference ptr use in a class like this: weak_ptr<CRefCounted> p; e.g.

IObject* pObj = NULL; WeakPtr a; WeakPtr b(pObj); PE_ASSERT(a == pObj && pObj == a && a == b);

Constructor & Destructor Documentation

§ weak_ptr()

template<class RealT, class DefaultPointerClass = RealT>
template<class Y >
ParaEngine::weak_ptr< RealT, DefaultPointerClass >::weak_ptr ( Y *  p)
inlineexplicit

Y must be derived class of RealT.

Member Function Documentation

§ operator Y*()

template<class RealT, class DefaultPointerClass = RealT>
template<class Y >
ParaEngine::weak_ptr< RealT, DefaultPointerClass >::operator Y* ( ) const
inline

Y must be derived class of RealT.

support casting to any derived class of RealT, such as CBaseObject, IAttributeObject, IGameObject, etc.

§ operator=()

template<class RealT, class DefaultPointerClass = RealT>
template<class Y >
weak_ptr& ParaEngine::weak_ptr< RealT, DefaultPointerClass >::operator= ( Y *  r)
inline

Y must be derived class of RealT.


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