46 lines
892 B
C++
46 lines
892 B
C++
/*
|
|
* InputEventHandler.h
|
|
*
|
|
* This interface must be implemented to be informed about input events.
|
|
*
|
|
* Please be aware that handle must be implemented thread safe!
|
|
*
|
|
* Created on: Apr 5, 2018
|
|
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
|
*/
|
|
|
|
#ifndef INPUTEVENTHANDLER_H_
|
|
#define INPUTEVENTHANDLER_H_
|
|
|
|
#include "InputDriver.hpp"
|
|
#include "Event.hpp"
|
|
#include "Detector.h"
|
|
|
|
namespace Input
|
|
{
|
|
|
|
class EventHandler
|
|
{
|
|
public:
|
|
EventHandler(std::shared_ptr<InputDriver> input_driver) :
|
|
input_driver(input_driver)
|
|
{
|
|
this->input_driver->register_event_handler(this);
|
|
}
|
|
|
|
virtual ~EventHandler()
|
|
{
|
|
this->input_driver->unregister_event_handler(this);
|
|
this->input_driver = NULL;
|
|
}
|
|
|
|
virtual void handle(Event& event);
|
|
|
|
private:
|
|
std::shared_ptr<InputDriver> input_driver;
|
|
};
|
|
|
|
}
|
|
|
|
#endif /* INPUTEVENTHANDLER_H_ */
|