45 lines
987 B
C++
45 lines
987 B
C++
/*
|
|
* InputDriver.hpp
|
|
*
|
|
* Created on: May 31, 2018
|
|
* Author: Johannes Wendel, Jonas Zeunert
|
|
*/
|
|
#ifndef INPUT_IMPL_INPUTDRIVER_H_
|
|
#define INPUT_IMPL_INPUTDRIVER_H_
|
|
|
|
#include "input/InputDriver.h"
|
|
|
|
#include <map>
|
|
|
|
#include "input/EventNotifier.h"
|
|
#include "input/Detector.h"
|
|
|
|
namespace flippR_driver
|
|
{
|
|
namespace input
|
|
{
|
|
namespace detail
|
|
{
|
|
|
|
class InputDriver : public input::InputDriver
|
|
{
|
|
|
|
public:
|
|
|
|
InputDriver(std::shared_ptr<EventNotifier> event_notifier, std::unique_ptr<Detector> detector, std::map<std::string, std::shared_ptr<Event>> events);
|
|
void register_event_handler(std::shared_ptr<EventHandler> handler) override;
|
|
void unregister_event_handler(std::shared_ptr<EventHandler> handler) override;
|
|
|
|
boost::optional<std::shared_ptr<Event>> get_event(std::string name) override;
|
|
|
|
private:
|
|
const std::shared_ptr<EventNotifier> event_notifier;
|
|
const std::unique_ptr<Detector> detector;
|
|
|
|
const std::map<std::string, std::shared_ptr<Event>> events;
|
|
};
|
|
|
|
}
|
|
}
|
|
}
|
|
#endif |