diff --git a/FlippR-Driver/src/Input/Detector.cpp b/FlippR-Driver/src/Input/Detector.cpp deleted file mode 100644 index 87ae5f8..0000000 --- a/FlippR-Driver/src/Input/Detector.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Detector.cpp - * - * Created on: Apr 5, 2018 - * Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht - */ - -#include "Detector.h" - -#include - -namespace Input -{ - -Detector::Detector(std::vector events) : - input_events(events), is_running(true) -{ - detect_thread = std::thread(&Detector::detect, this); -} - - -Detector::~Detector() -{ - is_running = false; - detect_thread.join(); -} - -void Detector::register_input_event_handler(InputEventHandler* handler) -{ - event_handler.insert(handler); -} - -void Detector::unregister_input_event_handler(InputEventHandler* handler) -{ - event_handler.erase(handler); -} - -void Detector::detect() -{ - while(is_running) - { - std::cout << "hallo_thread\n"; - } -} - -void Detector::notify_handlers(InputEvent& event) -{ - for(auto* handler : event_handler) - { - handler->handle(event); - } -} - -} diff --git a/FlippR-Driver/src/Input/Detector.h b/FlippR-Driver/src/Input/Detector.h deleted file mode 100644 index dd51e68..0000000 --- a/FlippR-Driver/src/Input/Detector.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Detector.h - * - * Created on: Apr 5, 2018 - * Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht - */ - -#ifndef DETECTOR_H_ -#define DETECTOR_H_ - -#include -#include - -#include "InputEvent.h" - -namespace Input -{ - -class Detector -{ -public: - Detector(std::vector events); - ~Detector(); - - void register_input_event_handler(InputEventHandler* handler); - void unregister_input_event_handler(InputEventHandler* handler); - -private: - void detect(); - - void notify_handlers(InputEvent& event); - -private: - std::vector input_events; - std::set event_handler; - - std::thread detect_thread; - bool is_running; -}; - -} - - - -#endif /* DETECTOR_H_ */ diff --git a/FlippR-Driver/src/Input/InputEvent.h b/FlippR-Driver/src/Input/InputEvent.h deleted file mode 100644 index f495bca..0000000 --- a/FlippR-Driver/src/Input/InputEvent.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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 - -#include "InputEventHandler.h" - -namespace Input -{ - -class InputEvent -{ -public: - InputEvent(); - ~InputEvent(); - -private: - char address; - std::string name; -}; - -} - - -#endif /* INPUTEVENT_H_ */ diff --git a/FlippR-Driver/src/Input/InputEventHandler.h b/FlippR-Driver/src/Input/InputEventHandler.h deleted file mode 100644 index 1857a32..0000000 --- a/FlippR-Driver/src/Input/InputEventHandler.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * InputEventHandler.h - * - * Created on: Apr 5, 2018 - * Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht - */ - -#ifndef INPUTEVENTHANDLER_H_ -#define INPUTEVENTHANDLER_H_ - -#include "InputEvent.h" - -namespace Input -{ - - -class InputEventHandler -{ -public: - virtual ~InputEventHandler(){}; - virtual void handle(InputEvent& event) = 0; -}; - -} - -#endif /* INPUTEVENTHANDLER_H_ */ diff --git a/FlippR-Driver/src/Input/InputFactory.h b/FlippR-Driver/src/Input/InputFactory.h deleted file mode 100644 index aa86965..0000000 --- a/FlippR-Driver/src/Input/InputFactory.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * InputFactory.h - * - * Created on: Apr 5, 2018 - * Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht - */ - -#ifndef INPUTFACTORY_H_ -#define INPUTFACTORY_H_ -#include - -#include "InputEvent.h" - -namespace Input -{ -class InputFactory -{ - -public: - InputFactory(); - ~InputFactory(); - - std::vector get_input_events(); - -private: - std::vector input_events; - -}; -} - - - -#endif /* INPUTFACTORY_H_ */ diff --git a/FlippR-Driver/src/Input/main.cpp b/FlippR-Driver/src/Input/main.cpp deleted file mode 100644 index 408487e..0000000 --- a/FlippR-Driver/src/Input/main.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include "InputEvent.h" -#include "Detector.h" -#include -int main() -{ - Input::Detector(std::vector()); - - std::printf("hallo"); - - return 0; -}