+ gdcmVerboseMacro( "Key already present: " << key.c_str());
+ return false;
+ }
+ else
+ {
+ TagHT.insert(TagDocEntryHT::value_type(newEntry->GetKey(), newEntry));
+ return true;
+ }
+}
+
+/**
+ * \brief Clear the hash table from given entry AND delete the entry.
+ * @param entryToRemove Entry to remove AND delete.
+ */
+bool ElementSet::RemoveEntry( DocEntry *entryToRemove)
+{
+ const TagKey &key = entryToRemove->GetKey();
+ if( TagHT.count(key) == 1 )
+ {
+ TagHT.erase(key);
+ //gdcmVerboseMacro( "One element erased.");
+ delete entryToRemove;
+ return true;
+ }
+
+ gdcmVerboseMacro( "Key not present");
+ return false ;
+}
+
+/**
+ * \brief Clear the hash table from given entry BUT keep the entry.
+ * @param entryToRemove Entry to remove.
+ */
+bool ElementSet::RemoveEntryNoDestroy(DocEntry *entryToRemove)
+{
+ const TagKey &key = entryToRemove->GetKey();
+ if( TagHT.count(key) == 1 )
+ {
+ TagHT.erase(key);
+ //gdcmVerboseMacro( "One element erased.");
+ return true;
+ }
+
+ gdcmVerboseMacro( "Key not present");
+ return false ;
+}
+
+/**
+ * \brief Get the first entry while visiting the DocEntrySet
+ * \return The first DocEntry if found, otherwhise NULL
+ */
+DocEntry *ElementSet::GetFirstEntry()
+{
+ ItTagHT = TagHT.begin();
+ return ItTagHT->second;
+}
+
+/**
+ * \brief Get the next entry while visiting the Hash table (TagHT)
+ * \note : meaningfull only if GetFirstEntry already called
+ * \return The next DocEntry if found, otherwhise NULL
+ */
+DocEntry *ElementSet::GetNextEntry()
+{
+ if (ItTagHT != TagHT.end())