gaze  0.1.0
Perform gaze tracking with common webcams.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
event_manager.h
1 #ifndef INCLUDE_GAZE_GUI_EVENT_MANAGER_H_
2 #define INCLUDE_GAZE_GUI_EVENT_MANAGER_H_
3 
4 #include <vector>
5 
6 #include "dlib/gui_core.h"
7 
8 
9 namespace gaze {
10 
11 namespace gui {
12 
21 enum Events : int {
22  PIPELINE_DATA_UPDATED
23 };
24 
37 class EventManager {
39 
43  EventManager();
44 
45  public:
50  static EventManager& instance();
51 
59  void publish(void* data, Events event);
60 
66  void subscribe(dlib::base_window* subscriber);
67 
73  void unsubscribe(dlib::base_window* subscriber);
74 };
75 
76 } // namespace gui
77 
78 } // namespace gaze
79 
80 #endif // INCLUDE_GAZE_GUI_EVENT_MANAGER_H_
static EventManager & instance()
void publish(void *data, Events event)
void unsubscribe(dlib::base_window *subscriber)
Handles communication between non-gui and gui processes in a safe way.
Definition: event_manager.h:37
void subscribe(dlib::base_window *subscriber)
An enum of events to make it easy to distinguish them with names instead of numbers.