GDCM  2.2.0
Public Member Functions | Static Public Member Functions | Static Protected Member Functions
gdcm::UIDGenerator Class Reference

Class for generating unique UID. More...

#include <gdcmUIDGenerator.h>

List of all members.

Public Member Functions

 UIDGenerator ()
 By default the root of a UID is a GDCM Root...
const char * Generate ()

Static Public Member Functions

static const char * GetGDCMUID ()
 Return the default (GDCM) root UID:
static const char * GetRoot ()
static bool IsValid (const char *uid)
static void SetRoot (const char *root)

Static Protected Member Functions

static bool GenerateUUID (unsigned char *uuid_data)

Detailed Description

Class for generating unique UID.

Note:
bla Usage: When constructing a Series or Study UID, user has to keep around the UID, otherwise the UID Generator will simply forget the value and create a new UID.
Examples:
CreateJPIPDataSet.cxx, EncapsulateFileInRawData.cxx, Extracting_All_Resolution.cxx, Fake_Image_Using_Stream_Image_Writer.cxx, GenAllVR.cxx, GenFakeIdentifyFile.cxx, GenFakeImage.cxx, GetSubSequenceData.cxx, StreamImageReaderTest.cxx, and uid_unique.cxx.

Constructor & Destructor Documentation

gdcm::UIDGenerator::UIDGenerator ( )
inline

By default the root of a UID is a GDCM Root...


Member Function Documentation

const char* gdcm::UIDGenerator::Generate ( )

Internally uses a std::string, so two calls have the same pointer ! save into a std::string In summary do not write code like that: const char *uid1 = uid.Generate(); const char *uid2 = uid.Generate(); since uid1 == uid2

Examples:
CreateJPIPDataSet.cxx, EncapsulateFileInRawData.cxx, Extracting_All_Resolution.cxx, Fake_Image_Using_Stream_Image_Writer.cxx, GenAllVR.cxx, GenFakeIdentifyFile.cxx, GenFakeImage.cxx, StreamImageReaderTest.cxx, and uid_unique.cxx.
static bool gdcm::UIDGenerator::GenerateUUID ( unsigned char *  uuid_data)
staticprotected
static const char* gdcm::UIDGenerator::GetGDCMUID ( )
static

Return the default (GDCM) root UID:

static const char* gdcm::UIDGenerator::GetRoot ( )
static
static bool gdcm::UIDGenerator::IsValid ( const char *  uid)
static

Find out if the string is a valid UID or not

Todo:
: Move that in DataStructureAndEncoding (see FileMetaInformation::CheckFileMetaInformation)
static void gdcm::UIDGenerator::SetRoot ( const char *  root)
static

The current implementation in GDCM make use of the UUID implementation (RFC 4122) and has been successfully been tested for a root of size 26 bytes. Any longer root should work (the ::Generate() function will return a string), but will truncate the high bits of the 128bits UUID until the generated string fits on 64 bits. The authors disclaims any responsabitlity for garanteeing uniqueness of UIDs when the root is longer than 26 bytes.

Examples:
uid_unique.cxx.

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

Generated on Wed Jun 13 2012 20:40:40 for GDCM by doxygen 1.8.1
SourceForge.net Logo