gdcmUIDGenerator.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMUIDGENERATOR_H
#define GDCMUIDGENERATOR_H
#include "gdcmTypes.h"
namespace gdcm
{
class GDCM_EXPORT UIDGenerator
{
public:
UIDGenerator():Unique() {}
// Function to override the GDCM root with a user one:
// WARNING: This need to be a valid root, otherwise call will fail
// Implementation note. According to DICOM standard PS 3.5, Section 9 :
// Unique Identifiers (UIDs), we have:
/*
...
The <org root> portion of the UID uniquely identifies an organization, (i.e., manufacturer, research
organization, NEMA, etc.), and is composed of a number of numeric components as defined by ISO 8824.
The <suffix> portion of the UID is also composed of a number of numeric components, and shall be
unique within the scope of the <org root>. This implies that the organization identified in the <org root> is
responsible for guaranteeing <suffix> uniqueness by providing registration policies. These policies shall
guarantee <suffix> uniqueness for all UID's created by that organization. Unlike the <org root>, which may
be common for UID's in an organization, the <suffix> shall take different unique values between different
UID's that identify different objects.
...
*/
static void SetRoot(const char * root);
static const char *GetRoot();
const char* Generate();
static bool IsValid(const char *uid);
static const char *GetGDCMUID(); // who would want that in the public API ??
protected:
static bool GenerateUUID(unsigned char *uuid_data);
private:
static const char GDCM_UID[];
static std::string Root;
static std::string EncodedHardwareAddress;
std::string Unique; // Buffer
};
} // end namespace gdcm
#endif //GDCMUIDGENERATOR_H
gdcm::UIDGenerator::SetRoot
static void SetRoot(const char *root)
gdcm::UIDGenerator::Generate
const char * Generate()
gdcm::UIDGenerator::GetGDCMUID
static const char * GetGDCMUID()
Return the default (GDCM) root UID:
gdcm::UIDGenerator::GenerateUUID
static bool GenerateUUID(unsigned char *uuid_data)
gdcm::UIDGenerator::IsValid
static bool IsValid(const char *uid)
gdcm::UIDGenerator::UIDGenerator
UIDGenerator()
By default the root of a UID is a GDCM Root...
Definition gdcmUIDGenerator.h:31
gdcm::UIDGenerator::GetRoot
static const char * GetRoot()
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21