Nazara Engine
0.4
A fast, complete, cross-platform API designed for game development
|
Core class that represents a object handle. More...
Public Member Functions | |
ObjectHandle () | |
Constructs a ObjectHandle object by default. | |
ObjectHandle (T *object) | |
Constructs a ObjectHandle object with a pointer to an object. More... | |
ObjectHandle (const ObjectHandle &handle) | |
Constructs a ObjectHandle object by assignation. More... | |
ObjectHandle (ObjectHandle &&handle) noexcept | |
Constructs a ObjectHandle object by move semantic. More... | |
~ObjectHandle () | |
Destructs the object and calls reset with nullptr. More... | |
T * | GetObject () const |
Gets the underlying object. More... | |
bool | IsValid () const |
Checks whether the object is valid. More... | |
void | Reset (T *object=nullptr) |
Resets the content of the ObjectHandle with another object. More... | |
void | Reset (const ObjectHandle &handle) |
Resets the content of this with another object. More... | |
void | Reset (ObjectHandle &&handle) noexcept |
Resets the content of this with another object by move semantic. More... | |
ObjectHandle & | Swap (ObjectHandle &handle) |
Swaps the content of the two ObjectHandle. More... | |
Nz::String | ToString () const |
Gives a string representation. More... | |
operator bool () const | |
Converts the ObjectHandle to bool. More... | |
operator T* () const | |
Dereferences the ObjectHandle. More... | |
T * | operator-> () const |
Dereferences the ObjectHandle. More... | |
ObjectHandle & | operator= (T *object) |
Assigns the entity into this. More... | |
ObjectHandle & | operator= (const ObjectHandle &handle) |
Sets the handle of the ObjectHandle with the handle from another. More... | |
ObjectHandle & | operator= (ObjectHandle &&handle) noexcept |
Moves the ObjectHandle into this. More... | |
Static Public Attributes | |
static const ObjectHandle | InvalidHandle |
Protected Member Functions | |
void | OnObjectDestroyed () |
Action to do on object destruction. | |
void | OnObjectMoved (T *newObject) |
Action to do on object move. | |
Protected Attributes | |
T * | m_object |
Core class that represents a object handle.
|
explicit |
Constructs a ObjectHandle object with a pointer to an object.
object | Pointer to handle like an object (can be nullptr) |
Nz::ObjectHandle< T >::ObjectHandle | ( | const ObjectHandle< T > & | handle | ) |
Constructs a ObjectHandle object by assignation.
handle | ObjectHandle to assign into this |
|
noexcept |
Constructs a ObjectHandle object by move semantic.
handle | ObjectHandle to move into this |
Nz::ObjectHandle< T >::~ObjectHandle | ( | ) |
Destructs the object and calls reset with nullptr.
T * Nz::ObjectHandle< T >::GetObject | ( | ) | const |
Gets the underlying object.
bool Nz::ObjectHandle< T >::IsValid | ( | ) | const |
Checks whether the object is valid.
|
explicit |
Nz::ObjectHandle< T >::operator T* | ( | ) | const |
Dereferences the ObjectHandle.
T * Nz::ObjectHandle< T >::operator-> | ( | ) | const |
Dereferences the ObjectHandle.
ObjectHandle< T > & Nz::ObjectHandle< T >::operator= | ( | T * | entity | ) |
Assigns the entity into this.
entity | Pointer to handle like an object (can be nullptr) |
ObjectHandle< T > & Nz::ObjectHandle< T >::operator= | ( | const ObjectHandle< T > & | handle | ) |
Sets the handle of the ObjectHandle with the handle from another.
handle | The other ObjectHandle |
|
noexcept |
Moves the ObjectHandle into this.
handle | ObjectHandle to move in this |
void Nz::ObjectHandle< T >::Reset | ( | T * | object = nullptr | ) |
Resets the content of the ObjectHandle with another object.
object | Object to handle |
void Nz::ObjectHandle< T >::Reset | ( | const ObjectHandle< T > & | handle | ) |
Resets the content of this with another object.
handle | New object to handle |
|
noexcept |
Resets the content of this with another object by move semantic.
handle | New object to handle to move into this |
ObjectHandle< T > & Nz::ObjectHandle< T >::Swap | ( | ObjectHandle< T > & | handle | ) |
Swaps the content of the two ObjectHandle.
handle | ObjectHandle to swap |
Nz::String Nz::ObjectHandle< T >::ToString | ( | ) | const |
Gives a string representation.