GDCM 3.2.1

gdcmUIDGenerator.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13=========================================================================*/
14#ifndef GDCMUIDGENERATOR_H
15#define GDCMUIDGENERATOR_H
16
17#include "gdcmTypes.h"
18
19 namespace gdcm
20{
21
27 class GDCM_EXPORT UIDGenerator
28{
29 public:
31 UIDGenerator():Unique() {}
32
33 // Function to override the GDCM root with a user one:
34 // WARNING: This need to be a valid root, otherwise call will fail
35 // Implementation note. According to DICOM standard PS 3.5, Section 9 :
36 // Unique Identifiers (UIDs), we have:
37 /*
38 ...
39 The <org root> portion of the UID uniquely identifies an organization, (i.e., manufacturer, research
40 organization, NEMA, etc.), and is composed of a number of numeric components as defined by ISO 8824.
41 The <suffix> portion of the UID is also composed of a number of numeric components, and shall be
42 unique within the scope of the <org root>. This implies that the organization identified in the <org root> is
43 responsible for guaranteeing <suffix> uniqueness by providing registration policies. These policies shall
44 guarantee <suffix> uniqueness for all UID's created by that organization. Unlike the <org root>, which may
45 be common for UID's in an organization, the <suffix> shall take different unique values between different
46 UID's that identify different objects.
47 ...
48 */
54 static void SetRoot(const char * root);
55 static const char *GetRoot();
56
63 const char* Generate();
64
67 static bool IsValid(const char *uid);
68
70 static const char *GetGDCMUID(); // who would want that in the public API ??
71
72 protected:
73 static bool GenerateUUID(unsigned char *uuid_data);
74
75 private:
76 static const char GDCM_UID[];
77 static std::string Root;
78 static std::string EncodedHardwareAddress;
79 std::string Unique; // Buffer
80};
81
82
83} // end namespace gdcm
84
85#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