#include <RandomUuid.h>

Collaboration diagram for RandomUuid:

Public Types

using Serialized = std::array< uint8_t, 128/8 >
 UUID representation independent of machine byte-order architecture. More...
 

Public Member Functions

 RandomUuid ()
 creates a new unique ID (i.e. not a "nil UUID" in RFC 4122 terminology) More...
 
 RandomUuid (const Serialized &)
 imports a UUID value that was exported using the serialize() API More...
 
 RandomUuid (RandomUuid &&)=default
 
RandomUuidoperator= (RandomUuid &&)=default
 
RandomUuidoperator= (const RandomUuid &)=delete
 
Serialized serialize () const
 exports UUID value; suitable for long-term storage More...
 
bool operator== (const RandomUuid &) const
 
bool operator!= (const RandomUuid &other) const
 
RandomUuid clone () const
 creates a UUID object with the same value as this UUID More...
 
void print (std::ostream &os) const
 writes a human-readable representation More...
 

Private Member Functions

 RandomUuid (const RandomUuid &)=default
 
char * raw ()
 read/write access to storage bytes More...
 
const char * raw () const
 read-only access to storage bytes More...
 
bool sane () const
 whether this (being constructed) object follows UUID version 4 variant 1 format More...
 

Private Attributes

uint32_t timeLow
 
uint16_t timeMid
 
uint16_t timeHiAndVersion
 
uint8_t clockSeqHiAndReserved
 
uint8_t clockSeqLow
 
uint8_t node [6]
 

Detailed Description

128-bit Universally Unique IDentifier (UUID), version 4 (variant 1) as defined by RFC 4122. These UUIDs are generated from pseudo-random numbers.

Definition at line 17 of file RandomUuid.h.

Member Typedef Documentation

◆ Serialized

using RandomUuid::Serialized = std::array<uint8_t, 128/8>

Definition at line 21 of file RandomUuid.h.

Constructor & Destructor Documentation

◆ RandomUuid() [1/4]

RandomUuid::RandomUuid ( )

◆ RandomUuid() [2/4]

RandomUuid::RandomUuid ( const Serialized bytes)
explicit

Definition at line 55 of file RandomUuid.cc.

References Here, raw(), sane(), timeHiAndVersion, timeLow, and timeMid.

◆ RandomUuid() [3/4]

RandomUuid::RandomUuid ( RandomUuid &&  )
default

◆ RandomUuid() [4/4]

RandomUuid::RandomUuid ( const RandomUuid )
privatedefault

Member Function Documentation

◆ clone()

RandomUuid RandomUuid::clone ( ) const
inline

Definition at line 43 of file RandomUuid.h.

Referenced by serialize().

◆ operator!=()

bool RandomUuid::operator!= ( const RandomUuid other) const
inline

Definition at line 40 of file RandomUuid.h.

◆ operator=() [1/2]

RandomUuid & RandomUuid::operator= ( const RandomUuid )
delete

◆ operator=() [2/2]

RandomUuid & RandomUuid::operator= ( RandomUuid &&  )
default

◆ operator==()

bool RandomUuid::operator== ( const RandomUuid other) const

Definition at line 113 of file RandomUuid.cc.

References raw().

◆ print()

void RandomUuid::print ( std::ostream &  os) const

Definition at line 92 of file RandomUuid.cc.

References clockSeqHiAndReserved, clockSeqLow, node, timeHiAndVersion, timeLow, and timeMid.

Referenced by operator<<().

◆ raw() [1/2]

char * RandomUuid::raw ( )
inlineprivate

Definition at line 52 of file RandomUuid.h.

Referenced by RandomUuid(), and operator==().

◆ raw() [2/2]

const char * RandomUuid::raw ( ) const
inlineprivate

Definition at line 55 of file RandomUuid.h.

◆ sane()

bool RandomUuid::sane ( ) const
private

Definition at line 68 of file RandomUuid.cc.

References clockSeqHiAndReserved, EBIT_TEST, and timeHiAndVersion.

Referenced by RandomUuid(), and serialize().

◆ serialize()

RandomUuid::Serialized RandomUuid::serialize ( ) const

Definition at line 79 of file RandomUuid.cc.

References assert, clone(), sane(), timeHiAndVersion, timeLow, and timeMid.

Referenced by TestRandomUuid::testSerialization().

Member Data Documentation

◆ clockSeqHiAndReserved

uint8_t RandomUuid::clockSeqHiAndReserved
private

Definition at line 68 of file RandomUuid.h.

Referenced by RandomUuid(), print(), and sane().

◆ clockSeqLow

uint8_t RandomUuid::clockSeqLow
private

Definition at line 69 of file RandomUuid.h.

Referenced by print().

◆ node

uint8_t RandomUuid::node[6]
private

Definition at line 70 of file RandomUuid.h.

Referenced by print().

◆ timeHiAndVersion

uint16_t RandomUuid::timeHiAndVersion
private

Definition at line 67 of file RandomUuid.h.

Referenced by RandomUuid(), print(), sane(), and serialize().

◆ timeLow

uint32_t RandomUuid::timeLow
private

Definition at line 65 of file RandomUuid.h.

Referenced by RandomUuid(), print(), and serialize().

◆ timeMid

uint16_t RandomUuid::timeMid
private

Definition at line 66 of file RandomUuid.h.

Referenced by RandomUuid(), print(), and serialize().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors