PTLib  Version 2.10.4
PGloballyUniqueID Class Reference

Globally unique ID definition. More...

#include <guid.h>

Inheritance diagram for PGloballyUniqueID:
PBYTEArray PBaseArray< T > PAbstractArray PContainer PObject

List of all members.

Public Member Functions

Construction
 PGloballyUniqueID ()
 Create a new ID.
 PGloballyUniqueID (const char *cstr)
 Create an ID from a C string of hex (as produced by AsString()).
 PGloballyUniqueID (const PString &str)
 Create an ID from a PString of hex (as produced by AsString()).
Overrides from PObject
virtual void PrintOn (ostream &strm) const
 Standard stream print function.
virtual void ReadFrom (istream &strm)
 Standard stream read function.
virtual PObjectClone () const
 Create a clone of the ID.
virtual PINDEX HashFunction () const
 Get the hash value for the ID.
Operations
PString AsString () const
 Convert the ID to human readable string.
PBoolean IsNULL () const
 Test if the GUID is null, ie consists of all zeros.
PBoolean operator! () const

Detailed Description

Globally unique ID definition.

This implements a 128 bit globally unique ID as required by many protocols and software systems. The value is constructed in such a way as to make a duplicate anywhere in the world highly unlikely.


Constructor & Destructor Documentation

Create a new ID.

The ID created with this will be initialised to a globally unique ID as per specification.

PGloballyUniqueID::PGloballyUniqueID ( const char *  cstr)

Create an ID from a C string of hex (as produced by AsString()).

A useful construct is to construct a OpalGloballyUniqueID() with NULL which produces an all zero GUID, detectable with the IsNULL() function.

Parameters:
cstrC string to convert

Create an ID from a PString of hex (as produced by AsString()).

Parameters:
strString of hex to convert

Member Function Documentation

Convert the ID to human readable string.

virtual PObject* PGloballyUniqueID::Clone ( ) const [virtual]

Create a clone of the ID.

The duplicate ID has the same value as the source. Required for having this object as a key in dictionaries.

Reimplemented from PBaseArray< T >.

virtual PINDEX PGloballyUniqueID::HashFunction ( ) const [virtual]

Get the hash value for the ID.

Creates a number based on the ID value for use in the hash table of a dictionary. Required for having this object as a key in dictionaries.

Reimplemented from PObject.

Test if the GUID is null, ie consists of all zeros.

Referenced by operator!().

References IsNULL().

virtual void PGloballyUniqueID::PrintOn ( ostream &  strm) const [virtual]

Standard stream print function.

The PObject class has a << operator defined that calls this function polymorphically.

Parameters:
strmStream to output text representation

Reimplemented from PAbstractArray.

virtual void PGloballyUniqueID::ReadFrom ( istream &  strm) [virtual]

Standard stream read function.

The PObject class has a >> operator defined that calls this function polymorphically.

Parameters:
strmStream to output text representation

Reimplemented from PAbstractArray.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines