source:
orxonox.OLD/orxonox/trunk/src/lib/event/event_handler.h
@
4607
Last change on this file since 4607 was 4519, checked in by bensch, 19 years ago | |
---|---|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[4329] | 1 | /*! |
[4346] | 2 | \file event_handler.h |
3 | \brief Definition of the EventHandler | |
[4329] | 4 | |
5 | */ | |
6 | ||
[4346] | 7 | #ifndef _EVENT_HANDLER_H |
8 | #define _EVENT_HANDLER_H | |
[4329] | 9 | |
10 | #include "base_object.h" | |
[4405] | 11 | #include "key_mapper.h" |
[4352] | 12 | #include "event_def.h" |
[4329] | 13 | |
[4346] | 14 | class EventListener; |
[4329] | 15 | |
[4352] | 16 | |
[4346] | 17 | //! The one Event Handler from Orxonox |
18 | class EventHandler : public BaseObject { | |
19 | ||
[4329] | 20 | public: |
[4346] | 21 | virtual ~EventHandler(void); |
[4519] | 22 | /** \returns a Pointer to the only object of this Class */ |
23 | inline static EventHandler* getInstance(void) { if (!singletonRef) singletonRef = new EventHandler(); return singletonRef; }; | |
[4407] | 24 | void init(); |
25 | ||
[4350] | 26 | void setState(elState state); |
27 | ||
[4405] | 28 | void subscribe(EventListener* el, elState state, int eventType); |
[4419] | 29 | void unsubscribe(elState state, int eventType); |
[4420] | 30 | void unsubscribe(EventListener* el, elState state = ES_ALL); |
[4364] | 31 | void flush(elState state); |
[4346] | 32 | |
[4352] | 33 | void process(); |
[4346] | 34 | |
[4329] | 35 | private: |
[4346] | 36 | EventHandler(void); |
[4368] | 37 | |
[4352] | 38 | |
[4368] | 39 | private: |
[4450] | 40 | static EventHandler* singletonRef; //!< the singleton reference |
[4352] | 41 | EventListener*** listeners; //!< a list of registered listeners |
[4450] | 42 | elState state; //!< the state of the event handlder |
43 | KeyMapper* keyMapper; //!< reference to the key mapper | |
[4329] | 44 | }; |
45 | ||
[4346] | 46 | #endif /* _EVENT_HANDLER_H */ |
Note: See TracBrowser
for help on using the repository browser.