From: regrain Date: Mon, 28 Nov 2005 16:31:19 +0000 (+0000) Subject: * Improvement #2 : the CommandManager is now a static class so, X-Git-Tag: Version1.3~24 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=41559a6f2d66bcd4af4db17a0d9668df37d19f3b;p=gdcm.git * Improvement #2 : the CommandManager is now a static class so, there is no inheritance from it. And thus, only one hash-table for all objects. This will gain some of memory -- BeNours --- diff --git a/Testing/TestCommand.cxx b/Testing/TestCommand.cxx index 84de4307..ab7b4152 100644 --- a/Testing/TestCommand.cxx +++ b/Testing/TestCommand.cxx @@ -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; diff --git a/Testing/TestDict.cxx b/Testing/TestDict.cxx index 4dd71b14..d3151003 100644 --- a/Testing/TestDict.cxx +++ b/Testing/TestDict.cxx @@ -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); } diff --git a/Testing/TestMakeDicomDir.cxx b/Testing/TestMakeDicomDir.cxx index ec4edc48..50148523 100644 --- a/Testing/TestMakeDicomDir.cxx +++ b/Testing/TestMakeDicomDir.cxx @@ -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); diff --git a/src/gdcmCommand.cxx b/src/gdcmCommand.cxx index 3a3fa452..221e00a8 100644 --- a/src/gdcmCommand.cxx +++ b/src/gdcmCommand.cxx @@ -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; diff --git a/src/gdcmCommand.h b/src/gdcmCommand.h index 2bdb54fe..034976ee 100644 --- a/src/gdcmCommand.h +++ b/src/gdcmCommand.h @@ -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 diff --git a/src/gdcmCommandManager.cxx b/src/gdcmCommandManager.cxx index 49adb418..fea22747 100644 --- a/src/gdcmCommandManager.cxx +++ b/src/gdcmCommandManager.cxx @@ -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<first) - <<" : "<second).name() - <<" ("<second<<")"<first.first).name()<<" ("<first.first<<") - " + <first.second) + <<" : "<second).name()<<" ("<second<<")" + < CommandHT; +typedef std::pair CommandKey; +typedef std::map CommandHT; //----------------------------------------------------------------------------- /** @@ -36,27 +37,35 @@ typedef std::map 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 diff --git a/src/gdcmDebug.cxx b/src/gdcmDebug.cxx index ee5f72b5..a742c86b 100644 --- a/src/gdcmDebug.cxx +++ b/src/gdcmDebug.cxx @@ -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; diff --git a/src/gdcmDebug.h b/src/gdcmDebug.h index e0fe0992..1ee1c0db 100644 --- a/src/gdcmDebug.h +++ b/src/gdcmDebug.h @@ -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; diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index bd5e478e..ef45a81e 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -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 #include @@ -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); } //----------------------------------------------------------------------------- diff --git a/src/gdcmDicomDirElement.h b/src/gdcmDicomDirElement.h index 28d0e44a..fe9dda98 100644 --- a/src/gdcmDicomDirElement.h +++ b/src/gdcmDicomDirElement.h @@ -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 @@ -65,7 +65,7 @@ typedef std::list 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); diff --git a/src/gdcmDict.h b/src/gdcmDict.h index aeda00ab..b460bf78 100644 --- a/src/gdcmDict.h +++ b/src/gdcmDict.h @@ -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 @@ -44,7 +44,7 @@ typedef std::map TagKeyHT; * combined with all software versions... * \see DictSet */ -class GDCM_EXPORT Dict : public CommandManager +class GDCM_EXPORT Dict : public RefCounter { gdcmTypeMacro(Dict); diff --git a/src/gdcmDictGroupName.h b/src/gdcmDictGroupName.h index 99a956d1..bb0d7cc5 100644 --- a/src/gdcmDictGroupName.h +++ b/src/gdcmDictGroupName.h @@ -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 #include @@ -38,7 +38,7 @@ typedef std::map 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); diff --git a/src/gdcmDictSet.h b/src/gdcmDictSet.h index e9d3bcbc..f8f0c147 100644 --- a/src/gdcmDictSet.h +++ b/src/gdcmDictSet.h @@ -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 @@ -38,7 +38,7 @@ typedef std::map 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); diff --git a/src/gdcmDirList.h b/src/gdcmDirList.h index 4fa92355..e4707d0f 100644 --- a/src/gdcmDirList.h +++ b/src/gdcmDirList.h @@ -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 #include @@ -40,7 +39,7 @@ typedef std::vector 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); diff --git a/src/gdcmDocEntry.h b/src/gdcmDocEntry.h index 65dad74f..c0d40870 100644 --- a/src/gdcmDocEntry.h +++ b/src/gdcmDocEntry.h @@ -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 @@ -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); diff --git a/src/gdcmDocEntrySet.h b/src/gdcmDocEntrySet.h index b4f583e4..80f27e9e 100644 --- a/src/gdcmDocEntrySet.h +++ b/src/gdcmDocEntrySet.h @@ -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); diff --git a/src/gdcmFileHelper.h b/src/gdcmFileHelper.h index 5a17c28f..b5f50adc 100644 --- a/src/gdcmFileHelper.h +++ b/src/gdcmFileHelper.h @@ -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); diff --git a/src/gdcmOrientation.h b/src/gdcmOrientation.h index 63b7a9a0..1ff24325 100644 --- a/src/gdcmOrientation.h +++ b/src/gdcmOrientation.h @@ -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 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: diff --git a/src/gdcmSerieHelper.h b/src/gdcmSerieHelper.h index 519255c8..1a960632 100644 --- a/src/gdcmSerieHelper.h +++ b/src/gdcmSerieHelper.h @@ -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 @@ -19,10 +19,9 @@ #ifndef GDCMSERIEHELPER_H #define GDCMSERIEHELPER_H -#include "gdcmCommon.h" +#include "gdcmRefCounter.h" #include "gdcmTagKey.h" #include "gdcmDebug.h" // for LEGACY -#include "gdcmCommandManager.h" #include #include @@ -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); diff --git a/src/gdcmTS.h b/src/gdcmTS.h index 60cdd16d..f2cea1c5 100644 --- a/src/gdcmTS.h +++ b/src/gdcmTS.h @@ -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 #include @@ -38,7 +38,7 @@ typedef std::map 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); diff --git a/src/gdcmVR.h b/src/gdcmVR.h index 745797a2..28778a66 100644 --- a/src/gdcmVR.h +++ b/src/gdcmVR.h @@ -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 @@ -39,7 +39,7 @@ typedef std::map 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); diff --git a/src/gdcmValidator.h b/src/gdcmValidator.h index 618ead72..a5930876 100644 --- a/src/gdcmValidator.h +++ b/src/gdcmValidator.h @@ -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);