StevEngine
StevEngine is a customizable C++ game engine.
Loading...
Searching...
No Matches
StevEngine::Utilities::ID Class Reference

UUID-based unique identifier. More...

#include <utilities/ID.hpp>

Public Member Functions

 ID ()
 Generate new random UUID.
 
 ID (const ID &other)
 Copy constructor.
 
 ID (uint8_t *raw)
 Create from raw bytes.
 
 ID (const char *text)
 Create from string representation.
 
const char * GetString () const
 Get string representation.
 
IDoperator= (const ID &other)
 Assignment operator.
 
bool operator== (const ID &other) const
 Equality comparison.
 
bool operator< (const ID &other) const
 Less than comparison for sorting.
 
bool operator() (const ID &lhs, const ID &rhs) const
 Compare function for containers.
 
bool IsNull () const
 Check if ID is null/empty.
 
const uint8_t * GetRaw () const
 

Static Public Attributes

static ID empty = ID(e)
 Null/empty ID value.
 

Detailed Description

UUID-based unique identifier.

Implements UUIDv7 generation for unique object identification. Provides comparison, serialization and string conversion.

Constructor & Destructor Documentation

◆ ID() [1/3]

StevEngine::Utilities::ID::ID ( const ID & other)

Copy constructor.

Parameters
otherID to copy

◆ ID() [2/3]

StevEngine::Utilities::ID::ID ( uint8_t * raw)

Create from raw bytes.

Parameters
raw16-byte UUID data

◆ ID() [3/3]

StevEngine::Utilities::ID::ID ( const char * text)

Create from string representation.

Parameters
stringUUID string

Member Function Documentation

◆ GetString()

const char * StevEngine::Utilities::ID::GetString ( ) const

Get string representation.

Returns
UUID as string

◆ IsNull()

bool StevEngine::Utilities::ID::IsNull ( ) const

Check if ID is null/empty.

Returns
true if null ID

◆ operator()()

bool StevEngine::Utilities::ID::operator() ( const ID & lhs,
const ID & rhs ) const

Compare function for containers.

Parameters
lhsFirst ID
rhsSecond ID
Returns
true if lhs < rhs

◆ operator<()

bool StevEngine::Utilities::ID::operator< ( const ID & other) const

Less than comparison for sorting.

Parameters
otherID to compare
Returns
true if this < other

◆ operator=()

ID & StevEngine::Utilities::ID::operator= ( const ID & other)

Assignment operator.

Parameters
otherID to copy
Returns
Reference to this

◆ operator==()

bool StevEngine::Utilities::ID::operator== ( const ID & other) const

Equality comparison.

Parameters
otherID to compare
Returns
true if IDs match

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