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 |
|
---|
14 | class Action;
|
---|
15 |
|
---|
16 | class ActionRegistry
|
---|
17 | {
|
---|
18 | public:
|
---|
19 | Action* getActionByName(const std::string);
|
---|
20 | void registerAction(Action*);
|
---|
21 |
|
---|
22 | private:
|
---|
23 | std::map<const std::string,Action*> actionMap;
|
---|
24 |
|
---|
25 | // singleton stuff
|
---|
26 | public:
|
---|
27 | static ActionRegistry* getRegistry();
|
---|
28 | static void purgeRegistry();
|
---|
29 | private:
|
---|
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.