]> Creatis software - gdcm.git/blob - src/gdcmDictSet.h
* Memory link hunt (by using valgrind --leak-check=yes PrintHeader).
[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 "gdcmDict.h"
9
10 typedef string DictKey;
11 typedef map<DictKey, gdcmDict*> DictSetHT;
12
13 /*
14  * \defgroup gdcmDictSet
15  * \brief  Container for managing a set of loaded dictionaries.
16  * \note   Hopefully, sharing dictionaries should avoid
17  * \par    reloading an allready loaded dictionary (saving time)
18  * \par    having many in memory representations of the same dictionary
19  *        (saving memory).
20  */
21 class GDCM_EXPORT gdcmDictSet {
22 private:
23         DictSetHT dicts;
24         int AppendDict(gdcmDict* NewDict);
25         void LoadDictFromFile(string filename, DictKey);
26 private:
27    /// Directory path to dictionaries
28         static string DictPath;
29         static string BuildDictPath(void);
30         static gdcmDict* DefaultPubDict;
31 public:
32         static list<string> * GetPubDictTagNames(void);
33         static map<string, list<string> >* GetPubDictTagNamesByCategory(void);
34         static gdcmDict* LoadDefaultPubDict(void);
35
36         // TODO Swig int LoadDictFromFile(string filename);
37    // QUESTION: the following function might not be thread safe !? Maybe
38    //           we need some mutex here, to avoid concurent creation of
39    //           the same dictionary !?!?!
40         // TODO Swig int LoadDictFromName(string filename);
41         // TODO Swig int LoadAllDictFromDirectory(string DirectoryName);
42         // TODO Swig string* GetAllDictNames();
43         gdcmDictSet(void);
44         ~gdcmDictSet(void);
45         void Print(ostream&);
46         gdcmDict* GetDict(DictKey DictName);
47         gdcmDict* GetDefaultPubDict(void);
48 };
49
50 #endif