DCMTK  Version 3.6.1 20170228
OFFIS DICOM Toolkit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
OFUUID Class Reference

Helper class for generating and storing UUIDs, as specified in ITU-T X.667. More...

Classes

struct  BinaryRepresentation
 

Public Types

enum  E_Representation {
  ER_RepresentationInteger, ER_RepresentationHex, ER_RepresentationOID, ER_RepresentationURN,
  ER_RepresentationDefault = ER_RepresentationHex
}
 The possible ways to represent a UUID. More...
 

Public Member Functions

 OFUUID ()
 Default constructor. More...
 
 OFUUID (const struct BinaryRepresentation &val)
 Construct a new UUID from its binary representation. More...
 
void generate ()
 Generate a new UUID. More...
 
OFStringtoString (OFString &result, E_Representation representation=ER_RepresentationDefault) const
 Get the string representation of this UUID. More...
 
STD_NAMESPACE ostream & print (STD_NAMESPACE ostream &stream, E_Representation representation=ER_RepresentationDefault) const
 Write the string representation of this UUID to a stream. More...
 
void getBinaryRepresentation (struct BinaryRepresentation &val) const
 Get the binary representation of this UUID. More...
 
OFBool operator== (const OFUUID &other) const
 Compare this instance to another OFUUID instance. More...
 
OFBool operator!= (const OFUUID &other) const
 Compare this instance to another OFUUID instance. More...
 

Private Member Functions

void printInteger (STD_NAMESPACE ostream &stream) const
 Print the integer representation to the given stream. More...
 
void printHex (STD_NAMESPACE ostream &stream) const
 Print the hexadecimal representation to the given stream. More...
 

Private Attributes

Uint32 time_low
 Octets 0-3 of the time field.
 
Uint16 time_mid
 Octets 4-5 of the time field.
 
Uint16 version_and_time_high
 4 bits for the version and the 12 highest bits of the time
 
Uint8 variant_and_clock_seq_high
 2 bits for the variant and the 6 highest bits of the clock sequence
 
Uint8 clock_seq_low
 The lowest 8 bits of the clock sequence.
 
Uint8 node [6]
 The node value in the form of a MAC address.
 

Detailed Description

Helper class for generating and storing UUIDs, as specified in ITU-T X.667.

A UUID is an Universally Unique IDentifier. If UUIDs are generated correctly, it's almost impossible that the same UUID is generated twice.


Class Documentation

struct OFUUID::BinaryRepresentation

Member Enumeration Documentation

The possible ways to represent a UUID.

Enumerator
ER_RepresentationInteger 

The UUID is printed as one, long integer in base 10 (up to 39 digits long)

ER_RepresentationHex 

The UUID is printed in hexadecimal notation with hyphens (-) separating groups.

ER_RepresentationOID 

The UUID is printed as one, long integer with the prefix "2.25.".

ER_RepresentationURN 

The UUID is printed in hexadecimal notation with the prefix "urn:uuid:".

ER_RepresentationDefault 

The default representation that is used when none is given.

Constructor & Destructor Documentation

OFUUID::OFUUID ( )

Default constructor.

Generates a new UUID.

OFUUID::OFUUID ( const struct BinaryRepresentation val)

Construct a new UUID from its binary representation.

Parameters
valthe binary representation
See also
getBinaryRepresentation

Member Function Documentation

void OFUUID::generate ( )

Generate a new UUID.

The old UUID is discarded.

void OFUUID::getBinaryRepresentation ( struct BinaryRepresentation val) const

Get the binary representation of this UUID.

Parameters
valthe structure where the result should be saved to
OFBool OFUUID::operator!= ( const OFUUID other) const
inline

Compare this instance to another OFUUID instance.

Parameters
otherthe other instance
Returns
OFFalse if both UUIDs are equal.
OFBool OFUUID::operator== ( const OFUUID other) const

Compare this instance to another OFUUID instance.

Parameters
otherthe other instance
Returns
OFTrue if both UUIDs are equal.
STD_NAMESPACE ostream& OFUUID::print ( STD_NAMESPACE ostream &  stream,
E_Representation  representation = ER_RepresentationDefault 
) const

Write the string representation of this UUID to a stream.

Parameters
streamthe output stream to write to
representationthe representation to use
Returns
stream
void OFUUID::printHex ( STD_NAMESPACE ostream &  stream) const
private

Print the hexadecimal representation to the given stream.

Parameters
streamstream to print to.
void OFUUID::printInteger ( STD_NAMESPACE ostream &  stream) const
private

Print the integer representation to the given stream.

Parameters
streamstream to print to.
OFString& OFUUID::toString ( OFString result,
E_Representation  representation = ER_RepresentationDefault 
) const

Get the string representation of this UUID.

Parameters
resultstring instance to save the result in
representationthe representation to use
Returns
result

The documentation for this class was generated from the following file:


Generated on Tue Feb 28 2017 for DCMTK Version 3.6.1 20170228 by Doxygen 1.8.8