Adds output factory-prototypes
This commit is contained in:
@@ -37,7 +37,7 @@ std::shared_ptr<OutputDriver> get_OutputDriver(std::istream& solenoid_config,
|
||||
std::istream& sound_config,
|
||||
std::istream& display_config)
|
||||
{
|
||||
utility::LoggerFactory::CreateOutputLogger();
|
||||
/* utility::LoggerFactory::CreateOutputLogger();
|
||||
|
||||
solenoid_config >> config::solenoids;
|
||||
lamp_config >> config::lamps;
|
||||
@@ -59,7 +59,7 @@ std::shared_ptr<OutputDriver> get_OutputDriver(std::istream& solenoid_config,
|
||||
std::unique_ptr<DisplayController> display_controller(new detail::DisplayController(displays, std::move(display_board_pin_controller)));
|
||||
auto display_map = map_displays(displays);
|
||||
|
||||
return std::make_shared<OutputDriver>(std::move(display_controller), solenoids, lamps, sounds, flippers, display_map);
|
||||
return std::make_shared<OutputDriver>(std::move(display_controller), solenoids, lamps, sounds, flippers, display_map);*/
|
||||
}
|
||||
|
||||
std::map<std::string, std::shared_ptr<items::Solenoid>> create_solenoids(std::shared_ptr<DriverBoardPinController> &pin_controller)
|
||||
@@ -235,7 +235,7 @@ std::vector<std::shared_ptr<items::OutputDisplay>> create_displays(std::istream
|
||||
|
||||
std::shared_ptr<items::OutputDisplay> create_display(json & display_json)
|
||||
{
|
||||
std::string config_file = "display_config.json";
|
||||
/* std::string config_file = "display_config.json";
|
||||
auto id = get_value<uint8_t>("id", display_json, config_file);
|
||||
auto address = get_value<uint8_t>("address", display_json, config_file);
|
||||
auto digits = get_value<uint8_t>("digits", display_json, config_file);
|
||||
@@ -246,7 +246,7 @@ std::shared_ptr<items::OutputDisplay> create_display(json & display_json)
|
||||
return std::make_shared<items::detail::SevenDigitDisplay>(address, id);
|
||||
|
||||
else
|
||||
throw new std::logic_error("Display digits can either be 7 or 8");
|
||||
throw new std::logic_error("Display digits can either be 7 or 8");*/
|
||||
}
|
||||
|
||||
std::map<uint8_t, std::shared_ptr<items::Display>> map_displays(const std::vector<std::shared_ptr<items::OutputDisplay>> &displays)
|
||||
|
||||
27
FlippR-Driver/src/output/factories/DisplayFactory.cpp
Normal file
27
FlippR-Driver/src/output/factories/DisplayFactory.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* DisplayFactory.cpp
|
||||
*
|
||||
* Created on: December 28, 2019
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "DisplayFactory.h"
|
||||
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
DisplayFactory::DisplayFactory(nlohmann::json &object) : Factory(object)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::map<std::string, std::shared_ptr<items::Item>> DisplayFactory::getItemMap()
|
||||
{
|
||||
return std::map<std::string, std::shared_ptr<items::Item>>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
30
FlippR-Driver/src/output/factories/DisplayFactory.h
Normal file
30
FlippR-Driver/src/output/factories/DisplayFactory.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* DisplayFactory.h
|
||||
*
|
||||
* Created on: December 28, 2019
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef FLIPPR_DRIVER_DISPLAYFACTORY_H
|
||||
#define FLIPPR_DRIVER_DISPLAYFACTORY_H
|
||||
|
||||
#include "Factory.h"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class DisplayFactory : Factory
|
||||
{
|
||||
public:
|
||||
explicit DisplayFactory(nlohmann::json & object);
|
||||
std::map<std::string, std::shared_ptr<items::Item>> getItemMap() override;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif //FLIPPR_DRIVER_DISPLAYFACTORY_H
|
||||
22
FlippR-Driver/src/output/factories/Factory.cpp
Normal file
22
FlippR-Driver/src/output/factories/Factory.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Factory.cpp
|
||||
*
|
||||
* Created on: December 28, 2019
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "Factory.h"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
Factory::Factory(nlohmann::json &object) :
|
||||
object{object}
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
35
FlippR-Driver/src/output/factories/Factory.h
Normal file
35
FlippR-Driver/src/output/factories/Factory.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Factory.h
|
||||
*
|
||||
* Created on: December 28, 2019
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef FLIPPR_DRIVER_FACTORY_H
|
||||
#define FLIPPR_DRIVER_FACTORY_H
|
||||
|
||||
#include "utility/config.h"
|
||||
#include "json/json.hpp"
|
||||
#include "output/items/Item.h"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class Factory
|
||||
{
|
||||
public:
|
||||
Factory(nlohmann::json &object);
|
||||
|
||||
virtual std::map<std::string, std::shared_ptr<items::Item>> getItemMap() = 0;
|
||||
|
||||
protected:
|
||||
nlohmann::json object;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif //FLIPPR_DRIVER_FACTORY_H
|
||||
26
FlippR-Driver/src/output/factories/FlipperFactory.cpp
Normal file
26
FlippR-Driver/src/output/factories/FlipperFactory.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* FlipperFactory.cpp
|
||||
*
|
||||
* Created on: December 28, 2019
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "FlipperFactory.h"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
FlipperFactory::FlipperFactory(nlohmann::json &object) : Factory(object)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::map<std::string, std::shared_ptr<items::Item>> FlipperFactory::getItemMap()
|
||||
{
|
||||
return std::map<std::string, std::shared_ptr<items::Item>>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
31
FlippR-Driver/src/output/factories/FlipperFactory.h
Normal file
31
FlippR-Driver/src/output/factories/FlipperFactory.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* FlipperFactory.h
|
||||
*
|
||||
* Created on: December 28, 2019
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef FLIPPR_DRIVER_FLIPPERFACTORY_H
|
||||
#define FLIPPR_DRIVER_FLIPPERFACTORY_H
|
||||
|
||||
#include "Factory.h"
|
||||
#include <string>
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class FlipperFactory : Factory
|
||||
{
|
||||
public:
|
||||
explicit FlipperFactory(nlohmann::json & object);
|
||||
std::map <std::string, std::shared_ptr<items::Item>> getItemMap() override;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif //FLIPPR_DRIVER_FLIPPERFACTORY_H
|
||||
27
FlippR-Driver/src/output/factories/LampFactory.cpp
Normal file
27
FlippR-Driver/src/output/factories/LampFactory.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* LampFactory.cpp
|
||||
*
|
||||
* Created on: December 28, 2019
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "LampFactory.h"
|
||||
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
LampFactory::LampFactory(nlohmann::json &object) : Factory(object)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::map<std::string, std::shared_ptr<items::Item>> LampFactory::getItemMap()
|
||||
{
|
||||
return std::map<std::string, std::shared_ptr<items::Item>>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
29
FlippR-Driver/src/output/factories/LampFactory.h
Normal file
29
FlippR-Driver/src/output/factories/LampFactory.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* LampFactory.h
|
||||
*
|
||||
* Created on: December 28, 2019
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef FLIPPR_DRIVER_LAMPFACTORY_H
|
||||
#define FLIPPR_DRIVER_LAMPFACTORY_H
|
||||
|
||||
#include "Factory.h"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class LampFactory : Factory
|
||||
{
|
||||
public:
|
||||
explicit LampFactory(nlohmann::json & object);
|
||||
std::map<std::string, std::shared_ptr<items::Item>> getItemMap() override;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif //FLIPPR_DRIVER_LAMPFACTORY_H
|
||||
24
FlippR-Driver/src/output/factories/SoundFactory.cpp
Normal file
24
FlippR-Driver/src/output/factories/SoundFactory.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* SoundFactory.cpp
|
||||
*
|
||||
* Created on: December 28, 2019
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
#include "SoundFactory.h"
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
SoundFactory::SoundFactory(nlohmann::json &object) : Factory(object)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::map<std::string, std::shared_ptr<items::Item>> SoundFactory::getItemMap()
|
||||
{
|
||||
return std::map<std::string, std::shared_ptr<items::Item>>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
29
FlippR-Driver/src/output/factories/SoundFactory.h
Normal file
29
FlippR-Driver/src/output/factories/SoundFactory.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* SoundFactory.h
|
||||
*
|
||||
* Created on: December 28, 2019
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef FLIPPR_DRIVER_SOUNDFACTORY_H
|
||||
#define FLIPPR_DRIVER_SOUNDFACTORY_H
|
||||
|
||||
#include "Factory.h"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class SoundFactory : Factory
|
||||
{
|
||||
public:
|
||||
explicit SoundFactory(nlohmann::json & object);
|
||||
std::map<std::string, std::shared_ptr<items::Item>> getItemMap() override;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif //FLIPPR_DRIVER_SOUNDFACTORY_H
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* BlockingQueue.hpp
|
||||
* config.h
|
||||
*
|
||||
* Created on: May 17, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
|
||||
Reference in New Issue
Block a user