Program: gdcm
Module: $RCSfile: gdcmDictSet.cxx,v $
Language: C++
- Date: $Date: 2004/10/20 14:30:40 $
- Version: $Revision: 1.41 $
+ Date: $Date: 2005/01/06 20:03:27 $
+ Version: $Revision: 1.45 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Dicts.clear();
// Remove virtual dictionnary entries
- std::map<std::string,DictEntry *>::iterator it;
- for(it = VirtualEntry.begin(); it != VirtualEntry.end(); ++it)
- {
- DictEntry *entry = it->second;
- if ( entry )
- {
- delete entry;
- }
- it->second = NULL;
- }
+ VirtualEntry.clear();
}
//-----------------------------------------------------------------------------
* contained is this DictSet, along with their respective content.
* @param os Output stream used for printing.
*/
-void DictSet::Print(std::ostream& os)
+void DictSet::Print(std::ostream &os)
{
for (DictSetHT::iterator dict = Dicts.begin(); dict != Dicts.end(); ++dict)
{
* \sa DictSet::GetPubDictTagNamesByCategory
* @return A list of all entries of the public dicom dictionnary.
*/
-EntryNamesList * DictSet::GetPubDictEntryNames()
+EntryNamesList *DictSet::GetPubDictEntryNames()
{
return GetDefaultPubDict()->GetDictEntryNames();
}
* corresponding values are lists of all the dictionnary entries
* among that group.
*/
-EntryNamesByCatMap * DictSet::GetPubDictEntryNamesByCategory()
+EntryNamesByCatMap *DictSet::GetPubDictEntryNamesByCategory()
{
return GetDefaultPubDict()->GetDictEntryNamesByCategory();
}
* @param dictName The symbolic name of the searched dictionary.
* \result The retrieved dictionary.
*/
-Dict *DictSet::GetDict(DictKey const & dictName)
+Dict *DictSet::GetDict(DictKey const &dictName)
{
DictSetHT::iterator dict = Dicts.find(dictName);
if(dict != Dicts.end())
TagName fourth,
TagName name)
{
- DictEntry* entry;
+ DictEntry *entry;
const std::string tag = DictEntry::TranslateToKey(group,element)
+ "#" + vr + "#" + fourth + "#" + name;
- std::map<std::string,DictEntry *>::iterator it;
+ TagKeyHT::iterator it;
it = VirtualEntry.find(tag);
if(it != VirtualEntry.end())
{
- entry = it->second;
+ entry = &(it->second);
}
else
{
- entry = new DictEntry(group, element, vr, fourth, name);
- VirtualEntry[tag] = entry;
+ DictEntry ent(group, element, vr, fourth, name);
+ VirtualEntry.insert(
+ std::map<TagKey, DictEntry>::value_type
+ (tag, ent));
+ entry = &(VirtualEntry.find(tag)->second);
}
return entry;
//-----------------------------------------------------------------------------
// Protected
-bool DictSet::AppendDict(Dict *newDict, DictKey const & name)
+bool DictSet::AppendDict(Dict *newDict, DictKey const &name)
{
Dicts[name] = newDict;
- return true; //FIXME
+ return true;
}
//-----------------------------------------------------------------------------