]> Creatis software - gdcm.git/blob - src/gdcmDictSet.h
* src/gdcm.h splitted in gdcmCommon.h, gdcmDict.h, gdcmDictEntry.h,
[gdcm.git] / src / gdcmDictSet.h
1 // gdcmDictSet.h
2
3 #ifndef GDCMDICTSET_H
4 #define GDCMDICTSET_H
5
6 #include <map>
7 #include <list>
8 #include "gdcmCommon.h"
9 #include "gdcmDict.h"
10
11 ////////////////////////////////////////////////////////////////////////////
12 // Container for managing a set of loaded dictionaries. Sharing dictionaries
13 // should avoid :
14 // * reloading an allready loaded dictionary,
15 // * having many in memory representations of the same dictionary.
16
17 typedef string DictKey;
18 typedef map<DictKey, gdcmDict*> DictSetHT;
19
20 class GDCM_EXPORT gdcmDictSet {
21 private:
22         DictSetHT dicts;
23         int AppendDict(gdcmDict* NewDict);
24         void LoadDictFromFile(string filename, DictKey);
25 private:
26         static string DictPath;      // Directory path to dictionaries
27         static string BuildDictPath(void);
28         static gdcmDict* DefaultPubDict;
29 public:
30         static list<string> * GetPubDictTagNames(void);
31         static map<string, list<string> >* GetPubDictTagNamesByCategory(void);
32         static gdcmDict* LoadDefaultPubDict(void);
33
34         gdcmDictSet(void);
35         // TODO Swig int LoadDictFromFile(string filename);
36    // QUESTION: the following function might not be thread safe !? Maybe
37    //           we need some mutex here, to avoid concurent creation of
38    //           the same dictionary !?!?!
39         // TODO Swig int LoadDictFromName(string filename);
40         // TODO Swig int LoadAllDictFromDirectory(string DirectoryName);
41         // TODO Swig string* GetAllDictNames();
42         //
43         void Print(ostream&);
44         gdcmDict* GetDict(DictKey DictName);
45         gdcmDict* GetDefaultPubDict(void);
46 };
47
48 #endif