45 lines
863 B
C++
45 lines
863 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 "Detector.h"
|
|
#include "Event.hpp"
|
|
|
|
namespace Input
|
|
{
|
|
|
|
class InputEventHandler
|
|
{
|
|
public:
|
|
InputEventHandler(std::shared_ptr<Detector> detector) :
|
|
detector(detector)
|
|
{
|
|
this->detector->register_input_event_handler(this);
|
|
}
|
|
|
|
virtual ~InputEventHandler()
|
|
{
|
|
this->detector->unregister_input_event_handler(this);
|
|
this->detector = NULL;
|
|
}
|
|
|
|
virtual void handle(InputEvent& event);
|
|
|
|
private:
|
|
std::shared_ptr<Detector> detector;
|
|
};
|
|
|
|
}
|
|
|
|
#endif /* INPUTEVENTHANDLER_H_ */
|