]> Creatis software - gdcm.git/commitdiff
ENH: Minor cleanup, mostly remove comments
authormalaterre <malaterre>
Wed, 27 Oct 2004 22:47:19 +0000 (22:47 +0000)
committermalaterre <malaterre>
Wed, 27 Oct 2004 22:47:19 +0000 (22:47 +0000)
ChangeLog
Example/TestChangeHeader.cxx
src/gdcmDict.cxx
src/gdcmDictSet.cxx

index 03a0380903485caa26964ec59ce22665646f46b9..748425db8813780da3e402df31cecf63ac767f74 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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). 
index 1ad0e782e7f090b5126cfdde3adf602d2d11c12c..6550733f36953d82e18b05f36fe5f1544e5324df 100644 (file)
@@ -20,7 +20,7 @@ std::endl;
 
     // 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);
index 01acd68d5f82eab8835e9ea16297fa258fc16fa6..ffcd2dc7efbc718453163eb409b24c38bad408e8 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -68,14 +68,6 @@ Dict::Dict(std::string const & filename)
  */
 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.
@@ -161,11 +153,9 @@ bool Dict::AddNewEntry(DictEntry const & newEntry)
    } 
    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 ));
@@ -183,11 +173,9 @@ bool Dict::ReplaceEntry(DictEntry const & 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 ));
@@ -237,7 +225,7 @@ bool Dict::RemoveEntry (uint16_t group, uint16_t element)
  * \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
  */
index afe0b0799212e1746bc5e576db02d11eb7273d74..04238f0b0a6c66661d64b4197932db796ab1660b 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -58,16 +58,7 @@ DictSet::~DictSet()
    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();
 }
 
 //-----------------------------------------------------------------------------
@@ -191,7 +182,6 @@ DictEntry *DictSet::NewVirtualDictEntry( uint16_t group,
    else
    {
       DictEntry ent(group, element, vr, fourth, name);
-      //VirtualEntry[tag] = entry;
       VirtualEntry.insert(
          TagKeyHT::value_type<TagKey, DictEntry>
             (tag, ent));
@@ -238,7 +228,7 @@ bool DictSet::AppendDict(Dict *newDict, DictKey const & name)
 {
    Dicts[name] = newDict;
 
-   return true;   //FIXME
+   return true;
 }
 
 //-----------------------------------------------------------------------------