]> Creatis software - gdcm.git/blob - src/gdcmDictSet.h
* src/*.[h|cxx] : coding style
[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 /*
15  * \defgroup gdcmDictSet
16  * \brief  Container for managing a set of loaded dictionaries.
17  * \note   Hopefully, sharing dictionaries should avoid
18  * \par    reloading an already loaded dictionary (saving time)
19  * \par    having many in memory representations of the same dictionary
20  *        (saving memory).
21  */
22 class GDCM_EXPORT gdcmDictSet {
23 public:
24         // TODO Swig int LoadDictFromFile(std::string filename);
25    // QUESTION: the following function might not be thread safe !? Maybe
26    //           we need some mutex here, to avoid concurent creation of
27    //           the same dictionary !?!?!
28         // TODO Swig int LoadDictFromName(std::string filename);
29         // TODO Swig int LoadAllDictFromDirectory(std::string DirectoryName);
30         // TODO Swig std::string* GetAllDictNames();
31         gdcmDictSet(void);
32         ~gdcmDictSet(void);
33
34         void Print(std::ostream& os);
35
36    std::list<std::string> * GetPubDictTagNames(void);
37    std::map<std::string, std::list<std::string> >*
38        GetPubDictTagNamesByCategory(void);
39
40         void LoadDictFromFile(std::string FileName, DictKey Name);
41
42    gdcmDict* GetDict(DictKey DictName);
43         gdcmDict* GetDefaultPubDict(void);
44
45    static std::string BuildDictPath(void);
46
47 protected:
48         bool AppendDict(gdcmDict* NewDict,DictKey Name);
49
50 private:
51    /// Hash table of all dictionaries contained in this gdcmDictSet
52         DictSetHT Dicts;
53    /// Directory path to dictionaries
54    std::string DictPath;
55 };
56
57 //-----------------------------------------------------------------------------
58 #endif