refactored outputdriver

This commit is contained in:
Jonas Zeunert
2018-11-20 23:32:45 +01:00
parent 0c92981a99
commit df253867a5

View File

@@ -13,7 +13,8 @@
#include <map>
#include <memory>
#include "ICabinetItem.h"
#include "ILamp.h"
#include "ISolenoid.h"
#include "IDisplay.h"
#include "ISound.h"
@@ -25,20 +26,23 @@ namespace output
class OutputDriver : public IOutputDriver
{
public:
OutputDriver(std::map<std::string, std::shared_ptr<IOutputtItem>> cabinet_items, std::map<char, std::shared_ptr<IDisplay>> displays, std::map<std::string, std::shared_ptr<ISound>> sounds);
OutputDriver(std::map<std::string, std::shared_ptr<ISolenoid>> solenoids, std::map<std::string, std::shared_ptr<ILamp>> lamps, std::map<char, std::shared_ptr<IDisplay>> displays, std::map<std::string, std::shared_ptr<ISound>> sounds);
virtual ~OutputDriver() = default;
std::vector<std::shared_ptr<IOutputtItem>> get_cabinet_items();
std::vector<std::shared_ptr<ILamp>> get_lamps();
std::vector<std::shared_ptr<ISolenoid>> get_solenoids();
std::vector<std::shared_ptr<ISound>> get_sounds();
std::vector<std::shared_ptr<IDisplay>> get_displays();
std::shared_ptr<IOutputtItem> get_cabinet_item(std::string name);
std::shared_ptr<ILamp> get_lamp(std::string name);
std::shared_ptr<ISolenoid> get_solenoid(std::string name);
std::shared_ptr<ISound> get_sound(std::string name);
std::shared_ptr<IDisplay> get_display(char number);
private:
std::map<std::string, std::shared_ptr<IOutputtItem>> cabinet_items;
std::map<std::string, std::shared_ptr<ILamp>> lamps;
std::map<std::string, std::shared_ptr<ISolenoid>> solenoids;
std::map<char, std::shared_ptr<IDisplay>> displays;
std::map<std::string, std::shared_ptr<ISound>> sounds;
};