All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HgiHandle< T > Class Template Reference

Handle that contains a hgi object and unique id. More...

Public Member Functions

 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
 

Detailed Description

template<class T>
class HgiHandle< T >

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.

Definition at line 49 of file handle.h.


The documentation for this class was generated from the following file: