FuncDoodle
Loading...
Searching...
No Matches
FuncDoodle::UUID Class Reference

Represents a single 16-byte opaque uuid-like unique identifier. More...

#include <UUID.h>

Classes

struct  Hash
 Hash functor for using UUID as an associative-container key. More...

Public Member Functions

 UUID (std::array< unsigned char, 16 > bytes)
 Constructs a UUID from raw bytes.
 UUID ()
std::array< unsigned char, 16 > Bytes ()
 Returns the raw 16-byte UUID payload.
const char * ToString () const
 Converts the UUID into its string form.
bool operator== (const UUID &other) const
 Compares two UUID values for equality.
bool operator!= (const UUID &other) const
 Compares two UUID values for inequality.
bool operator< (const UUID &other) const
 Orders UUID values lexicographically by raw bytes.
bool operator> (const UUID &other) const
 Orders UUID values lexicographically by raw bytes.
bool operator<= (const UUID &other) const
 Returns true when this UUID sorts before or equal to another.
bool operator>= (const UUID &other) const
 Returns true when this UUID sorts after or equal to another.
UUID operator+ (const UUID &other) const
 Combines two UUID values with byte-wise XOR.
UUID operator- (const UUID &other) const
 Subtracts UUID bytes pairwise.

Static Public Member Functions

static UUID Gen ()
 Generates a new UUID value.
static UUID FromString (const char *str)
 Parses a UUID from a string representation.

Private Attributes

std::array< unsigned char, 16 > m_Bytes

Friends

std::ostream & operator<< (std::ostream &os, const UUID &obj)
 Streams the UUID in its string form.

Detailed Description

Represents a single 16-byte opaque uuid-like unique identifier.

Note
This does not conform to RFC 4122 and uses a custom format.

Constructor & Destructor Documentation

◆ UUID() [1/2]

FuncDoodle::UUID::UUID ( std::array< unsigned char, 16 > bytes)
inline

Constructs a UUID from raw bytes.

◆ UUID() [2/2]

FuncDoodle::UUID::UUID ( )
inline

Member Function Documentation

◆ Bytes()

std::array< unsigned char, 16 > FuncDoodle::UUID::Bytes ( )
inline

Returns the raw 16-byte UUID payload.

◆ FromString()

UUID FuncDoodle::UUID::FromString ( const char * str)
static

Parses a UUID from a string representation.

◆ Gen()

UUID FuncDoodle::UUID::Gen ( )
static

Generates a new UUID value.

◆ operator!=()

bool FuncDoodle::UUID::operator!= ( const UUID & other) const

Compares two UUID values for inequality.

◆ operator+()

UUID FuncDoodle::UUID::operator+ ( const UUID & other) const
inline

Combines two UUID values with byte-wise XOR.

◆ operator-()

UUID FuncDoodle::UUID::operator- ( const UUID & other) const
inline

Subtracts UUID bytes pairwise.

◆ operator<()

bool FuncDoodle::UUID::operator< ( const UUID & other) const
inline

Orders UUID values lexicographically by raw bytes.

◆ operator<=()

bool FuncDoodle::UUID::operator<= ( const UUID & other) const
inline

Returns true when this UUID sorts before or equal to another.

◆ operator==()

bool FuncDoodle::UUID::operator== ( const UUID & other) const

Compares two UUID values for equality.

◆ operator>()

bool FuncDoodle::UUID::operator> ( const UUID & other) const
inline

Orders UUID values lexicographically by raw bytes.

◆ operator>=()

bool FuncDoodle::UUID::operator>= ( const UUID & other) const
inline

Returns true when this UUID sorts after or equal to another.

◆ ToString()

const char * FuncDoodle::UUID::ToString ( ) const
nodiscard

Converts the UUID into its string form.

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const UUID & obj )
friend

Streams the UUID in its string form.

Member Data Documentation

◆ m_Bytes

std::array<unsigned char, 16> FuncDoodle::UUID::m_Bytes
private

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