]> Creatis software - gdcm.git/commitdiff
* Improvement #2 : the CommandManager is now a static class so,
authorregrain <regrain>
Mon, 28 Nov 2005 16:31:19 +0000 (16:31 +0000)
committerregrain <regrain>
Mon, 28 Nov 2005 16:31:19 +0000 (16:31 +0000)
     there is no inheritance from it. And thus, only one hash-table for all objects.
     This will gain some of memory
   -- BeNours

23 files changed:
Testing/TestCommand.cxx
Testing/TestDict.cxx
Testing/TestMakeDicomDir.cxx
src/gdcmCommand.cxx
src/gdcmCommand.h
src/gdcmCommandManager.cxx
src/gdcmCommandManager.h
src/gdcmDebug.cxx
src/gdcmDebug.h
src/gdcmDicomDir.cxx
src/gdcmDicomDirElement.h
src/gdcmDict.h
src/gdcmDictGroupName.h
src/gdcmDictSet.h
src/gdcmDirList.h
src/gdcmDocEntry.h
src/gdcmDocEntrySet.h
src/gdcmFileHelper.h
src/gdcmOrientation.h
src/gdcmSerieHelper.h
src/gdcmTS.h
src/gdcmVR.h
src/gdcmValidator.h

index 84de4307369854d52e27069ef8a842c5d52d28e0..ab7b41522960ca9ec2d7930110ae9952054f712c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestCommand.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:29 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/11/28 16:31:19 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -60,33 +60,31 @@ int TestCommand(int argc, char *argv[])
 {
    int error=0;
 
-   gdcm::CommandManager *mgr = gdcm::CommandManager::New();
-   CommandTest *cmd = CommandTest::New();
    gdcm::CallbackCommand *cbk = gdcm::CallbackCommand::New();
    cbk->SetCallback(CallbackTest);
-
-   mgr->SetCommand(2,cmd);
-   mgr->SetCommand(1,cbk);
-
+   gdcm::CommandManager::SetCommand(NULL,1,cbk);
    cbk->Delete();
+
+   CommandTest *cmd = CommandTest::New();
+   gdcm::CommandManager::SetCommand(NULL,2,cmd);
    cmd->Delete();
 
    std::cout << "Test on callback function execution\n";
-   mgr->ExecuteCommand(1,"Test on callback function");
+   gdcm::CommandManager::ExecuteCommand(NULL,1,"Test on callback function");
    if(!fctExecuted)
       std::cout<<"... Failed\n";
    error+=!fctExecuted;
    std::cout << std::endl;
 
    std::cout << "Test on command class execution\n";
-   mgr->ExecuteCommand(2,"Test on command class");
+   gdcm::CommandManager::ExecuteCommand(NULL,2,"Test on command class");
    if(!cmd->IsExecuted())
       std::cout<<"... Failed\n";
    error+=!cmd->IsExecuted();
    std::cout << std::endl;
 
    std::cout << "Test on unset command execution\n";
-   mgr->ExecuteCommand(3,"Test on callback function");
+   gdcm::CommandManager::ExecuteCommand(NULL,3,"Test on callback function");
    std::cout << std::endl;
 
    return error;
index 4dd71b144d06d74fa6e2964f006f7986211a972b..d31510031ce6cbc8f2120b8ac0c6d56576285d6d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestDict.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/25 14:52:30 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2005/11/28 16:31:19 $
+  Version:   $Revision: 1.11 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -102,12 +102,11 @@ int TestDict(int , char *[])
       entry=pubDict->GetNextEntry();
    }
 
-   // Let's play with DicEntry stuff !
-
+/*   // Let's play with DicEntry stuff !
    // First, we try to break an Entry.
    entry=pubDict->GetFirstEntry();
    entry->SetVR("PN");
-   // Should warn us !
+   // Should warn us !*/
 
    return(0);
 }
index ec4edc48b95ce4188e73188eb220f1e5ef4f3311..50148523f3101885d38330f44eee9286d8a41db1 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestMakeDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:29 $
-  Version:   $Revision: 1.11 $
+  Date:      $Date: 2005/11/28 16:31:19 $
+  Version:   $Revision: 1.12 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,6 +19,7 @@
 #include "gdcmDicomDir.h"
 #include "gdcmDicomDirPatient.h"
 #include "gdcmDirList.h"
