BLOCXX_NAMESPACE::UUID Class Reference

UUIDs (Universally Unique IDentifiers), also known as GUIDs (Globally Unique IDentifiers), are 128 bits long. More...

#include <UUID.hpp>

List of all members.

Public Member Functions

 UUID ()
 Create a new UUID.
 UUID (const String &uuidStr)
 Construct a UUID from string representation.
String toString () const
 Get the string representation of this UUID.

Private Attributes

unsigned char m_uuid [16]

Friends

bool operator== (const UUID &x, const UUID &y)
bool operator< (const UUID &x, const UUID &y)


Detailed Description

UUIDs (Universally Unique IDentifiers), also known as GUIDs (Globally Unique IDentifiers), are 128 bits long.

It is either guaranteed to be different from all other UUIDs/GUIDs generated until 3400 A.D. or extremely likely to be different. sizeof(UUID) == 16. The internal data is stored in network byte order, independent of host byte order.

This implementation based off of IETF internet draft: draft-leach-uuids-guids-01.txt That has expired, so if you want a real spec, see: DCE: Remote Procedure Call, Open Group CAE Specification C309 ISBN 1-85912-041-5 28cm. 674p. pbk. 1,655g. 8/94

Definition at line 60 of file UUID.hpp.


Constructor & Destructor Documentation

BLOCXX_NAMESPACE::UUID::UUID  ) 
 

Create a new UUID.

Version 1, based on MAC address (or random if not available) and time+counter.

Definition at line 205 of file UUID.cpp.

References BLOCXX_NAMESPACE::g_guard, BLOCXX_NAMESPACE::g_state, BLOCXX_NAMESPACE::getCurrentTime(), BLOCXX_NAMESPACE::getNodeIdentifier(), m_uuid, BLOCXX_NAMESPACE::NonRecursiveMutexLock::release(), and timestamp.

BLOCXX_NAMESPACE::UUID::UUID const String uuidStr  ) 
 

Construct a UUID from string representation.

The formal definition of the UUID string representation is provided by the following extended BNF:

	  UUID                   = <time_low> "-" <time_mid> "-"
	                           <time_high_and_version> "-"
	                           <clock_seq_and_reserved>
	                           <clock_seq_low> "-" <node>
	  time_low               = 4*<hexOctet>
	  time_mid               = 2*<hexOctet>
	  time_high_and_version  = 2*<hexOctet>
	  clock_seq_and_reserved = <hexOctet>
	  clock_seq_low          = <hexOctet>
	  node                   = 6*<hexOctet>
	  hexOctet               = <hexDigit> <hexDigit>
	  hexDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
	           | "a" | "b" | "c" | "d" | "e" | "f"
	           | "A" | "B" | "C" | "D" | "E" | "F"
	 

The following is an example of the string representation of a UUID: f81d4fae-7dec-11d0-a765-00a0c91e6bf6

Exceptions:
UUIDException if uuidStr isn't valid.

Definition at line 254 of file UUID.cpp.

References BLOCXX_THROW, BLOCXX_NAMESPACE::String::c_str(), and BLOCXX_NAMESPACE::String::length().


Member Function Documentation

String BLOCXX_NAMESPACE::UUID::toString  )  const
 

Get the string representation of this UUID.

The following is an example of the string representation of a UUID: f81d4fae-7dec-11d0-a765-00a0c91e6bf6

Definition at line 280 of file UUID.cpp.

References BLOCXX_NAMESPACE::String::E_TAKE_OWNERSHIP, m_uuid, BLOCXX_NAMESPACE::toHexHi(), and BLOCXX_NAMESPACE::toHexLow().


Friends And Related Function Documentation

bool operator< const UUID x,
const UUID y
[friend]
 

Definition at line 315 of file UUID.cpp.

bool operator== const UUID x,
const UUID y
[friend]
 

Definition at line 310 of file UUID.cpp.


Member Data Documentation

unsigned char BLOCXX_NAMESPACE::UUID::m_uuid[16] [private]
 

Definition at line 103 of file UUID.hpp.

Referenced by BLOCXX_NAMESPACE::operator<(), BLOCXX_NAMESPACE::operator==(), toString(), and UUID().


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 15:39:12 2006 for blocxx by  doxygen 1.4.6