Changes in src/Actions/ActionRegistry.hpp [1e6913:b2d8d0]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/ActionRegistry.hpp
r1e6913 rb2d8d0 1 1 /* 2 * ActionRegistry.hpp2 * Registry<Action>.hpp 3 3 * 4 4 * Created on: Jan 7, 2010 … … 9 9 #define ACTIONREGISTRY_HPP_ 10 10 11 #include <iosfwd> 11 12 #include <string> 12 13 #include <map> 13 14 15 #include "Patterns/Registry.hpp" 14 16 #include "Patterns/Singleton.hpp" 17 #include "Actions/Action.hpp" 15 18 16 class Action; 17 18 class ActionRegistry : public Singleton<ActionRegistry> 19 /** Action Registry. 20 * 21 * The Action registry is a storage for any Action instance to retrieved by name. 22 * It is a singleton and can be called from anywhere. 23 * 24 */ 25 class ActionRegistry : public Singleton<ActionRegistry>, public Registry<Action> 19 26 { 20 27 friend class Singleton<ActionRegistry>; 28 //friend class Registry<Action>; 29 21 30 public: 22 Action* getActionByName(const std::string); 23 bool isActionByNamePresent(const std::string name); 24 void registerAction(Action*); 25 void unregisterAction(Action*); 26 27 std::map<const std::string,Action*>::iterator getBeginIter(); 28 std::map<const std::string,Action*>::iterator getEndIter(); 29 30 private: 31 std::map<const std::string,Action*> actionMap; 31 Action* getActionByName(const std::string name); 32 bool isActionPresentByName(const std::string name); 32 33 33 34 private: 34 35 ActionRegistry(); 35 virtual~ActionRegistry();36 ~ActionRegistry(); 36 37 }; 37 38
Note:
See TracChangeset
for help on using the changeset viewer.