+#include "gdcmCommandManager.h"
 #include "gdcmDebug.h"
 
 // ---
@@ -110,13 +111,13 @@ int TestMakeDicomDir(int argc, char *argv[])
  
    gdcm::Command *cmd;
    cmd = CommandStart::New();
-   dcmdir->SetCommand(gdcm::CMD_STARTPROGRESS,cmd);
+   gdcm::CommandManager::SetCommand(dcmdir,gdcm::CMD_STARTPROGRESS,cmd);
    cmd->Delete();
    cmd = CommandProgress::New();
-   dcmdir->SetCommand(gdcm::CMD_PROGRESS,cmd);
+   gdcm::CommandManager::SetCommand(dcmdir,gdcm::CMD_PROGRESS,cmd);
    cmd->Delete();
    cmd = CommandEnd::New();
-   dcmdir->SetCommand(gdcm::CMD_ENDPROGRESS,cmd);
+   gdcm::CommandManager::SetCommand(dcmdir,gdcm::CMD_ENDPROGRESS,cmd);
    cmd->Delete();
 
    // dcmdir->SetLoadMode(gdcm::LD_NOSEQ | gdcm::LD_NOSHADOW);
index 3a3fa452a1117dd441e7d32af176238955b3b27c..221e00a8726d3576e29d091be3746262b5df0f69 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmCommand.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:35 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/11/28 16:31:22 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -53,22 +53,22 @@ unsigned int Command::GetType() const
    return Cmd;
 }
 
-void Command::SetObject(CommandManager *object)
+void Command::SetObject(Base *object)
 {
    Object = object;
 }
 
-CommandManager *Command::GetObject() const
+Base *Command::GetObject() const
 {
    return Object;
 }
 
-void Command::SetConstObject(const CommandManager *object)
+void Command::SetConstObject(const Base *object)
 {
    ConstObject = object;
 }
 
-const CommandManager *Command::GetConstObject() const
+const Base *Command::GetConstObject() const
 {
    if(ConstObject)
       return ConstObject;
index 2bdb54fe18953fed1e6f59d1ad0bd0e79ffc6b2e..034976ee1856c2abbbd2b0ab870c297dd2bda75e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmCommand.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:35 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/11/28 16:31:22 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -55,10 +55,10 @@ public:
    void SetType(unsigned int type);
    unsigned int GetType() const;
 
-   void SetObject(CommandManager *object);
-   CommandManager *GetObject() const;
-   void SetConstObject(const CommandManager *object);
-   const CommandManager *GetConstObject() const;
+   void SetObject(Base *object);
+   Base *GetObject() const;
+   void SetConstObject(const Base *object);
+   const Base *GetConstObject() const;
 
    void SetText(const std::string &text);
    const std::string &GetText() const;
@@ -73,8 +73,8 @@ protected:
 
 private:
    std::string Text;
-   CommandManager *Object;
-   const CommandManager *ConstObject;
+   Base *Object;
+   const Base *ConstObject;
    unsigned int Cmd;
 };
 } // end namespace gdcm
