SuperDex Physics C++ API
Loading...
Searching...
No Matches
superdex::Handle Struct Reference

Generic 64-bit handle providing base functionality for strongly-typed handles. More...

#include <mochi_handle.h>

Inheritance diagram for superdex::Handle:
superdex::ActorHandle superdex::CallbackHandle superdex::ConstraintHandle superdex::QueryHandle superdex::SceneHandle superdex::ShapeHandle superdex::StateHandle

Public Types

using ValueType = uint64_t
 Raw 64-bit identifier type.

Public Member Functions

uint64_t GetHash () const
 Compute a hash of the handle for use in unordered containers.
 Handle ()=default
 Handle (ValueType raw)
 Construct a handle from its raw 64-bit identifier.
bool IsValid () const
 Check whether the handle is valid (i.e., its value is non-zero).
bool operator!= (Handle const &rhs) const
bool operator< (Handle const &rhs) const
bool operator== (Handle const &rhs) const

Public Attributes

ValueType value = kInvalidHandle
 Raw 64-bit identifier.

Detailed Description

Generic 64-bit handle providing base functionality for strongly-typed handles.

Definition at line 31 of file mochi_handle.h.

Member Typedef Documentation

◆ ValueType

using superdex::Handle::ValueType = uint64_t

Raw 64-bit identifier type.

Definition at line 32 of file mochi_handle.h.

Constructor & Destructor Documentation

◆ Handle() [1/2]

superdex::Handle::Handle ( )
default

◆ Handle() [2/2]

superdex::Handle::Handle ( ValueType raw)
inlineexplicit

Construct a handle from its raw 64-bit identifier.

Parameters
[in]rawThe raw handle identifier.

Definition at line 27 of file mochi_handle_inl.h.

Member Function Documentation

◆ GetHash()

uint64_t superdex::Handle::GetHash ( ) const
inline

Compute a hash of the handle for use in unordered containers.

Returns
The hash of the handle's raw identifier.

Definition at line 41 of file mochi_handle_inl.h.

◆ IsValid()

bool superdex::Handle::IsValid ( ) const
inline

Check whether the handle is valid (i.e., its value is non-zero).

Returns
True if the handle is valid, false otherwise.

Definition at line 29 of file mochi_handle_inl.h.

◆ operator!=()

bool superdex::Handle::operator!= ( Handle const & rhs) const
inline

Definition at line 35 of file mochi_handle_inl.h.

◆ operator<()

bool superdex::Handle::operator< ( Handle const & rhs) const
inline

Definition at line 38 of file mochi_handle_inl.h.

◆ operator==()

bool superdex::Handle::operator== ( Handle const & rhs) const
inline

Definition at line 32 of file mochi_handle_inl.h.

Member Data Documentation

◆ value

ValueType superdex::Handle::value = kInvalidHandle

Raw 64-bit identifier.

Zero indicates an invalid handle.

Definition at line 35 of file mochi_handle.h.


The documentation for this struct was generated from the following files: