renamed impl to detail
This commit is contained in:
58
FlippR-Driver/src/input/detail/Detector.h
Normal file
58
FlippR-Driver/src/input/detail/Detector.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef INPUT_IMPL_DETECTOR_H_
|
||||
#define INPUT_IMPL_DETECTOR_H_
|
||||
|
||||
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "input/InputPinController.h"
|
||||
|
||||
#include "input/Detector.h"
|
||||
#include "input/DistributingEvent.h"
|
||||
#include "input/EventNotifier.h"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace input
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class Detector : public input::Detector
|
||||
{
|
||||
|
||||
public:
|
||||
Detector(std::unique_ptr<input::InputPinController> input_gpio_interface, std::vector<std::shared_ptr<DistributingEvent>> events);
|
||||
~Detector() override;
|
||||
|
||||
private:
|
||||
void detect() const;
|
||||
void check_inputs() const;
|
||||
|
||||
private:
|
||||
const std::unique_ptr<input::InputPinController> input_gpio_interface;
|
||||
|
||||
const std::vector<std::shared_ptr<DistributingEvent>> events;
|
||||
|
||||
bool is_running;
|
||||
std::thread detect_thread;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user