1 /*=========================================================================
4 Module: $RCSfile: gdcmCommandManager.h,v $
6 Date: $Date: 2005/11/28 16:31:22 $
7 Version: $Revision: 1.2 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
19 #ifndef GDCMCOMMANDMANAGER_H
20 #define GDCMCOMMANDMANAGER_H
22 #include "gdcmRefCounter.h"
29 //-----------------------------------------------------------------------------
31 typedef std::pair<const Base *,unsigned int> CommandKey;
32 typedef std::map<CommandKey,Command *> CommandHT;
34 //-----------------------------------------------------------------------------
36 * \brief CommandManager base class to react on a gdcm event
38 * \remarks The execution parameter depends on the
40 class GDCM_EXPORT CommandManager : public Base
42 gdcmTypeMacro(CommandManager);
45 void Print(std::ostream &os = std::cout, std::string const &indent = "" );
47 static void SetCommand(const Base *object,unsigned int type,Command *command);
48 static Command *GetCommand(const Base *object,unsigned int type);
50 static bool ExecuteCommand(Base *object,unsigned int type,std::string text = "");
51 static bool ExecuteCommandConst(const Base *object,unsigned int type,std::string text = "");
53 static const CommandManager *GetInstance();
59 void InClearCommand(void);
60 void InSetCommand(const Base *object,unsigned int type,Command *command);
61 Command *InGetCommand(const Base *object,unsigned int type);
63 bool InExecuteCommand(Base *object,unsigned int type,std::string text = "");
64 bool InExecuteCommandConst(const Base *object,unsigned int type,std::string text = "");
67 static CommandManager Instance;
68 CommandHT CommandList;
70 } // end namespace gdcm
72 //-----------------------------------------------------------------------------