Hide menu

Defines a Universally Unique IDentifier (UUID), also known as GUIDs (Globally Unique IDentifier). A UUID is a 16-byte (128-bit) number, that is unique in the computer system (guaranteed by generated algorithm ). More...

Public Types

typedef uint8_t ValueType
 
typedef std::array< ValueType, 16 > DataType
 

Public Member Functions

 Base_Uuid ()
 Creates the null UUID.
 
 Base_Uuid (const ValueType *theData)
 Creates a UUID with the values specified by the parameter. The function assumes theData contains 16 bytes and initializes the object with the values of these 16 bytes.
 
 Base_Uuid (DataType theData)
 
const DataType & Data () const
 
bool IsNull () const
 
 operator bool () const
 
bool operator== (const Base_Uuid &theOther) const
 
bool operator!= (const Base_Uuid &theOther) const
 
Base_String ToString () const
 Returns the string representation of this UUID. The string representation of a uuid is "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" where 'x' is a hexidecimal digit.
 

Static Public Member Functions

static Base_Uuid FromString (const Base_String &theStr)
 Creates a UUID object from a string. String must be formatted as five hex fields separated by '-', e.g., "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" where each 'x' is a hexidecimal digit. The curly braces shown here are optional. If the conversion fails, a null UUID is returned.
 
static Base_Uuid CreateRandom ()
 

Detailed Description

Defines a Universally Unique IDentifier (UUID), also known as GUIDs (Globally Unique IDentifier). A UUID is a 16-byte (128-bit) number, that is unique in the computer system (guaranteed by generated algorithm ).

Member Function Documentation

◆ CreateRandom()

Base_Uuid cadex::Base_Uuid::CreateRandom ( )
static

Creates new random uuid. This method is thread-safe and uses mutex to syncrhonize access to random number generator.

◆ IsNull()

bool cadex::Base_Uuid::IsNull ( ) const

Returns true if this is the null UUID {00000000-0000-0000-0000-000000000000}; otherwise returns false.