refactored namespaces and added driverfactory
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "utilities/config.h"
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
|
||||
Detector::Detector(std::unique_ptr<IInputGPIOInterface> input_gpio_interface, std::map<char, std::shared_ptr<Event>> events, std::shared_ptr<IEventNotifier> event_notifier) :
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "Event.h"
|
||||
#include "IEventNotifier.h"
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
|
||||
class Detector : public IDetector
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "Event.h"
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
|
||||
class ErrorEvent : public Event
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "utilities/config.h"
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
|
||||
Event::Event(char address, int priority, std::string name) :
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
#include "EventHandler.h"
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
|
||||
EventHandler::EventHandler(std::shared_ptr<IInputDriver> input_driver) :
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "utilities/config.h"
|
||||
#include "Event.h"
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
class EventHandler;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "EventNotifier.h"
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
|
||||
EventNotifier::EventNotifier(IBlockingQueue<Event>* queue) :
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#define HANDLER_TIMEOUT 2000
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
|
||||
class EventNotifier : public IEventNotifier
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#define SRC_INPUT_IDETECTOR_H_
|
||||
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
|
||||
class IDetector
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "IEventHandler.h"
|
||||
#include <memory>
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
|
||||
class IEventNotifier
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <input/ErrorEvent.hpp>
|
||||
#include "InputDriver.h"
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
|
||||
InputDriver::InputDriver(std::shared_ptr<IEventNotifier> event_notifier, std::unique_ptr<IDetector> detector, std::map<std::string, std::shared_ptr<Event>> events) :
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "IInputDriver.h"
|
||||
#include "IDetector.h"
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
|
||||
class InputDriver : public IInputDriver
|
||||
|
||||
@@ -7,16 +7,17 @@
|
||||
|
||||
|
||||
#include "InputDriverFactory.h"
|
||||
#include "InputDriver.h"
|
||||
#include "utilities/LoggerFactory.hpp"
|
||||
#include "EventNotifier.h"
|
||||
|
||||
using namespace nlohmann;
|
||||
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
|
||||
std::shared_ptr<InputDriver> InputDriverFactory::get_InputDriver(std::istream& input_config_stream, std::istream& matrix_config_stream)
|
||||
std::shared_ptr<IInputDriver> InputDriverFactory::get_InputDriver(std::istream& input_config_stream, std::istream& matrix_config_stream)
|
||||
{
|
||||
LoggerFactory::CreateInputLogger();
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <atomic>
|
||||
|
||||
#include "Detector.h"
|
||||
#include "InputDriver.h"
|
||||
#include "IInputDriver.h"
|
||||
|
||||
#include "utilities/InputGPIOInterface.h"
|
||||
#include "utilities/config.h"
|
||||
@@ -24,13 +24,13 @@
|
||||
|
||||
INITIALIZE_EASYLOGGINGPP
|
||||
|
||||
namespace Input
|
||||
namespace FlippR_Driver::Input
|
||||
{
|
||||
class InputDriverFactory
|
||||
{
|
||||
|
||||
public:
|
||||
static std::shared_ptr<InputDriver> get_InputDriver(std::istream& input_config_stream, std::istream& matrix_config_stream);
|
||||
static std::shared_ptr<IInputDriver> get_InputDriver(std::istream& input_config_stream, std::istream& matrix_config_stream);
|
||||
|
||||
private:
|
||||
static void create_input_events(nlohmann::json matrix_config, std::map<char, std::shared_ptr<Event>> address_event_map, std::map<std::string, std::shared_ptr<Event>> name_event_map);
|
||||
|
||||
Reference in New Issue
Block a user