source: molecuilder/src/Actions/ActionRegistry.hpp@ 3e8325

Last change on this file since 3e8325 was 3e8325, checked in by Tillmann Crueger <crueger@…>, 16 years ago

Added a central registry that allows access to actions by name.

  • Property mode set to 100644
File size: 591 bytes
Line 
1/*
2 * ActionRegistry.hpp
3 *
4 * Created on: Jan 7, 2010
5 * Author: crueger
6 */
7
8#ifndef ACTIONREGISTRY_HPP_
9#define ACTIONREGISTRY_HPP_
10
11#include <string>
12#include <map>
13
14class Action;
15
16class ActionRegistry
17{
18public:
19 Action* getActionByName(const std::string);
20 void registerAction(Action*);
21
22private:
23 std::map<const std::string,Action*> actionMap;
24
25// singleton stuff
26public:
27 static ActionRegistry* getRegistry();
28 static void purgeRegistry();
29private:
30 ActionRegistry();
31 virtual ~ActionRegistry();
32 static ActionRegistry *theInstance;
33};
34
35#endif /* ACTIONREGISTRY_HPP_ */
Note: See TracBrowser for help on using the repository browser.