Main Page | File List | Related Pages

gdcmDictSet.h

00001 // gdcmDictSet.h
00002 //-----------------------------------------------------------------------------
00003 #ifndef GDCMDICTSET_H
00004 #define GDCMDICTSET_H
00005 
00006 #include "gdcmDict.h"
00007 #include <map>
00008 #include <list>
00009 
00010 typedef std::string DictKey;
00011 typedef std::map<DictKey, gdcmDict*> DictSetHT;
00012 
00013 //-----------------------------------------------------------------------------
00014 /*
00015  * \defgroup gdcmDictSet
00016  * \brief  Container for managing a set of loaded dictionaries.
00017  * \note   Hopefully, sharing dictionaries should avoid
00018  * \par    reloading an already loaded dictionary (saving time)
00019  * \par    having many in memory representations of the same dictionary
00020  *        (saving memory).
00021  */
00022 class GDCM_EXPORT gdcmDictSet {
00023 public:
00024         // TODO Swig int LoadDictFromFile(std::string filename);
00025    // QUESTION: the following function might not be thread safe !? Maybe
00026    //           we need some mutex here, to avoid concurent creation of
00027    //           the same dictionary !?!?!
00028         // TODO Swig int LoadDictFromName(std::string filename);
00029         // TODO Swig int LoadAllDictFromDirectory(std::string DirectoryName);
00030         // TODO Swig std::string* GetAllDictNames();
00031    gdcmDictSet(void);
00032    ~gdcmDictSet(void);
00033 
00034    void Print(std::ostream& os);
00035 
00036    std::list<std::string> *GetPubDictEntryNames(void);
00037    std::map<std::string, std::list<std::string> > *
00038        GetPubDictEntryNamesByCategory(void);
00039 
00040    gdcmDict *LoadDictFromFile(std::string FileName, DictKey Name);
00041 
00042    gdcmDict *GetDict(DictKey DictName);
00043    gdcmDict *GetDefaultPubDict(void);
00044 
00045    gdcmDictEntry *NewVirtualDictEntry(guint16 group, guint16 element,
00046                                       std::string vr     = "Unknown",
00047                                       std::string fourth = "Unknown",
00048                                       std::string name   = "Unknown");
00049 
00050    static std::string BuildDictPath(void);
00051 
00052 protected:
00053    bool AppendDict(gdcmDict *NewDict,DictKey Name);
00054 
00055 private:
00057    DictSetHT Dicts;
00059    std::string DictPath;
00060 
00061    std::map<std::string,gdcmDictEntry *> virtualEntry;
00062 };
00063 
00064 //-----------------------------------------------------------------------------
00065 #endif

Generated on Mon Feb 14 16:13:43 2005 for gdcm by doxygen 1.3.6