working on big refactor

This commit is contained in:
Jonas Zeunert
2018-12-14 01:09:54 +01:00
parent f3100004b9
commit 2aee0f4f9d
67 changed files with 914 additions and 619 deletions

View File

@@ -1,55 +1,27 @@
/*
* 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
* Created on: Jun 13, 2018
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
*/
#ifndef DETECTOR_H_
#define DETECTOR_H_
#ifndef SRC_INPUT_DETECTOR_H_
#define SRC_INPUT_DETECTOR_H_
#include <thread>
#include <vector>
#include <map>
#include "IInputGPIOInterface.h"
#include "IDetector.h"
#include "DistributingEvent.h"
#include "IEventNotifier.h"
namespace flippR_driver
{
namespace input
{
class Detector : public IDetector
class Detector
{
public:
Detector(std::unique_ptr<IInputGPIOInterface> input_gpio_interface, std::vector<std::shared_ptr<DistributingEvent>> events);
~Detector() override;
private:
void detect();
void check_inputs();
private:
const std::unique_ptr<IInputGPIOInterface> input_gpio_interface;
const std::vector<std::shared_ptr<DistributingEvent>> events;
bool is_running;
std::thread detect_thread;
virtual ~Detector() = default;
};
}
}
#endif
#endif