GL Studio C++ Runtime API
|
#include <weak_reference.h>
Public Member Functions | |
WeakRef () | |
WeakRef (WeakReferenceable *weakReferenceable) | |
WeakRef (const WeakRef &w) | |
template<class U > | |
WeakRef (const WeakRef< U > &w) | |
WeakRef & | operator= (WeakReferenceable *weakReferenceable) |
WeakRef & | operator= (const WeakRef &w) |
template<class U > | |
WeakRef & | operator= (const WeakRef< U > &w) |
bool | IsNull () const |
T * | Get () const |
WeakReferenceable * | GetWeakReferenceable () const |
helper class to simplify working with a weak reference Ex Usage: DisplayObject* obj = GetSomeDisplayObject(); WeakRef< DisplayObject > weakRef = obj; ... ... some code that may or may not have deleted obj ... if( !weakRef.IsNull() ) { weakRef.Get()->Location( 0, 0, 0 ); }
|
inline |
default ctor – initializes weak reference to NULL
|
inline |
construct from a WeakReferenceable pointer
[in] | weakReferenceable | pointer to an WeakReferenceable interface ( can be NULL ) |
construct from an WeakRef< T >
[in] | w | WeakRef< T > ( can be NULL ) |
construct from an WeakRef< U >
[in] | w | WeakRef< U > ( can be NULL ) |
|
inline |
Get a T*
|
inline |
get the WeakReferenceable* contained in this weak ref
|
inline |
determine if weak reference is NULL
assign this pointer to point to the given WeakRef< T >
w | WeakRef< T > in question (can be NULL) |
assign this pointer to point to the given WeakRef< U >
w | WeakRef< U > in question (can be NULL) |
|
inline |
assign this weak ref to reference the given WeakReferenceable*
weakReferenceable | WeakReferenceable* in question (can be NULL) |