refactored input names and created facade
This commit is contained in:
44
FlippR-Driver/src/input/EventHandler.hpp
Normal file
44
FlippR-Driver/src/input/EventHandler.hpp
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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_ */
|
||||
Reference in New Issue
Block a user