Drag[en]gine Game Engine
1.21
|
Template version of deObjectReference. More...
#include <deTObjectReference.h>
Public Member Functions | |
Constructors and Destructors | |
deTObjectReference () | |
Create empty object reference holder. More... | |
deTObjectReference (T *object) | |
Create object reference holder with object. More... | |
deTObjectReference (const deTObjectReference &reference) | |
Create object reference holder with object from another holder. More... | |
~deTObjectReference () | |
Clean up object reference holder. More... | |
Management | |
void | TakeOver (T *object) |
Set object without adding reference. More... | |
void | TakeOver (deTObjectReference &reference) |
Move reference. More... | |
void | TakeOver (const deTObjectReference &reference) |
Add reference. More... | |
bool | operator! () const |
Object is nullptr. More... | |
operator bool () const | |
Test if object is not nullptr. More... | |
operator T* () const | |
Pointer to object. More... | |
operator T& () const | |
C to object. More... | |
T * | operator-> () const |
Pointer to object. More... | |
deTObjectReference & | operator= (T *object) |
Store object. More... | |
deTObjectReference & | operator= (const deTObjectReference &reference) |
Store object. More... | |
bool | operator== (T *object) const |
Test if object is held by this holder. More... | |
bool | operator== (const deTObjectReference &reference) const |
Test if object is held by this holder. More... | |
bool | operator!= (T *object) const |
Test if object is not held by this holder. More... | |
bool | operator!= (const deTObjectReference &reference) const |
Test if object is not held by this holder. More... | |
static deTObjectReference | New (T *object) |
Create instance taking over reference. More... | |
static deTObjectReference | New (const deTObjectReference &reference) |
Returns reference to protect against problems. More... | |
static deTObjectReference | New (deTObjectReference &reference) |
Returns reference to protect against problems. More... | |
Template version of deObjectReference.
Safe way to hold an object reference with correct reference handling. Storing nullptr is allowed. Initial value is nullptr.
|
inline |
Create empty object reference holder.
|
inline |
Create object reference holder with object.
Reference is added if object is not nullptr.
|
inline |
Create object reference holder with object from another holder.
Reference is added if object in holder is not nullptr.
|
inline |
Clean up object reference holder.
Releases reference if object is not nullptr.
|
inlinestatic |
Returns reference to protect against problems.
|
inlinestatic |
Returns reference to protect against problems.
|
inlinestatic |
Create instance taking over reference.
Same as calling TakeOver() on a new instance but allows for inline use.
References deTObjectReference< T >::TakeOver().
|
inline |
Test if object is not nullptr.
|
inline |
C to object.
deeNullPointer | if object is nullptr. |
|
inline |
Pointer to object.
|
inline |
Object is nullptr.
|
inline |
Test if object is not held by this holder.
|
inline |
Test if object is not held by this holder.
|
inline |
|
inline |
Store object.
If an object is already held its reference is release and the new object stored. If the new object is not nullptr a reference is added.
References deTObjectReference< T >::operator=().
|
inline |
Store object.
If an object is already held its reference is release and the new object stored. If the new object is not nullptr a reference is added.
Referenced by deTObjectReference< T >::operator=().
|
inline |
Test if object is held by this holder.
|
inline |
Test if object is held by this holder.
|
inline |
Add reference.
|
inline |
Move reference.
|
inline |
Set object without adding reference.
Use this method if the object to hold has been added a reference already. This is the case with created objects as well as certain methods returning newly created objects. In all these cases the object has to be held without adding a reference. For all other situations use the constructor or assignment operator.
It is allowed for object to be a nullptr object.
Referenced by deTObjectReference< T >::New().