2 //-----------------------------------------------------------------------------
4 #include "gdcmElementSet.h"
7 //-----------------------------------------------------------------------------
8 // Constructor / Destructor
10 * \ingroup gdcmElementSet
11 * \brief Constructor from a given gdcmElementSet
13 gdcmElementSet::gdcmElementSet(int depthLevel)
14 : gdcmDocEntrySet(depthLevel) {
18 * \ingroup gdcmElementSet
19 * \brief Canonical destructor.
21 gdcmElementSet::~gdcmElementSet()
23 gdcmDocEntry* EntryToDelete;
24 for(TagDocEntryHT::iterator cc = tagHT.begin();cc != tagHT.end();++cc)
26 EntryToDelete = cc->second;
28 delete EntryToDelete; // TODO : a verifier
34 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
41 * \brief Prints the Header Entries (Dicom Elements)
45 void gdcmElementSet::Print(std::ostream & os) {
46 for (TagDocEntryHT::iterator i = tagHT.begin(); i != tagHT.end(); ++i)
48 //(*i)->second->SetPrintLevel(printLevel);
49 (i->second)->Print(os);
54 //-----------------------------------------------------------------------------
57 //-----------------------------------------------------------------------------
59 //-----------------------------------------------------------------------------
64 * \brief add a new Dicom Element pointer to the H Table
65 * @param NewEntry entry to add
67 bool gdcmElementSet::AddEntry( gdcmDocEntry *NewEntry) {
69 key = NewEntry->GetKey();
71 if(tagHT.count(key) == 1)
73 dbg.Verbose(1, "gdcmElementSet::AddEntry key already present: ", key.c_str());
78 tagHT[NewEntry->GetKey()] = NewEntry;