Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/util/event/event_handler.h @ 4420

Last change on this file since 4420 was 4420, checked in by patrick, 19 years ago

orxonox/trunk: faster and easier unsubscribe function implemented

File size: 957 bytes
Line 
1/*!
2    \file event_handler.h
3    \brief Definition of the EventHandler
4   
5*/
6
7#ifndef _EVENT_HANDLER_H
8#define _EVENT_HANDLER_H
9
10#include "base_object.h"
11#include "key_mapper.h"
12#include "event_def.h"
13
14class EventListener;
15
16
17//! The one Event Handler from Orxonox
18class EventHandler : public BaseObject {
19
20 public:
21  static EventHandler* getInstance(void);
22  virtual ~EventHandler(void);
23
24  void init();
25
26  void setState(elState state);
27
28  void subscribe(EventListener* el, elState state, int eventType);
29  void unsubscribe(elState state, int eventType);
30  void unsubscribe(EventListener* el, elState state = ES_ALL);
31
32  void flush(elState state);
33
34  void tick(float t);
35  void process();
36
37  void test();
38
39 private:
40  EventHandler(void);
41 
42
43 private:
44  static EventHandler* singletonRef;
45  EventListener*** listeners;                         //!< a list of registered listeners
46  elState state;
47  KeyMapper* keyMapper;
48};
49
50#endif /* _EVENT_HANDLER_H */
Note: See TracBrowser for help on using the repository browser.