Public Member Functions | List of all members
UUID Class Reference

UUID class, using the Boost uuid implementation. More...

#include <UUID.hpp>

Public Member Functions

 UUID ()
 Construct a new UUID with a random value. More...
 
 UUID (const UUID &copy)=default
 Construct a new UUID by copying the supplied instance. More...
 
std::array< unsigned char, 16 > asArray () const
 Get the UUID as a std::array of bytes. More...
 
const unsigned char * asBytes () const
 Get the UUID as raw bytes. More...
 
template<typename AllocatorT >
Balau::U8String< AllocatorT > asString () const
 Get the UUID as a UTF-8 string. More...
 
std::string asString () const
 Get the UUID as a UTF-8 string. More...
 
const boost::uuids::uuid & asUUID () const
 Get the UUID as the underlying Boost UUID. More...
 
bool operator!= (const UUID &rhs) const
 Are the two UUIDs not equal? More...
 
bool operator< (const UUID &rhs) const
 Is this UUID less than the supplied UUID? More...
 
bool operator<= (const UUID &rhs) const
 Is this UUID less or equal to the supplied UUID? More...
 
bool operator== (const UUID &rhs) const
 Are the two UUIDs equal? More...
 
bool operator> (const UUID &rhs) const
 Is this UUID greater than the supplied UUID? More...
 
bool operator>= (const UUID &rhs) const
 Is this UUID greater or equal to the supplied UUID? More...
 

Detailed Description

UUID class, using the Boost uuid implementation.

Constructor & Destructor Documentation

◆ UUID() [1/2]

UUID ( )
inline

Construct a new UUID with a random value.

◆ UUID() [2/2]

UUID ( const UUID copy)
default

Construct a new UUID by copying the supplied instance.

Member Function Documentation

◆ asArray()

std::array<unsigned char, 16> asArray ( ) const
inline

Get the UUID as a std::array of bytes.

This allocates a std::array object.

◆ asBytes()

const unsigned char* asBytes ( ) const
inline

Get the UUID as raw bytes.

This returns the bytes directly. No object construction is performed.

◆ asString() [1/2]

Balau::U8String<AllocatorT> asString ( ) const
inline

Get the UUID as a UTF-8 string.

This allocates a string stream and string object.

◆ asString() [2/2]

std::string asString ( ) const
inline

Get the UUID as a UTF-8 string.

This allocates a string stream and string object.

◆ asUUID()

const boost::uuids::uuid& asUUID ( ) const
inline

Get the UUID as the underlying Boost UUID.

No object construction is performed.

◆ operator!=()

bool operator!= ( const UUID rhs) const
inline

Are the two UUIDs not equal?

◆ operator<()

bool operator< ( const UUID rhs) const
inline

Is this UUID less than the supplied UUID?

◆ operator<=()

bool operator<= ( const UUID rhs) const
inline

Is this UUID less or equal to the supplied UUID?

◆ operator==()

bool operator== ( const UUID rhs) const
inline

Are the two UUIDs equal?

◆ operator>()

bool operator> ( const UUID rhs) const
inline

Is this UUID greater than the supplied UUID?

◆ operator>=()

bool operator>= ( const UUID rhs) const
inline

Is this UUID greater or equal to the supplied UUID?


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