]> Creatis software - gdcm.git/blob - src/gdcmDictSet.h
* src/gdcmDictSet.h : set the method BuildDictPath in public
[gdcm.git] / src / gdcmDictSet.h
1 // gdcmDictSet.h
2
3 #ifndef GDCMDICTSET_H
4 #define GDCMDICTSET_H
5
6 #include "gdcmDict.h"
7 #include <map>
8 #include <list>
9
10 typedef std::string DictKey;
11 typedef std::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 already 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    std::string DictPath;
27
28         int AppendDict(gdcmDict* NewDict);
29         void LoadDictFromFile(std::string FileName, DictKey Name);
30
31 public:
32    std::list<std::string> * GetPubDictTagNames(void);
33    std::map<std::string, std::list<std::string> >*
34        GetPubDictTagNamesByCategory(void);
35
36         // TODO Swig int LoadDictFromFile(std::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(std::string filename);
41         // TODO Swig int LoadAllDictFromDirectory(std::string DirectoryName);
42         // TODO Swig std::string* GetAllDictNames();
43         gdcmDictSet(void);
44         ~gdcmDictSet(void);
45         void Print(std::ostream& os);
46
47         gdcmDict* GetDict(DictKey DictName);
48         gdcmDict* GetDefaultPubDict(void);
49
50    static std::string BuildDictPath(void);
51 };
52
53 #endif