gaze
0.1.0
Perform gaze tracking with common webcams.
|
Handles communication between non-gui and gui processes in a safe way. More...
#include "gaze/gui/event_manager.h"
Public Member Functions | |
void | publish (void *data, Events event) |
void | subscribe (dlib::base_window *subscriber) |
void | unsubscribe (dlib::base_window *subscriber) |
Static Public Member Functions | |
static EventManager & | instance () |
Handles communication between non-gui and gui processes in a safe way.
This EventManager performs no sophisticated distinction about subcribers to specific events, from specific callers, etc., instead it just passes all published events to all subscribers.
Definition at line 37 of file event_manager.h.
|
static |
Definition at line 15 of file event_manager.cpp.
Referenced by gaze::gui::DebugWindow::DebugWindow().
void gaze::gui::EventManager::publish | ( | void * | data, |
Events | event | ||
) |
Publishes an event with the given data to all subscribers using dlib::base_window::trigger_user_event(void*,int).
data | the data to pass along |
event | the event identifier |
Definition at line 20 of file event_manager.cpp.
void gaze::gui::EventManager::subscribe | ( | dlib::base_window * | subscriber | ) |
Subscribes the new subscriber to all events.
subscriber | The new subscriber. |
Definition at line 26 of file event_manager.cpp.
References std::vector< _Tp, _Alloc >::push_back().
Referenced by gaze::gui::DebugWindow::DebugWindow().
void gaze::gui::EventManager::unsubscribe | ( | dlib::base_window * | subscriber | ) |
Unsubscribes the subscriber from all events.
subscriber | The unsubscriber. |
Definition at line 30 of file event_manager.cpp.
References std::vector< _Tp, _Alloc >::begin(), std::vector< _Tp, _Alloc >::end(), std::vector< _Tp, _Alloc >::erase(), and std::remove().