Loading...
Searching...
No Matches
HgiHandle< T > Class Template Reference

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

#include <handle.h>

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.

Constructor & Destructor Documentation

◆ HgiHandle() [1/2]

HgiHandle ( )
inline

Definition at line 52 of file handle.h.

◆ HgiHandle() [2/2]

HgiHandle ( T *  obj,
uint64_t  id 
)
inline

Definition at line 53 of file handle.h.

Member Function Documentation

◆ Get()

T * Get ( ) const
inline

Definition at line 56 of file handle.h.

◆ operator bool()

operator bool ( ) const
inlineexplicit

Definition at line 61 of file handle.h.

◆ operator!=()

bool operator!= ( const HgiHandle< T > &  other) const
inline

Definition at line 70 of file handle.h.

◆ operator->()

T * operator-> ( ) const
inline

Definition at line 64 of file handle.h.

◆ operator==()

bool operator== ( const HgiHandle< T > &  other) const
inline

Definition at line 66 of file handle.h.


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