X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmCommandManager.cxx;h=b99af1967527cbabb3528345bb4649e627ea6d0c;hb=df832cf7f90b4ca5aca2f628c1756fb276779fac;hp=fea22747e3efd84ae212b559c92bfacc7eb10996;hpb=41559a6f2d66bcd4af4db17a0d9668df37d19f3b;p=gdcm.git diff --git a/src/gdcmCommandManager.cxx b/src/gdcmCommandManager.cxx index fea22747..b99af196 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 16:31:22 $ - Version: $Revision: 1.2 $ + Date: $Date: 2007/05/23 14:18:08 $ + 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 @@ -18,8 +18,9 @@ // --------------------------------------------------------------- #include "gdcmCommandManager.h" #include "gdcmCommand.h" +#include // for typeif (needed by __BORLANDC__ v6) -namespace gdcm +namespace GDCM_NAME_SPACE { //----------------------------------------------------------------------------- CommandManager CommandManager::Instance; @@ -45,22 +46,22 @@ CommandManager::~CommandManager () //----------------------------------------------------------------------------- // Public -void CommandManager::SetCommand(const Base *object,unsigned int type,Command *command) +void CommandManager::SetCommand(const Base *object, unsigned int type, Command *command) { - Instance.InSetCommand(object,type,command); + Instance.InSetCommand(object, type, command); } -Command *CommandManager::GetCommand(const Base *object,unsigned int type) +Command *CommandManager::GetCommand(const Base *object, unsigned int type) { - return(Instance.InGetCommand(object,type)); + return(Instance.InGetCommand(object, type)); } -bool CommandManager::ExecuteCommand(Base *object,unsigned int type,std::string text) +bool CommandManager::ExecuteCommand(Base *object, unsigned int type, std::string text) { - return(Instance.InExecuteCommand(object,type,text)); + return(Instance.InExecuteCommand(object, type, text)); } -bool CommandManager::ExecuteCommandConst(const Base *object,unsigned int type,std::string text) +bool CommandManager::ExecuteCommandConst(const Base *object, unsigned int type, std::string text) { return(Instance.InExecuteCommandConst(object,type,text)); } @@ -75,16 +76,16 @@ const CommandManager *CommandManager::GetInstance() void CommandManager::InClearCommand(void) { CommandHT::iterator it; - for(it=CommandList.begin();it!=CommandList.end();++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) +void CommandManager::InSetCommand(const Base *object, unsigned int type, Command *command) { - CommandKey key = CommandKey(object,type); + CommandKey key = CommandKey(object, type); Command *cmd = CommandList[key]; if( cmd != command ) { @@ -92,7 +93,7 @@ void CommandManager::InSetCommand(const Base *object,unsigned int type,Command * cmd->Unregister(); if( command ) { - CommandList[key]=command; + CommandList[key] = command; command->Register(); } else