Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 9656 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
RevLine 
[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]14class 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.