Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/event/event_listener.h @ 7868

Last change on this file since 7868 was 7868, checked in by bensch, 18 years ago

trunk: merge Check in the Event-changes:
r7867 | bensch | 2006-05-26 13:19:46 +0200 (Fri, 26 May 2006) | 1 line

Events better subscribed


r7866 | bensch | 2006-05-26 13:11:10 +0200 (Fri, 26 May 2006) | 1 line

Events are subscribed at the EventListener, and not the EventHandler

File size: 757 bytes
Line 
1/*!
2 * @file event_listener.h
3 *  Definition of an event listener base class
4*/
5
6#ifndef _EVENT_LISTENER_H
7#define _EVENT_LISTENER_H
8
9#include "base_object.h"
10#include "event.h"
11#include "event_def.h"
12
13//! A class for event listener
14class EventListener : virtual public BaseObject {
15
16 public:
17  EventListener();
18  virtual ~EventListener();
19
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
26  /**
27   * @brief abstract function that processes events from the handler
28   * @param event: the event
29   */
30  virtual void process(const Event &event) = 0;
31
32};
33
34#endif /* _EVENT_LISTENER_H */
Note: See TracBrowser for help on using the repository browser.