From 22c5849ffd5574c593b957c81697ef0e4c2d9248 Mon Sep 17 00:00:00 2001 From: Jonas Zeunert Date: Thu, 13 Sep 2018 22:38:43 +0200 Subject: [PATCH] refactored public includes --- FlippR-Driver/include/Event.h | 42 +++++++++++++++++++++++++++ FlippR-Driver/include/IEventHandler.h | 21 ++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 FlippR-Driver/include/Event.h create mode 100644 FlippR-Driver/include/IEventHandler.h diff --git a/FlippR-Driver/include/Event.h b/FlippR-Driver/include/Event.h new file mode 100644 index 0000000..6e7a6a9 --- /dev/null +++ b/FlippR-Driver/include/Event.h @@ -0,0 +1,42 @@ +/* + * InputEvent.h + * + * Created on: Apr 5, 2018 + * Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht + */ + +#ifndef INPUTEVENT_H_ +#define INPUTEVENT_H_ + +#include +#include + + +namespace Input +{ + +class Event +{ +public: + Event(char address, int priority, std::string name); + + friend bool operator==(const Event& left, const Event& right); + friend bool operator<(const Event& left, const Event& right) + { + return left.priority < right.priority; + } + +private: + char address; + +public: + int priority; + std::string name; +}; + +bool operator==(const Event& left, const Event& right); + +} + + +#endif /* INPUTEVENT_H_ */ diff --git a/FlippR-Driver/include/IEventHandler.h b/FlippR-Driver/include/IEventHandler.h new file mode 100644 index 0000000..594e0ca --- /dev/null +++ b/FlippR-Driver/include/IEventHandler.h @@ -0,0 +1,21 @@ +/* + * IEventHandler.h + * + * Created on: Jun 13, 2018 + * Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht + */ + +#ifndef SRC_IEVENTHANDLER_H_ +#define SRC_IEVENTHANDLER_H_ + +#include "Event.h" + +class IEventHandler +{ +public: + virtual ~IEventHandler(){}; + + virtual void handle(Input::Event& event) = 0; +}; + +#endif /* SRC_IEVENTHANDLER_H_ */