HDK
|
#include <handle.h>
Public Member Functions | |
HgiHandle () | |
HgiHandle (T *obj, uint64_t id) | |
T * | Get () const |
operator bool () const | |
T * | operator-> () const |
bool | operator== (const HgiHandle &other) const |
bool | operator!= (const HgiHandle &other) const |
Handle that contains a hgi object and unique id.
The unique id is used to compare two handles to guard against pointer aliasing, where the same memory address is used to create a similar object, but it is not actually the same object.
Handle is not a shared or weak_ptr and destruction of the contained object should be explicitely managed by the client via the HgiDestroy*** functions.
If shared/weak ptr functionality is desired, the client creating Hgi objects can wrap the returned handle in a shared_ptr.