]> Creatis software - gdcm.git/blob - src/gdcmDictSet.h
Fix mistypings
[gdcm.git] / src / gdcmDictSet.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDictSet.h,v $
5   Language:  C++
6   Date:      $Date: 2007/08/22 16:14:04 $
7   Version:   $Revision: 1.55 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef _GDCMDICTSET_H
20 #define _GDCMDICTSET_H
21
22 #include "gdcmRefCounter.h"
23 #include "gdcmDict.h"
24 #include "gdcmGlobal.h"
25
26 #include <map>
27 #include <list>
28
29 namespace GDCM_NAME_SPACE 
30 {
31 //-----------------------------------------------------------------------------
32 typedef std::map<DictKey, Dict*> DictSetHT;
33
34 //-----------------------------------------------------------------------------
35 /**
36  * \brief  Container for managing a set of loaded dictionaries (Dict).
37  * \note   Hopefully, sharing dictionaries should avoid
38  *         - reloading an already loaded dictionary (saving time)
39  *         - having many in memory representations of the same dictionary
40  *        (saving memory).
41  */
42 class GDCM_EXPORT DictSet : public RefCounter
43 {
44    gdcmTypeMacro(DictSet);
45
46 public:
47 /// \brief Contructs a DictSet with a RefCounter
48    static DictSet *New() {return new DictSet();}
49
50    void Print(std::ostream &os = std::cout, std::string const &indent = "" );
51
52    // Probabely useless !
53    //EntryNamesList *GetPubDictEntryNames();
54    //EntryNamesByCatMap *GetPubDictEntryNamesByCategory();
55
56    Dict *LoadDictFromFile( std::string const &fileName,
57                            DictKey const &name );
58
59    Dict *GetDict( DictKey const &DictName );
60
61    /// \brief   Returns the default reference DICOM V3 public dictionary.
62    //Dict* GetDefaultPubDict() { return GetDict(PUB_DICT_NAME); }
63    Dict* GetDefaultPubDict() { return Global::DefaultPubDict; } 
64    
65    // \ brief   Returns the virtual references DICOM dictionary.
66    // \ warning : not end user intended
67    // Dict *GetVirtualDict() { return &VirtualEntries; }
68
69    Dict *GetFirstDict();
70    Dict *GetNextDict();
71
72    static std::string BuildDictPath();
73
74 protected:
75    DictSet();
76    ~DictSet();
77
78 private:
79    /// Hash table of all dictionaries contained in this DictSet
80    DictSetHT Dicts;
81    /// Iterator to visit the Dictionaries of a given DictSet
82    DictSetHT::iterator ItDictHt;
83
84    /// Directory path to dictionaries
85    std::string DictPath;
86 };
87 } // end namespace gdcm
88
89 //-----------------------------------------------------------------------------
90 #endif