00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision: 13561 $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #ifndef MITKDelegateManager_H_HEADER_INCLUDED 00020 #define MITKDelegateManager_H_HEADER_INCLUDED 00021 00022 #include "mitkMessage.h" 00023 #include "MitkExtExports.h" 00024 #include "mitkCommon.h" 00025 00026 #include <map> 00027 00028 namespace mitk 00029 { 00030 00036 //typedef MessageAbstractDelegate Command; 00037 00044 class MitkExt_EXPORT DelegateManager 00045 { 00046 public: 00050 static DelegateManager* GetInstance(); 00055 void SetCommand(const std::string& _CommandID, MessageAbstractDelegate<>*); 00059 bool RemoveCommand(const std::string& _CommandID); 00063 MessageAbstractDelegate<>* GetCommand(const std::string& _CommandID) const; 00067 virtual ~DelegateManager(); 00068 protected: 00072 DelegateManager(); 00076 std::map<std::string, MessageAbstractDelegate<>*> m_CommandMap; 00077 00078 }; 00079 } 00080 00081 00082 #endif /* MITKDelegateManager_H_HEADER_INCLUDED */ 00083 00084