renamed impl to detail
This commit is contained in:
58
FlippR-Driver/src/input/detail/EventNotifier.h
Normal file
58
FlippR-Driver/src/input/detail/EventNotifier.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* InputEventNotifier.h
|
||||
*
|
||||
* Created on: May 17, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef INPUT_IMPL_EVENTNOTIFIER_H_
|
||||
#define INPUT_IMPL_EVENTNOTIFIER_H_
|
||||
|
||||
#include "input/EventNotifier.h"
|
||||
|
||||
#include "input/Event.h"
|
||||
#include "input/EventHandler.h"
|
||||
|
||||
#include "utility/BlockingQueue.hpp"
|
||||
#include "utility/IBlockingQueue.h"
|
||||
|
||||
#include <set>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace input
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class EventNotifier : public input::EventNotifier
|
||||
{
|
||||
|
||||
public:
|
||||
explicit EventNotifier(utility::IBlockingQueue<Event> *queue);
|
||||
~EventNotifier() override;
|
||||
|
||||
void register_event_handler(EventHandler *handler) override;
|
||||
void unregister_event_handler(EventHandler *handler) override;
|
||||
|
||||
void distribute_event(const Event &event) override;
|
||||
|
||||
private:
|
||||
void notify();
|
||||
|
||||
private:
|
||||
utility::IBlockingQueue<Event> *event_queue;
|
||||
std::set<EventHandler *> event_handlers;
|
||||
|
||||
bool is_running;
|
||||
std::thread notify_thread;
|
||||
std::mutex event_handler_mutex;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user