GDCM 2.2.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

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
29 class GDCM_EXPORT UIDGenerator
30 {
31 public:
33 UIDGenerator():Unique() {}
34
35 // Function to override the GDCM root with a user one:
36 // WARNING: This need to be a valid root, otherwise call will fail
37 // Implementation note. According to DICOM standard PS 3.5, Section 9 :
38 // Unique Identifiers (UIDs), we have:
39 /*
40 ...
41 The <org root> portion of the UID uniquely identifies an organization, (i.e., manufacturer, research
42 organization, NEMA, etc.), and is composed of a number of numeric components as defined by ISO 8824.
43 The <suffix> portion of the UID is also composed of a number of numeric components, and shall be
44 unique within the scope of the <org root>. This implies that the organization identified in the <org root> is
45 responsible for guaranteeing <suffix> uniqueness by providing registration policies. These policies shall
46 guarantee <suffix> uniqueness for all UID's created by that organization. Unlike the <org root>, which may
47 be common for UID's in an organization, the <suffix> shall take different unique values between different
48 UID's that identify different objects.
49 ...
50 */
56 static void SetRoot(const char * root);
57 static const char *GetRoot();
58
65 const char* Generate();
66
69 static bool IsValid(const char *uid);
70
72 static const char *GetGDCMUID(); // who would want that in the public API ??
73
74 protected:
75 static bool GenerateUUID(unsigned char *uuid_data);
76
77 private:
78 static const char GDCM_UID[];
79 static std::string Root;
80 static std::string EncodedHardwareAddress;
81 std::string Unique; // Buffer
82 };
83
84
85 } // end namespace gdcm
86
87 #endif //GDCMUIDGENERATOR_H