DiCE API nvidia_logo_transpbg.gif Up
mi::base::Uuid_t< id1, ... > Class Template Reference

Class template for a compile-time representation of universally unique identifiers (UUIDs or GUIDs). More...

#include <uuid.h>

Public Member Functions

 operator const Uuid & () const
 Conversion operator. More...
 

Static Public Attributes

static const Uint32 m_id1 = id1
 First 32 bit out of four. More...
 
static const Uint32 m_id2 = static_cast<Uint32>( id2 | (id3 << 16))
 Second 32 bit out of four. More...
 
static const Uint32 m_id3 = static_cast<Uint32>( id4 | (id5 << 8) | (id6 << 16) | (id7 << 24))
 Third 32 bit out of four. More...
 
static const Uint32 m_id4 = static_cast<Uint32>( id8 | (id9 << 8) | (id10 << 16) | (id11 << 24))
 Fourth 32 bit out of four. More...
 
static const Uint32 hash32 = m_id1 ^ m_id2 ^ m_id3 ^ m_id4
 A 32 bit hash value from a bitwise xor of all four 32 bit values. More...
 

Detailed Description

template<Uint32 id1, Uint16 id2, Uint16 id3, Uint8 id4, Uint8 id5, Uint8 id6, Uint8 id7, Uint8 id8, Uint8 id9, Uint8 id10, Uint8 id11>
class mi::base::Uuid_t< id1, ... >

Class template for a compile-time representation of universally unique identifiers (UUIDs or GUIDs).

The identifiers are represented as a sequence of four compile-time constants in the form of static const mi::Uint32 types.

This class provides an implicit conversion to mi::base::Uuid. It initializes the mi::base::Uuid value with the compile-time constants (m_id1, m_id2, m_id3, m_id4). Thus, a simple object instantiation of a class instance of this template can be passed as id along to functions expecting an mi::base::Uuid argument such as mi::base::IInterface::get_interface().

This class template provides also a static const hash32 value of type mi::Uint32, which can be used as compile-time constant expression value, for example, in switch case labels.

The template parameters represent the UUID as the commonly generated sequence of one 32 bit value, two 16 bit values, and eight 8 bit values. The uuidgen system utility program creates UUIDs in a similar format.