]> Creatis software - gdcm.git/blob - src/gdcmDictSet.h
* More memmory link related corrections and documentation fixes.
[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    /// Hash table of all dictionaries contained in this gdcmDictSet
24         DictSetHT Dicts;
25    /// Directory path to dictionaries
26         string DictPath;
27         int AppendDict(gdcmDict* NewDict);
28         void LoadDictFromFile(string filename, DictKey);
29         string BuildDictPath(void);
30 public:
31         list<string> * GetPubDictTagNames(void);
32         map<string, list<string> >* GetPubDictTagNamesByCategory(void);
33
34         // TODO Swig int LoadDictFromFile(string filename);
35    // QUESTION: the following function might not be thread safe !? Maybe
36    //           we need some mutex here, to avoid concurent creation of
37    //           the same dictionary !?!?!
38         // TODO Swig int LoadDictFromName(string filename);
39         // TODO Swig int LoadAllDictFromDirectory(string DirectoryName);
40         // TODO Swig string* GetAllDictNames();
41         gdcmDictSet(void);
42         ~gdcmDictSet(void);
43         void Print(ostream&);
44         gdcmDict* GetDict(DictKey DictName);
45         gdcmDict* GetDefaultPubDict(void);
46 };
47
48 #endif