Class for generating unique UID. More...
#include <gdcmUIDGenerator.h>
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) |
Protected Member Functions | |
const char * | Generate2 () |
Static Protected Member Functions | |
static bool | GenerateUUID (unsigned char *uuid_data) |
Class for generating unique UID.
EncapsulateFileInRawData.cxx, GenAllVR.cxx, GenFakeIdentifyFile.cxx, GenFakeImage.cxx, and uid_unique.cxx.
gdcm::UIDGenerator::UIDGenerator | ( | ) | [inline] |
By default the root of a UID is a GDCM Root...
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
const char* gdcm::UIDGenerator::Generate2 | ( | ) | [protected] |
static bool gdcm::UIDGenerator::GenerateUUID | ( | unsigned char * | uuid_data ) | [static, protected] |
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
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.