QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Utils::UID Struct Reference
[QUtils]

#include <Q/utils.h>

List of all members.

Public Member Functions

 UID ()
 UID (const UID &ids)
 UID (const char *)
 UID (unsigned int m, unsigned int t, unsigned int ti)
unsigned int machineNum () const
unsigned int timeBits () const
unsigned int tickBits () const
UIDoperator= (const UID &ids)
int compare (const UID &id) const
bool valid () const
Utils::String asText () const
bool isReserved () const
void generate ()
void nullify ()
int operator== (const UID &id) const
int operator!= (const UID &id) const
int operator<= (const UID &ids) const
int operator< (const UID &ids) const
int operator> (const UID &ids) const
int operator>= (const UID &ids) const

Static Public Member Functions

unsigned int ourMachineNum ()
void ourMachineNum (unsigned int)
const UIDnullUID ()

Protected Attributes

unsigned int machineNum_
unsigned int timeBits_
unsigned int tickBits_

Static Protected Attributes

unsigned int ourMachineNum_


Detailed Description

A UID represents a 96-bit unique identifier. The identifier is divided into three fields, a machine identifier, and two fields used to represent the time the identifier was created. The time value is encoded so that the most significant word of the time representation is always greater than 0x10000000. Values less than this are used to represent "string-based" identifiers where the identifier is generated from an MD5 hash of a string.


Constructor & Destructor Documentation

Utils::UID::UID  ) 
 

Construct a new uninitialised identifier.

Utils::UID::UID const UID ids  )  [inline]
 

Construct a copy of an existing unique identifier.

Utils::UID::UID const char *   ) 
 

Reconstruct a unique ID from its string representation.

Utils::UID::UID unsigned int  m,
unsigned int  t,
unsigned int  ti
[inline]
 

Create a unique identifier given an existing machine number and time.


Member Function Documentation

Utils::String Utils::UID::asText  )  const
 

Convert the identifier to a string.

int Utils::UID::compare const UID id  )  const
 

Compare this identifier with another.

Return values:
-1 this identifier is less than id
0 this identifier is equal to id
1 this identifier is greater than id

void Utils::UID::generate  ) 
 

Generate a new unique value for the identifier.

bool Utils::UID::isReserved  )  const
 

Return values:
true if this identifier represents a string.

unsigned int Utils::UID::machineNum  )  const [inline]
 

Returns the machine number.

void Utils::UID::nullify  ) 
 

Set the identifier to null.

const UID& Utils::UID::nullUID  )  [static]
 

Returns an identifier which is initialised to null.

int Utils::UID::operator!= const UID id  )  const [inline]
 

Compare two UIDs.

int Utils::UID::operator< const UID ids  )  const [inline]
 

Compare two UIDs.

int Utils::UID::operator<= const UID ids  )  const [inline]
 

Compare two UIDs.

UID& Utils::UID::operator= const UID ids  ) 
 

Copy the value of another identifier to this one.

int Utils::UID::operator== const UID id  )  const [inline]
 

Compare two UIDs.

int Utils::UID::operator> const UID ids  )  const [inline]
 

Compare two UIDs.

int Utils::UID::operator>= const UID ids  )  const [inline]
 

Compare two UIDs.

void Utils::UID::ourMachineNum unsigned  int  )  [static]
 

Set the default machine number.

See also:
ourMachineNum()

unsigned int Utils::UID::ourMachineNum  )  [static]
 

Returns the default machine number.

See also:
ourMachineNum(unsigned int)

unsigned int Utils::UID::tickBits  )  const [inline]
 

Returns the least-significant time bits.

unsigned int Utils::UID::timeBits  )  const [inline]
 

Returns the most-significant time bits.

bool Utils::UID::valid  )  const
 

Check validity of this identifier. true if this identifier is non-null.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004