58 lines
954 B
C++
58 lines
954 B
C++
/*
|
|
* InputDriver.hpp
|
|
*
|
|
* Created on: May 31, 2018
|
|
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
|
*/
|
|
|
|
#include "../utilities/config.h"
|
|
|
|
|
|
#ifndef SRC_INPUT_INPUTDRIVER_HPP_
|
|
#define SRC_INPUT_INPUTDRIVER_HPP_
|
|
|
|
#include "EventNotifier.h"
|
|
|
|
namespace Input
|
|
{
|
|
|
|
class EventHandler
|
|
{
|
|
public:
|
|
void handle(Event& event);
|
|
};
|
|
|
|
class InputDriver
|
|
{
|
|
|
|
public:
|
|
InputDriver(EventNotifier* event_notifier) :
|
|
event_notifier(event_notifier)
|
|
{
|
|
CLOG(INFO, INPUT_LOGGER) << "Created InputDriver";
|
|
}
|
|
|
|
~InputDriver()
|
|
{
|
|
delete event_notifier;
|
|
event_notifier = NULL;
|
|
}
|
|
|
|
void register_event_handler(EventHandler* handler)
|
|
{
|
|
event_notifier->register_event_handler(handler);
|
|
}
|
|
|
|
void unregister_event_handler(EventHandler* handler)
|
|
{
|
|
event_notifier->unregister_event_handler(handler);
|
|
}
|
|
|
|
private:
|
|
EventNotifier* event_notifier;
|
|
};
|
|
|
|
}
|
|
|
|
#endif /* SRC_INPUT_INPUTDRIVER_HPP_ */
|