![]() |
Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
|
A handle to an object or an id. More...
#include <gf/Handle.h>
Public Member Functions | |
Handle ()=default | |
Default constructor. More... | |
Handle (Id id) | |
Constructor with an id. More... | |
template<typename T > | |
Handle (T &object) | |
Coonstructor with an object. More... | |
Id | asId () const |
Get the contained id. More... | |
template<typename T > | |
T & | as () |
Get the reference to the object. More... | |
template<typename T > | |
const T & | as () const |
Get the reference to the object. More... | |
A handle to an object or an id.
A handle is a very light container around either an id or a reference to an object. No type checking is made, it's up to the user to know what to do with this handle.
|
default |
Default constructor.
|
inlineexplicit |
Constructor with an id.
|
inlineexplicit |
Coonstructor with an object.
|
inline |
Get the reference to the object.
|
inline |
Get the reference to the object.
|
inline |
Get the contained id.
Id gf::Handle::m_id |
void* gf::Handle::m_ptr |