source:
orxonox.OLD/trunk/src/lib/event/event_listener.h
@
10163
Last change on this file since 10163 was 9876, checked in by bensch, 18 years ago | |
---|---|
File size: 795 bytes |
Rev | Line | |
---|---|---|
[5143] | 1 | /*! |
[5039] | 2 | * @file event_listener.h |
[5239] | 3 | * Definition of an event listener base class |
[4329] | 4 | */ |
5 | ||
[4346] | 6 | #ifndef _EVENT_LISTENER_H |
7 | #define _EVENT_LISTENER_H | |
[4329] | 8 | |
9 | #include "base_object.h" | |
[9876] | 10 | #include "event_def.h" |
[4365] | 11 | #include "event.h" |
[4329] | 12 | |
[4346] | 13 | //! A class for event listener |
[9869] | 14 | class EventListener : virtual public BaseObject |
15 | { | |
16 | ObjectListDeclaration(EventListener); | |
17 | public: | |
[4346] | 18 | EventListener(); |
19 | virtual ~EventListener(); | |
[4329] | 20 | |
[7868] | 21 | bool isEventSubscribed(elState state, int eventType) const; |
22 | ||
23 | void subscribeEvent(elState state, int eventType); | |
24 | void unsubscribeEvent(elState state, int eventType); | |
25 | void unsubscribeEvents(elState state = ES_ALL); | |
26 | ||
[4454] | 27 | /** |
[7868] | 28 | * @brief abstract function that processes events from the handler |
[4836] | 29 | * @param event: the event |
[5291] | 30 | */ |
[5279] | 31 | virtual void process(const Event &event) = 0; |
[7868] | 32 | |
[4329] | 33 | }; |
34 | ||
[4346] | 35 | #endif /* _EVENT_LISTENER_H */ |
Note: See TracBrowser
for help on using the repository browser.