index 49adb41807f3d8fc10e566a7f1588b990269be5b..fea22747e3efd84ae212b559c92bfacc7eb10996 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmCommandManager.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:35 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/11/28 16:31:22 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -21,6 +21,9 @@
 
 namespace gdcm 
 {
+//-----------------------------------------------------------------------------
+CommandManager CommandManager::Instance;
+
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 /**
@@ -36,32 +39,73 @@ CommandManager::CommandManager()
  */
 CommandManager::~CommandManager ()
 {
+   if( this == GetInstance() )
+      InClearCommand();
 }
 
 //-----------------------------------------------------------------------------
 // Public
-void CommandManager::SetCommand(unsigned int type,Command *command)
+void CommandManager::SetCommand(const Base *object,unsigned int type,Command *command)
+{
+   Instance.InSetCommand(object,type,command);
+}
+
+Command *CommandManager::GetCommand(const Base *object,unsigned int type)
+{
+   return(Instance.InGetCommand(object,type));
+}
+
+bool CommandManager::ExecuteCommand(Base *object,unsigned int type,std::string text)
 {
-   Command *cmd=CommandList[type];
-   if(cmd!=command)
+   return(Instance.InExecuteCommand(object,type,text));
+}
+
+bool CommandManager::ExecuteCommandConst(const Base *object,unsigned int type,std::string text)
+{
+   return(Instance.InExecuteCommandConst(object,type,text));
+}
+
+const CommandManager *CommandManager::GetInstance()
+{
+   return &Instance;
+}
+
+//-----------------------------------------------------------------------------
+// Protected
+void CommandManager::InClearCommand(void)
+{
+   CommandHT::iterator it;
+   for(it=CommandList.begin();it!=CommandList.end();++it)
+   {
+      if( it->second )
+         it->second->Delete();
+   }
+}
+
+void CommandManager::InSetCommand(const Base *object,unsigned int type,Command *command)
+{
+   CommandKey key = CommandKey(object,type);
+   Command *cmd = CommandList[key];
+   if( cmd != command )
    {
-      if(cmd)
+      if( cmd )
          cmd->Unregister();
-      if(command)
+      if( command )
       {
-         CommandList[type]=command;
+         CommandList[key]=command;
          command->Register();
       }
       else
-         CommandList.erase(type);
+         CommandList.erase(key);
    }
 }
 
-Command *CommandManager::GetCommand(unsigned int type) const
+Command *CommandManager::InGetCommand(const Base *object,unsigned int type)
 {
+   CommandKey key = CommandKey(object,type);
    try
    {
-      return CommandList[type];
+      return CommandList[key];
    }
    catch(...)
    {
@@ -69,13 +113,13 @@ Command *CommandManager::GetCommand(unsigned int type) const
    }
 }
 
-bool CommandManager::ExecuteCommand(unsigned int type,std::string text)
+bool CommandManager::InExecuteCommand(Base *object,unsigned int type,std::string text)
 {
-   Command *cmd = GetCommand(type);
-   if(cmd)
+   Command *cmd = GetCommand(object,type);
+   if( cmd )
    {
       cmd->SetText(text);
-      cmd->SetObject(this);
+      cmd->SetObject(object);
       cmd->SetType(type);
       cmd->Execute();
       return true;
@@ -83,13 +127,13 @@ bool CommandManager::ExecuteCommand(unsigned int type,std::string text)
    return false;
 }
 
-bool CommandManager::ConstExecuteCommand(unsigned int type,std::string text) const
+bool CommandManager::InExecuteCommandConst(const Base *object,unsigned int type,std::string text)
 {
-   Command *cmd = GetCommand(type);
-   if(cmd)
+   Command *cmd = GetCommand(object,type);
+   if( cmd )
    {
       cmd->SetText(text);
-      cmd->SetConstObject(this);
+      cmd->SetConstObject(object);
       cmd->SetType(type);
       cmd->Execute();
       return true;
@@ -97,9 +141,6 @@ bool CommandManager::ConstExecuteCommand(unsigned int type,std::string text) con
    return false;
 }
 
-//-----------------------------------------------------------------------------
-// Protected
-
 //-----------------------------------------------------------------------------
 // Private
 
@@ -111,9 +152,10 @@ void CommandManager::Print(std::ostream &os, std::string const &indent)
    CommandHT::iterator it;
    for(it=CommandList.begin();it!=CommandList.end();++it)
    {
-      os<<indent<<"   "<<Command::GetCommandAsString(it->first)
-        <<" : "<<typeid(it->second).name()
-        <<" ("<<it->second<<")"<<std::endl;
+      os<<indent<<"   "<<typeid(it->first.first).name()<<" ("<<it->first.first<<") - "
+        <<Command::GetCommandAsString(it->first.second)
+        <<" : "<<typeid(it->second).name()<<" ("<<it->second<<")"
+        <<std::endl;
    }
 }
 
index 55966e012b5a9f85a198e4a8cbffeed47a47e3d7..cd7244f8e3ec3adad3585d2a998c136015e65373 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmCommandManager.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:35 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/11/28 16:31:22 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -28,7 +28,8 @@ namespace gdcm
 {
 //-----------------------------------------------------------------------------
 class Command;
-typedef std::map<unsigned int,Command *> CommandHT;
+typedef std::pair<const Base *,unsigned int> CommandKey;
+typedef std::map<CommandKey,Command *> CommandHT;
 
 //-----------------------------------------------------------------------------
 /**
@@ -36,27 +37,35 @@ typedef std::map<unsigned int,Command *> CommandHT;
  *
  * \remarks The execution parameter depends on the
  */
-class GDCM_EXPORT CommandManager : public RefCounter
+class GDCM_EXPORT CommandManager : public Base
 {
    gdcmTypeMacro(CommandManager);
 
 public:
-   /// \brief Contructs an empty Dict with a RefCounter
-   static CommandManager *New() {return new CommandManager();}
    void Print(std::ostream &os = std::cout, std::string const &indent = "" );
 
-   void SetCommand(unsigned int type,Command *command);
-   Command *GetCommand(unsigned int type) const;
+   static void SetCommand(const Base *object,unsigned int type,Command *command);
+   static Command *GetCommand(const Base *object,unsigned int type);
 
-   bool ExecuteCommand(unsigned int type,std::string text = "");
-   bool ConstExecuteCommand(unsigned int type,std::string text = "") const;
+   static bool ExecuteCommand(Base *object,unsigned int type,std::string text = "");
+   static bool ExecuteCommandConst(const Base *object,unsigned int type,std::string text = "");
+
+   static const CommandManager *GetInstance();
 
 protected:
    CommandManager();
    ~CommandManager();
 
+   void InClearCommand(void);
+   void InSetCommand(const Base *object,unsigned int type,Command *command);
+   Command *InGetCommand(const Base *object,unsigned int type);
+
+   bool InExecuteCommand(Base *object,unsigned int type,std::string text = "");
+   bool InExecuteCommandConst(const Base *object,unsigned int type,std::string text = "");
+
 private:
-   mutable CommandHT CommandList;
+   static CommandManager Instance;
+   CommandHT CommandList;
 };
 } // end namespace gdcm
 
index ee5f72b545fb69c44ca30eaaa5031a09b8cd2c6c..a742c86b8bb56676d8e1b19ad284f3cfc88dc961 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDebug.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:32 $
-  Version:   $Revision: 1.27 $
+  Date:      $Date: 2005/11/28 16:31:22 $
+  Version:   $Revision: 1.28 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -118,11 +118,10 @@ std::ostream &Debug::GetOutput ()
       return StandardStream;
 }
 
-void Debug::SendToOutput(unsigned int type,std::string const &msg,const CommandManager *mgr)
+void Debug::SendToOutput(unsigned int type,std::string const &msg,const Base *object)
 {
    bool executed=false;
-   if(mgr)
-      executed=mgr->ConstExecuteCommand(type,msg);
+   executed=CommandManager::ExecuteCommandConst(object,type,msg);
 
    if(!executed)
       GetOutput() << Command::GetCommandAsString(type) << ": " << msg;
index e0fe099281a06dbe85a88c7193721c2435809386..1ee1c0dbd0eb629198c488cc39b062bd0d6368a4 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDebug.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:30:03 $
-  Version:   $Revision: 1.49 $
+  Date:      $Date: 2005/11/28 16:31:23 $
+  Version:   $Revision: 1.50 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -88,7 +88,7 @@ public:
 
    static std::ostream &GetOutput ();
 
-   static void SendToOutput(unsigned int type,std::string const &msg,const CommandManager *mgr = NULL);
+   static void SendToOutput(unsigned int type,std::string const &msg,const Base *object = NULL);
 
 private:
    static bool DebugFlag;
index bd5e478e621d42b714badd0ce8284a9ef4adc6a5..ef45a81e8388d2f040828f95ee971b67f0c6c5fb 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:32 $
-  Version:   $Revision: 1.174 $
+  Date:      $Date: 2005/11/28 16:31:23 $
+  Version:   $Revision: 1.175 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -37,6 +37,7 @@
 #include "gdcmSeqEntry.h"
 #include "gdcmSQItem.h"
 #include "gdcmDataEntry.h"
+#include "gdcmCommandManager.h"
 
 #include <fstream>
 #include <string>
@@ -503,7 +504,7 @@ void DicomDir::CallStartMethod()
 {
    Progress = 0.0f;
    Abort    = false;
-   ExecuteCommand(CMD_STARTPROGRESS);
+   CommandManager::ExecuteCommand(this,CMD_STARTPROGRESS);
 }
 
 /**
@@ -511,7 +512,7 @@ void DicomDir::CallStartMethod()
  */
 void DicomDir::CallProgressMethod()
 {
-   ExecuteCommand(CMD_PROGRESS);
+   CommandManager::ExecuteCommand(this,CMD_PROGRESS);
 }
 
 /**
@@ -520,7 +521,7 @@ void DicomDir::CallProgressMethod()
 void DicomDir::CallEndMethod()
 {
    Progress = 1.0f;
-   ExecuteCommand(CMD_ENDPROGRESS);
+   CommandManager::ExecuteCommand(this,CMD_ENDPROGRESS);
 }
 
 //-----------------------------------------------------------------------------
index 28d0e44a4333edc0a53d22ff307a7e3400316899..fe9dda9876ba26859a62bb3a893164a403447bbe 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirElement.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:32 $
-  Version:   $Revision: 1.36 $
+  Date:      $Date: 2005/11/28 16:31:23 $
+  Version:   $Revision: 1.37 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,7 +19,7 @@
 #ifndef GDCMDICOMDIRELEMENT_H
 #define GDCMDICOMDIRELEMENT_H
 
-#include "gdcmCommandManager.h"
+#include "gdcmRefCounter.h"
 
 #include <list>
 
@@ -65,7 +65,7 @@ typedef std::list<DicomElement> ListDicomDirFiducialElem;
  * \brief   Represents elements contained in a DicomDir class
  *          for the chained lists from the file 'Dicts/DicomDir.dic'
  */
-class GDCM_EXPORT DicomDirElement : public CommandManager
+class GDCM_EXPORT DicomDirElement : public RefCounter
 {
    gdcmTypeMacro(DicomDirElement);
 
index aeda00ab3d2baf5dbfe9ef0b639910895af17242..b460bf784b8da1dd73bec359750fc25d2c6dc071 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDict.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:32 $
-  Version:   $Revision: 1.47 $
+  Date:      $Date: 2005/11/28 16:31:23 $
+  Version:   $Revision: 1.48 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,7 +19,7 @@
 #ifndef GDCMDICT_H
 #define GDCMDICT_H
 
-#include "gdcmCommandManager.h"
+#include "gdcmRefCounter.h"
 #include "gdcmDictEntry.h"
 
 #include <iostream>
@@ -44,7 +44,7 @@ typedef std::map<TagKey, DictEntry *>  TagKeyHT;
  *           combined with all software versions...
  * \see DictSet
  */
-class GDCM_EXPORT Dict : public CommandManager
+class GDCM_EXPORT Dict : public RefCounter
 {
    gdcmTypeMacro(Dict);
 
index 99a956d12ccbeebbac55d015ebe7acca02836ad3..bb0d7cc58a3853b3d9a2501f2eb5e50f17288637 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDictGroupName.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:32 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2005/11/28 16:31:23 $
+  Version:   $Revision: 1.8 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,7 +19,7 @@
 #ifndef GDCMDICTGROUPNAME_H
 #define GDCMDICTGROUPNAME_H
 
-#include "gdcmCommandManager.h"
+#include "gdcmRefCounter.h"
 
 #include <map>
 #include <string>
@@ -38,7 +38,7 @@ typedef std::map<uint16_t, TagName> DictGroupNameHT;
  *        (formerly NIH defined ACR-NEMA group name)
  * \note   This is a singleton.
  */
-class GDCM_EXPORT DictGroupName : public CommandManager
+class GDCM_EXPORT DictGroupName : public RefCounter
 {
    gdcmTypeMacro(DictGroupName);
 
index e9d3bcbc0676f9c0e400b11d21269c439e4e3f52..f8f0c147fcc118b9bd2d02324b8d5529f1bea9ac 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDictSet.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:33 $
-  Version:   $Revision: 1.51 $
+  Date:      $Date: 2005/11/28 16:31:23 $
+  Version:   $Revision: 1.52 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,7 +19,7 @@
 #ifndef GDCMDICTSET_H
 #define GDCMDICTSET_H
 
-#include "gdcmCommandManager.h"
+#include "gdcmRefCounter.h"
 #include "gdcmDict.h"
 
 #include <map>
@@ -38,7 +38,7 @@ typedef std::map<DictKey, Dict*> DictSetHT;
  *         - having many in memory representations of the same dictionary
  *        (saving memory).
  */
-class GDCM_EXPORT DictSet : public CommandManager
+class GDCM_EXPORT DictSet : public RefCounter
 {
    gdcmTypeMacro(DictSet);
 
index 4fa92355a61a85492a0699564ac8eea4c92c291f..e4707d0f7eab276bbeb19a46d98c656b37357812 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDirList.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:33 $
-  Version:   $Revision: 1.28 $
+  Date:      $Date: 2005/11/28 16:31:23 $
+  Version:   $Revision: 1.29 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,8 +19,7 @@
 #ifndef GDCMDIRLIST_H
 #define GDCMDIRLIST_H
 
-#include "gdcmCommon.h"
-#include "gdcmCommandManager.h"
+#include "gdcmBase.h"
 
 #include <string>
 #include <vector>
@@ -40,7 +39,7 @@ typedef std::vector<std::string> DirListType;
  * \brief   List containing the file headers of all the 'gdcm readable' files
  *          found by exploring (possibely recursively) a root directory. 
  */
-class GDCM_EXPORT DirList : public CommandManager
+class GDCM_EXPORT DirList : public Base
 {
 public :
    DirList(std::string const &dirName, bool recursive=false);
index 65dad74f0f3752b40cbab48538762c9534a3d34d..c0d4087055b77203acc17f67a5c42a47ea2d7c05 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntry.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:33 $
-  Version:   $Revision: 1.57 $
+  Date:      $Date: 2005/11/28 16:31:23 $
+  Version:   $Revision: 1.58 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,7 +19,7 @@
 #ifndef GDCMDOCENTRY_H
 #define GDCMDOCENTRY_H
 
-#include "gdcmCommandManager.h"
+#include "gdcmRefCounter.h"
 #include "gdcmDictEntry.h"
 
 #include <iostream>
@@ -35,7 +35,7 @@ class SeqEntry;
  * \brief   The dicom header of a Dicom file contains a set of such entries
  *          (when successfuly parsed against a given Dicom dictionary)
  */
-class GDCM_EXPORT DocEntry : public CommandManager
+class GDCM_EXPORT DocEntry : public RefCounter
 {
    gdcmTypeMacro(DocEntry);
 
index b4f583e4aac3020c65953acfc249453d7bfdd7b2..80f27e9e694e037ac81de28cd9f19b729192161b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntrySet.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:33 $
-  Version:   $Revision: 1.64 $
+  Date:      $Date: 2005/11/28 16:31:23 $
+  Version:   $Revision: 1.65 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,7 +19,7 @@
 #ifndef GDCMDOCENTRYSET_H
 #define GDCMDOCENTRYSET_H
 
-#include "gdcmCommandManager.h"
+#include "gdcmRefCounter.h"
 #include "gdcmVRKey.h"
 #include "gdcmTagKey.h"
 
@@ -58,7 +58,7 @@ class DictEntry;
  *       members to this class since this class is designed as an adapter 
  *       in the form of an abstract base class.
  */
-class GDCM_EXPORT DocEntrySet : public CommandManager
+class GDCM_EXPORT DocEntrySet : public RefCounter
 {
    gdcmTypeMacro(DocEntrySet);
 
index 5a17c28f0c3108c6fd5e7e1482149f5c1a0d1080..b5f50adc5c939dc8434aa0b92c4f85087b0d2fab 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFileHelper.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:33 $
-  Version:   $Revision: 1.34 $
+  Date:      $Date: 2005/11/28 16:31:23 $
+  Version:   $Revision: 1.35 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -20,7 +20,7 @@
 #define GDCMFILEHELPER_H
 
 #include "gdcmDebug.h"
-#include "gdcmCommandManager.h"
+#include "gdcmRefCounter.h"
 
 
 namespace gdcm 
@@ -40,7 +40,7 @@ typedef void (*VOID_FUNCTION_PUINT8_PFILE_POINTER)(uint8_t *, File *);
  * for accessing the image/volume content. One can also use it to
  * write Dicom/ACR-NEMA/RAW files.
  */
-class GDCM_EXPORT FileHelper : public CommandManager
+class GDCM_EXPORT FileHelper : public RefCounter
 {
    gdcmTypeMacro(FileHelper);
 
index 63b7a9a0f6b35ad902ebcd15a962b387d98f3140..1ff2432599c99b14c793bb4a3d6619e05624ec8e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmOrientation.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:34 $
-  Version:   $Revision: 1.16 $
+  Date:      $Date: 2005/11/28 16:31:23 $
+  Version:   $Revision: 1.17 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,7 +19,8 @@
 #ifndef GDCMORIENTATION_H
 #define GDCMORIENTATION_H
 
-#include "gdcmCommandManager.h"
+#include "gdcmRefCounter.h"
+
 #include <map>
 
 namespace gdcm 
@@ -95,7 +96,7 @@ typedef enum {
  * The values are given within the 'Patient referential', *not* within the 'Organ referential' ...
  */
 
-class GDCM_EXPORT Orientation : public CommandManager
+class GDCM_EXPORT Orientation : public RefCounter
 {
    gdcmTypeMacro(Orientation);
 public:
index 519255c8b0592efb312d6f0ec30c81dba36ef54f..1a960632f079f115ae2d54380358222be9ada6f8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSerieHelper.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:34 $
-  Version:   $Revision: 1.31 $
+  Date:      $Date: 2005/11/28 16:31:23 $
+  Version:   $Revision: 1.32 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 #ifndef GDCMSERIEHELPER_H
 #define GDCMSERIEHELPER_H
 
-#include "gdcmCommon.h" 
+#include "gdcmRefCounter.h"
 #include "gdcmTagKey.h" 
 #include "gdcmDebug.h"  // for LEGACY
-#include "gdcmCommandManager.h"
  
 #include <vector>
 #include <iostream>
@@ -56,7 +55,7 @@ class File;
  *    into several XCoherent Filesets 
  *   XCoherent stands for 'Extra Coherent' (same orientation, or same position)
  */
-class GDCM_EXPORT SerieHelper  : public CommandManager
+class GDCM_EXPORT SerieHelper  : public RefCounter
 {
    gdcmTypeMacro(SerieHelper);
    
index 60cdd16d85235c25fcf5cbba5fe050d388940073..f2cea1c5b37de70691e33fd547c45b9a221e8f82 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmTS.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:34 $
-  Version:   $Revision: 1.25 $
+  Date:      $Date: 2005/11/28 16:31:23 $
+  Version:   $Revision: 1.26 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,7 +19,7 @@
 #ifndef GDCMTS_H
 #define GDCMTS_H
 
-#include "gdcmCommandManager.h"
+#include "gdcmRefCounter.h"
 
 #include <map>
 #include <string>
@@ -38,7 +38,7 @@ typedef std::map<TSKey, TSAtr> TSHT;    // Transfer Syntax Hash Table
  * \brief Container for dicom 'Transfer Syntax' Hash Table
  * \note   This is a singleton
  */
-class GDCM_EXPORT TS : public CommandManager
+class GDCM_EXPORT TS : public RefCounter
 {
    gdcmTypeMacro(TS);
 
index 745797a2b7d040929d333d841323e059b4649da8..28778a66fa3ac465dacd88c2baa4b1fb19b700b8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmVR.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:34 $
-  Version:   $Revision: 1.27 $
+  Date:      $Date: 2005/11/28 16:31:24 $
+  Version:   $Revision: 1.28 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,7 +19,7 @@
 #ifndef GDCMVR_H
 #define GDCMVR_H
 
-#include "gdcmCommandManager.h"
+#include "gdcmRefCounter.h"
 #include "gdcmVRKey.h"
 
 #include <map>
@@ -39,7 +39,7 @@ typedef std::map<VRKey, VRAtr> VRHT;
  * \brief Container for dicom Value Representation Hash Table
  * \note   This is a singleton
  */
-class GDCM_EXPORT VR : public CommandManager
+class GDCM_EXPORT VR : public RefCounter
 {
    gdcmTypeMacro(VR);
 
index 618ead72ca52899aa4214230a43eeed71199f8ac..a5930876783620418bf20b8ee6fc48cd544aa3e1 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmValidator.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/28 15:20:34 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2005/11/28 16:31:24 $
+  Version:   $Revision: 1.5 $
  
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,7 +19,7 @@
 #ifndef GDCMVALIDATOR_H
 #define GDCMVALIDATOR_H
 
-#include "gdcmCommandManager.h"
+#include "gdcmRefCounter.h"
 
 namespace gdcm 
 {
@@ -27,7 +27,7 @@ namespace gdcm
  * \brief Class to perform some verifications on a gdcm::Document
  */
 class ElementSet;
-class GDCM_EXPORT Validator : public CommandManager
+class GDCM_EXPORT Validator : public RefCounter
 {
    gdcmTypeMacro(Validator);