-int gdcmDictSet::LoadDictFromFile(string FileName, DictKey Name) {
- gdcmDict *NewDict = new gdcmDict(FileName.c_str());
- dicts[Name] = NewDict;
- return 0; //FIXME if this is a dummy return make the method void
+/**
+ * \brief Create a DictEntry which will be referenced in no dictionary
+ * @param group Group number of the Entry
+ * @param elem Element number of the Entry
+ * @param vr Value Representation of the Entry
+ * @param vm Value Multiplicity of the Entry
+ * @param name English name of the Entry
+ * @return virtual entry
+ */
+DictEntry *DictSet::NewVirtualDictEntry( uint16_t group,
+ uint16_t elem,
+ TagName vr,
+ TagName vm,
+ TagName name)
+{
+ DictEntry *entry;
+
+ // Let's follow 'Purify' advice
+ //
+ // const std::string tag = DictEntry::TranslateToKey(group,elem)
+ // + "#" + vr + "#" + vm + "#" + name;
+ char res[10];
+ sprintf(res,"%04x|%04x", group, elem);
+ std::string tag = res;
+ tag += "#" + vr + "#" + vm + "#" + name;
+
+ TagKeyHT::iterator it;
+
+ it = VirtualEntries.find(tag);
+ if ( it != VirtualEntries.end() )
+ {
+ entry = &(it->second);
+ }
+ else
+ {
+ DictEntry ent(group, elem, vr, vm, name);
+ VirtualEntries.insert(
+ std::map<TagKey, DictEntry>::value_type(tag, ent) );
+ entry = &(VirtualEntries.find(tag)->second);
+ }
+
+ return entry;