Files
flippr-code/FlippR-Driver/src/input/Detector.h
Jonas Zeunert 6650b38d2e aaah
2018-07-10 22:20:29 +02:00

57 lines
1.0 KiB
C++

/*
* Detector.h
*
* Responsible for detecting InputEvents.
*
* Creates two Threads;
* One cycles over the inputs gpios and pushes detected input events to a queue.
* The other cycles over the queue and notifies input event handlers.
*
* Created on: Apr 5, 2018
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
*/
#ifndef DETECTOR_H_
#define DETECTOR_H_
#include <thread>
#include <map>
#include "utilities/IInputGPIOInterface.h"
#include "IDetector.h"
#include "Event.h"
#include "IEventNotifier.h"
namespace Input
{
class Detector : public IDetector
{
public:
Detector(IInputGPIOInterface* input_gpio_interface, std::map<char, Event> events, IEventNotifier* event_notifier);
~Detector();
private:
void detect();
bool check_inputs(char& address);
private:
IInputGPIOInterface* input_gpio_interface;
std::map<char, Event> events;
IEventNotifier* event_notifier;
bool is_running;
std::thread detect_thread;
};
}
#endif /* DETECTOR_H_ */