00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 #ifndef _GDCMELEMENTSET_H_
00020 #define _GDCMELEMENTSET_H_
00021 
00022 #include "gdcmDocEntrySet.h"
00023 
00024 #include <map>
00025 #include <iostream>
00026 #include <fstream>
00027 
00028 namespace GDCM_NAME_SPACE 
00029 {
00030 typedef std::map<TagKey, DocEntry *> TagDocEntryHT;
00031 
00032 
00040 class GDCM_EXPORT ElementSet : public DocEntrySet
00041 {
00042    gdcmTypeMacro(ElementSet);
00043 
00044 public:
00045    virtual void Print(std::ostream &os = std::cout, 
00046                       std::string const &indent = "" ); 
00047 
00048    void WriteContent(std::ofstream *fp, FileType filetype,
00049                                                     bool insideMetaElements); 
00050 
00051    bool AddEntry(DocEntry *Entry);
00052    bool RemoveEntry(DocEntry *EntryToRemove);
00053    void ClearEntry();
00054    
00055    DocEntry *GetFirstEntry();
00056    DocEntry *GetNextEntry();
00057    DocEntry *GetDocEntry(uint16_t group, uint16_t elem);
00059    bool IsEmpty() { return TagHT.empty(); }
00060    
00061    int IsVRCoherent(uint16_t group);
00062 
00063    virtual void Copy(DocEntrySet *set);
00064 
00065 protected:
00066    ElementSet();
00067    ~ElementSet();
00070    bool MayIWrite(uint16_t )
00071                  { return true; }
00072 private:
00073 
00075    TagDocEntryHT TagHT;
00077    TagDocEntryHT::iterator ItTagHT;
00078 };
00079 } 
00080 
00081 #endif
00082