+2004-10-27 Mathieu Malaterre <Mathieu.Malaterre@creatis.insa-lyon.fr>
+ * Change internals for gdcmDict. Don't use any 'new' any more.
+ This should definitely solve any leak problem, and we should be
+ as fast as before, as long as don't modify too much the dictionary.
+
2004-10-25 Mathieu Malaterre <Mathieu.Malaterre@creatis.insa-lyon.fr>
* STYLE: ivars should start with a capital letter.
* Accessors should be const to avoid people starting modifying stuff (since this is a ref).
// 0018 1310 US ACQ Acquisition Matrix
gdcm::DictEntry *dictEntry =
- f2->GetHeader()->GetPubDict()->GetDictEntryByName( "Acquisition Matrix" );
+ f2->GetHeader()->GetPubDict()->GetDictEntryByName( "Acquisition Matrix" );
std::cerr << std::hex << dictEntry->GetGroup() << "," << dictEntry->GetElement() << std::endl;
// std::string matrix = f2->GetHeader()->GetEntryByNumber(0x0018, 0x1310);
Program: gdcm
Module: $RCSfile: gdcmDict.cxx,v $
Language: C++
- Date: $Date: 2004/10/27 22:31:12 $
- Version: $Revision: 1.48 $
+ Date: $Date: 2004/10/27 22:47:20 $
+ Version: $Revision: 1.49 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
Dict::~Dict()
{
-/* for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag)
- {
- DictEntry* entryToDelete = tag->second;
- if ( entryToDelete )
- {
- delete entryToDelete;
- }
- }*/
// Since AddNewEntry adds symetrical in both KeyHt and NameHT we can
// assume all the pointed DictEntries are already cleaned-up when
// we cleaned KeyHt.
}
else
{
- //KeyHt[newEntry.GetKey()] = newEntry;
KeyHt.insert(
TagKeyHT::value_type<TagKey, DictEntry>
(newEntry.GetKey(), newEntry));
- //NameHt[newEntry.GetName()] = newEntry;
NameHt.insert(
TagNameHT::value_type<TagName, DictEntry>
(newEntry.GetName(), newEntry ));
{
if ( RemoveEntry(newEntry.GetKey()) )
{
- //KeyHt[newEntry.GetKey()] = newEntry;
KeyHt.insert(
TagKeyHT::value_type<TagKey, DictEntry>
(newEntry.GetKey(), newEntry));
- //NameHt[newEntry.GetName()] = newEntry;
NameHt.insert(
TagNameHT::value_type<TagName, DictEntry>
(newEntry.GetName(), newEntry ));
* \brief Get the dictionnary entry identified by it's name.
* @param name element of the ElVal to modify
* \warning : NEVER use it !
- * the 'name' IS NOT an identifier within the Dicom Dicom Dictionary
+ * the 'name' IS NOT an identifier within the Dicom Dictionary
* the name MAY CHANGE between two versions !
* @return the corresponding dictionnary entry when existing, NULL otherwise
*/
Program: gdcm
Module: $RCSfile: gdcmDictSet.cxx,v $
Language: C++
- Date: $Date: 2004/10/27 22:31:12 $
- Version: $Revision: 1.42 $
+ Date: $Date: 2004/10/27 22:47:20 $
+ Version: $Revision: 1.43 $
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
-/* TagKeyHT::iterator it;
- for(it = VirtualEntry.begin(); it != VirtualEntry.end(); ++it)
- {
- DictEntry entry = it->second;
- if ( entry )
- {
- delete entry;
- }
- it->second = NULL;
- }*/
+ VirtualEntry.clear();
}
//-----------------------------------------------------------------------------
else
{
DictEntry ent(group, element, vr, fourth, name);
- //VirtualEntry[tag] = entry;
VirtualEntry.insert(
TagKeyHT::value_type<TagKey, DictEntry>
(tag, ent));
{
Dicts[name] = newDict;
- return true; //FIXME
+ return true;
}
//-----------------------------------------------------------------------------