Torque3D Documentation / _generateds / StrongWeakRefPtr

StrongWeakRefPtr

Engine/source/core/util/refBase.h

This oxymoron is a pointer that reference-counts the referenced object but also NULLs out if the object goes away.

More...

Public Functions

Private Functions

T *
_get()
_set(T * ptr)

Detailed Description

This oxymoron is a pointer that reference-counts the referenced object but also NULLs out if the object goes away.

This is useful for situations where an object's lifetime is ultimately governed by a superior entity but where individual objects may also die independently of the superior entity. All client code should use StrongWeakRefs that keep object live as long as the superior entity doesn't step in and kill them (in which case, the client code sees the reference disappear).

Private Attributes

WeakRefBase::WeakReference * mReference 

Public Functions

StrongWeakRefPtr()

StrongWeakRefPtr(T * ptr)

~StrongWeakRefPtr()

getPointer()

isNull()

operator T*()

operator!()

operator!=(T * ptr)

operator*()

operator->()

operator=(T * ptr)

operator==(T * ptr)

Private Functions

_get()

_set(T * ptr)