source:
orxonox.OLD/trunk/src/lib/event/event_listener.h
@
8965
Last change on this file since 8965 was 7868, checked in by bensch, 18 years ago | |
---|---|
File size: 757 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" | |
[4365] | 10 | #include "event.h" |
[7868] | 11 | #include "event_def.h" |
[4329] | 12 | |
[4346] | 13 | //! A class for event listener |
[4404] | 14 | class EventListener : virtual public BaseObject { |
[4329] | 15 | |
16 | public: | |
[4346] | 17 | EventListener(); |
18 | virtual ~EventListener(); | |
[4329] | 19 | |
[7868] | 20 | bool isEventSubscribed(elState state, int eventType) const; |
21 | ||
22 | void subscribeEvent(elState state, int eventType); | |
23 | void unsubscribeEvent(elState state, int eventType); | |
24 | void unsubscribeEvents(elState state = ES_ALL); | |
25 | ||
[4454] | 26 | /** |
[7868] | 27 | * @brief abstract function that processes events from the handler |
[4836] | 28 | * @param event: the event |
[5291] | 29 | */ |
[5279] | 30 | virtual void process(const Event &event) = 0; |
[7868] | 31 | |
[4329] | 32 | }; |
33 | ||
[4346] | 34 | #endif /* _EVENT_LISTENER_H */ |
Note: See TracBrowser
for help on using the repository browser.