Last change
on this file since 4852 was
4836,
checked in by bensch, 19 years ago
|
orxonox/trunk: renamed all the \param → @param and so on in Doxygen tags.
Thanks a lot to the kDevelop team. this took since the last commit
|
File size:
1.3 KB
|
Line | |
---|
1 | /*! |
---|
2 | \file event_handler.h |
---|
3 | * Definition of the EventHandler |
---|
4 | |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef _EVENT_HANDLER_H |
---|
8 | #define _EVENT_HANDLER_H |
---|
9 | |
---|
10 | #include "base_object.h" |
---|
11 | #include "key_mapper.h" |
---|
12 | #include "event_def.h" |
---|
13 | |
---|
14 | // FORWARD DECLARATION |
---|
15 | class EventListener; |
---|
16 | template <class T> class tList; |
---|
17 | |
---|
18 | //! The one Event Handler from Orxonox |
---|
19 | class EventHandler : public BaseObject { |
---|
20 | |
---|
21 | public: |
---|
22 | virtual ~EventHandler(); |
---|
23 | /** @returns a Pointer to the only object of this Class */ |
---|
24 | inline static EventHandler* getInstance() { if (!singletonRef) singletonRef = new EventHandler(); return singletonRef; }; |
---|
25 | void init(); |
---|
26 | |
---|
27 | void setState(elState state); |
---|
28 | |
---|
29 | void subscribe(EventListener* el, elState state, int eventType); |
---|
30 | void unsubscribe(elState state, int eventType); |
---|
31 | void unsubscribe(EventListener* el, elState state = ES_ALL); |
---|
32 | void flush(elState state); |
---|
33 | |
---|
34 | void process(); |
---|
35 | |
---|
36 | private: |
---|
37 | EventHandler(); |
---|
38 | |
---|
39 | |
---|
40 | private: |
---|
41 | static EventHandler* singletonRef; //!< the singleton reference |
---|
42 | |
---|
43 | EventListener*** listeners; //!< a list of registered listeners |
---|
44 | elState state; //!< the state of the event handlder |
---|
45 | KeyMapper* keyMapper; //!< reference to the key mapper |
---|
46 | }; |
---|
47 | |
---|
48 | #endif /* _EVENT_HANDLER_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.