Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
zorba::uuid Struct Reference

A uuid contains the raw bytes for a UUID. More...

#include <zorba/util/uuid.h>

List of all members.

Public Types

typedef const_pointer const_iterator
typedef value_type const * const_pointer
typedef value_type const & const_reference
typedef std::ptrdiff_t difference_type
typedef pointer iterator
typedef value_typepointer
typedef value_typereference
typedef std::size_t size_type
typedef unsigned char value_type
enum  variant { ncs, rfc4122, microsoft, future }
enum  version {
  unknown, time_based = 0x10, dce_security = 0x20, name_based_md5 = 0x30,
  random_number_based = 0x40, name_based_sha1 = 0x50
}

Public Member Functions

iterator begin ()
 Creates an iterator to the beginning of the data.
const_iterator begin () const
 Creates a const_iterator to the beginning of the data.
iterator end ()
 Creates an iterator to one past the end of the data.
const_iterator end () const
 Creates a const_iterator to one past the end of the data.
variant get_variant () const
 Gets the variant of this UUID.
version get_version () const
 Gets the version of this UUID.
size_type size () const
 Gets the size of the UUID data.
void swap (uuid &that)
 Swaps this UUID's data with that of another.

Static Public Member Functions

static void create (uuid *result)
 Creates a UUID.

Public Attributes

value_type data [16]
 The raw UUID data.

Detailed Description

A uuid contains the raw bytes for a UUID.

Note that this is intentially a struct with no constructors, no destructor, and no user-defined assignment operators so that it remains a POD.

See also:

The UUID data is stored as an array of 16 8-bit bytes comprising the 128 bits that is a UUID. The data is intentionally not stored as shown in "Appendix A - Sample Implementation" of RFC 4122 (the struct with individial fields such as time_low, time_mid, etc.) since C++ does not guarantee that the struct fields will be laid out in memory as shown in section "4.1.2. Layout and Byte Order" due to possible padding.

Definition at line 46 of file uuid.h.


Member Typedef Documentation

Definition at line 56 of file uuid.h.

Definition at line 51 of file uuid.h.

Definition at line 49 of file uuid.h.

typedef std::ptrdiff_t zorba::uuid::difference_type

Definition at line 53 of file uuid.h.

Definition at line 55 of file uuid.h.

Definition at line 50 of file uuid.h.

Definition at line 48 of file uuid.h.

typedef std::size_t zorba::uuid::size_type

Definition at line 52 of file uuid.h.

typedef unsigned char zorba::uuid::value_type

Definition at line 47 of file uuid.h.


Member Enumeration Documentation

Enumerator:
ncs 

NCS backward compatibility.

rfc4122 

RFC 4122.

microsoft 

Microsoft compatibility.

future 

Reserved for future use.

Definition at line 58 of file uuid.h.

Enumerator:
unknown 
time_based 
dce_security 
name_based_md5 
random_number_based 
name_based_sha1 

Definition at line 65 of file uuid.h.


Member Function Documentation

iterator zorba::uuid::begin ( )
inline

Creates an iterator to the beginning of the data.

Returns:
Returns said iterator.

Definition at line 92 of file uuid.h.

Referenced by zorba::operator<(), zorba::operator==(), and swap().

const_iterator zorba::uuid::begin ( ) const
inline

Creates a const_iterator to the beginning of the data.

Returns:
Returns said iterator.

Definition at line 101 of file uuid.h.

static void zorba::uuid::create ( uuid result)
static

Creates a UUID.

The variant and version of the UUID created is platform-dependent.

Parameters:
resultA pointer to the result.
iterator zorba::uuid::end ( )
inline

Creates an iterator to one past the end of the data.

Returns:
Returns said iterator.

Definition at line 110 of file uuid.h.

Referenced by zorba::operator<(), and zorba::operator==().

const_iterator zorba::uuid::end ( ) const
inline

Creates a const_iterator to one past the end of the data.

Returns:
Returns said iterator.

Definition at line 119 of file uuid.h.

variant zorba::uuid::get_variant ( ) const

Gets the variant of this UUID.

Returns:
Returns said variant.
version zorba::uuid::get_version ( ) const

Gets the version of this UUID.

Returns:
Returns said version.
size_type zorba::uuid::size ( ) const
inline

Gets the size of the UUID data.

Returns:
Always returns 16.

Definition at line 128 of file uuid.h.

void zorba::uuid::swap ( uuid that)
inline

Swaps this UUID's data with that of another.

Parameters:
thatThe other UUID to swap data with.

Definition at line 137 of file uuid.h.

References begin().

Referenced by zorba::swap().


Member Data Documentation

value_type zorba::uuid::data[16]

The raw UUID data.

Definition at line 77 of file uuid.h.


The documentation for this struct was generated from the following file:
blog comments powered by Disqus