-gdcmDictEntry * gdcmDict::GetTagByName(TagName name) {
- if ( ! NameHt.count(name))
- return (gdcmDictEntry*)0;
- return NameHt.find(name)->second;
+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;
+ }
+ return it->second;
+}
+
+/**
+ * \brief Get the first entry while visiting the Dict entries
+ * \return The first DicEntry if found, otherwhise NULL
+ */
+DictEntry *Dict::GetFirstEntry()
+{
+ ItKeyHt = KeyHt.begin();
+ if ( ItKeyHt != KeyHt.end() )
+ return ItKeyHt->second;
+ return NULL;
+}
+
+/**
+ * \brief Get the next entry while visiting the Hash table (KeyHt)
+ * \note : meaningfull only if GetFirstEntry already called
+ * \return The next DictEntry if found, otherwhise NULL
+ */
+DictEntry *Dict::GetNextEntry()
+{
+ gdcmAssertMacro (ItKeyHt != KeyHt.end());
+
+ ++ItKeyHt;
+ if (ItKeyHt != KeyHt.end())
+ return ItKeyHt->second;
+ return NULL;