1 /*=========================================================================
4 Module: $RCSfile: gdcmCommandManager.h,v $
6 Date: $Date: 2007/08/22 16:14:03 $
7 Version: $Revision: 1.6 $
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"
27 namespace GDCM_NAME_SPACE
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();
60 void InClearCommand(void);
61 void InSetCommand(const Base *object, unsigned int type, Command *command);
62 Command *InGetCommand(const Base *object, unsigned int type);
64 bool InExecuteCommand(Base *object, unsigned int type, std::string text = "");
65 bool InExecuteCommandConst(const Base *object, unsigned int type, std::string text = "");
68 static CommandManager Instance;
69 CommandHT CommandList;
71 } // end namespace gdcm
73 //-----------------------------------------------------------------------------