AnCH Framework  0.1
Another C++ Hack Framework
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
anch::Uuid Class Reference

UUID generator and parser. More...

#include <uuid.hpp>

Collaboration diagram for anch::Uuid:

Public Types

enum  Version {
  MAC_ADDRESS = 1, DCE_SECURITY, MD5_HASH, RANDOM,
  SHA1_HASH
}
 

Public Member Functions

 Uuid ()
 
 Uuid (const Uuid &uuid)
 
virtual ~Uuid ()
 
std::string toString () const
 
uint32_t getLowTime () const
 
uint16_t getMidTime () const
 
uint16_t getHighTime () const
 
uint16_t getClockSeqLow () const
 
uint16_t getClockSeqHighRes () const
 
uint64_t getNode () const
 
anch::Uuid::Version getVersion () const
 

Static Public Member Functions

static void generateUuid (Uuid &uuid, anch::Uuid::Version version=anch::Uuid::Version::RANDOM, const std::string &data="")
 
static void generateUuidVersion1 (Uuid &uuid, const std::string &macAddress="")
 
static void generateUuidVersion3 (Uuid &uuid, const std::string &data)
 
static void generateUuidVersion4 (Uuid &uuid)
 
static void generateUuidVersion5 (Uuid &uuid, const std::string &data)
 

Detailed Description

UUID generator and parser.

See RFC 4122 for more details (http://www.ietf.org/rfc/rfc4122.txt)

This class needs anch-crypto and anch-device libraries.

Since
0.1
Author
Vincent Lachenal

Member Enumeration Documentation

The UUID versions

Since
0.1
Author
Vincent Lachenal
Enumerator
MAC_ADDRESS 

MAC address based algorithm

DCE_SECURITY 

DCE security (Windows) base algorithm

MD5_HASH 

MD5 hash based algorithm

RANDOM 

Random based algorithm

SHA1_HASH 

SHA1 hash based algorithm

Constructor & Destructor Documentation

anch::Uuid::Uuid ( )
inline

Uuid default constructor

anch::Uuid::Uuid ( const Uuid uuid)
inline

Uuid copy constructor

Parameters
uuidThe Uuid to copy
virtual anch::Uuid::~Uuid ( )
inlinevirtual

Uuid destructor

Member Function Documentation

static void anch::Uuid::generateUuid ( Uuid uuid,
anch::Uuid::Version  version = anch::Uuid::Version::RANDOM,
const std::string &  data = "" 
)
inlinestatic

Generate a new UUID

Parameters
uuidThe UUID to set
versionThe UUID algorithm version to use (default to MAC based algorithm)
dataThe data to process (used to SHA1 and MD5 algorithms)
static void anch::Uuid::generateUuidVersion1 ( Uuid uuid,
const std::string &  macAddress = "" 
)
inlinestatic

Generate a new UUID with version 1 (MAC address based) algorithm

Parameters
uuidThe UUID to set
macAddressThe MAC address to use. If empty, the first MAC address available will be choosen
static void anch::Uuid::generateUuidVersion3 ( Uuid uuid,
const std::string &  data 
)
inlinestatic

Generate a new UUID with version 3 (MD5 based) algorithm

Parameters
uuidThe UUID to set
dataThe data to process
static void anch::Uuid::generateUuidVersion4 ( Uuid uuid)
inlinestatic

Generate a new UUID with version 4 (random) algorithm

Parameters
uuidThe UUID to set
static void anch::Uuid::generateUuidVersion5 ( Uuid uuid,
const std::string &  data 
)
inlinestatic

Generate a new UUID with version 5 (SHA1 based) algorithm

Parameters
uuidThe UUID to set
dataThe data to process
uint16_t anch::Uuid::getClockSeqHighRes ( ) const
inline

The clock sequence high value and reserved value getter

Returns
The clock sequence high value and reserved value
uint16_t anch::Uuid::getClockSeqLow ( ) const
inline

The clock sequence low value getter

Returns
The clock sequence low value
uint16_t anch::Uuid::getHighTime ( ) const
inline

The timestamp high value getter

Returns
The timestamp high value
uint32_t anch::Uuid::getLowTime ( ) const
inline

The timestamp low value getter

Returns
The timestamp low value
uint16_t anch::Uuid::getMidTime ( ) const
inline

The timestamp mid value getter

Returns
The timestamp mid value
uint64_t anch::Uuid::getNode ( ) const
inline

The node getter

Returns
The node
anch::Uuid::Version anch::Uuid::getVersion ( ) const
inline

Version getter

Returns
The version
std::string anch::Uuid::toString ( ) const
inline

Convert Uuid to std::string

Returns
The string representation of Uuid

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