- * \ingroup gdcmDict
- * \brief
- * @param NewEntry
- * @return
- */
- int gdcmDict::AddNewEntry(gdcmDictEntry* NewEntry) {
- TagKey key;
- key = NewEntry->GetKey();
-
- if(KeyHt.count(key) == 1) {
- dbg.Verbose(1, "gdcmDict::AddNewEntry already present", key.c_str());
- return(0);
- } else {
- KeyHt[NewEntry->GetKey()] = NewEntry;
- return(1);
+ * \brief Remove all Dicom Dictionary Entries
+ */
+void Dict::ClearEntry()
+{
+ // we assume all the pointed DictEntries are already cleaned-up
+ // when we clean KeyHt.
+ TagKeyHT::const_iterator it;
+
+ for(it = KeyHt.begin();it!=KeyHt.end();++it)
+ it->second->Unregister(); // delete the entry
+ KeyHt.clear(); // remove all the entries from HTable
+
+}
+
+/**
+ * \brief Get the dictionary entry identified by a given tag ("group|element")
+ * @param key tag of the searched entry
+ * @return the corresponding dictionary entry when existing, NULL otherwise
+ */
+DictEntry *Dict::GetEntry(TagKey const &key)
+{
+ TagKeyHT::iterator it = KeyHt.find(key);
+ if ( it == KeyHt.end() )
+ {
+ return 0;
+ }
+ return it->second;
+}
+/**
+ * \brief Get the dictionary entry identified by its "group" and "element")
+ * @param group Group number of the searched entry.
+ * @param elem Element number of the searched entry.
+ * @return the corresponding dictionary entry when existing, NULL otherwise
+ */
+DictEntry *Dict::GetEntry(uint16_t group, uint16_t elem)
+{
+ TagKey key = DictEntry::TranslateToKey(group, elem);
+ TagKeyHT::iterator it = KeyHt.find(key);
+ if ( it == KeyHt.end() )
+ {
+ return 0;