namespace refactored
This commit is contained in:
@@ -11,23 +11,28 @@
|
||||
#include "ICabinetItem.h"
|
||||
|
||||
#include <string>
|
||||
namespace output {
|
||||
|
||||
class CabinetItem : public ICabinetItem {
|
||||
public:
|
||||
CabinetItem();
|
||||
virtual ~CabinetItem();
|
||||
virtual bool isActivated();
|
||||
virtual bool activate();
|
||||
virtual bool deactivate();
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
protected:
|
||||
int address;
|
||||
std::string name;
|
||||
class CabinetItem : public ICabinetItem
|
||||
{
|
||||
public:
|
||||
CabinetItem();
|
||||
virtual ~CabinetItem();
|
||||
virtual bool isActivated();
|
||||
virtual bool activate();
|
||||
virtual bool deactivate();
|
||||
|
||||
bool activated;
|
||||
};
|
||||
protected:
|
||||
int address;
|
||||
std::string name;
|
||||
|
||||
bool activated;
|
||||
};
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -6,16 +6,21 @@
|
||||
*/
|
||||
|
||||
#include "Display.h"
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
namespace output {
|
||||
Display::Display()
|
||||
{
|
||||
// TODO Auto-generated constructor stub
|
||||
|
||||
Display::Display() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Display::~Display() {
|
||||
// TODO Auto-generated destructor stub
|
||||
}
|
||||
Display::~Display()
|
||||
{
|
||||
// TODO Auto-generated destructor stub
|
||||
}
|
||||
|
||||
} /* namespace output */
|
||||
}
|
||||
@@ -10,24 +10,32 @@
|
||||
|
||||
#include "IDisplay.h"
|
||||
|
||||
namespace output {
|
||||
#include <array>
|
||||
|
||||
class Display: public IDisplay {
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
template <int DigitCount>
|
||||
class Display : public IDisplay
|
||||
{
|
||||
public:
|
||||
Display();
|
||||
virtual ~Display();
|
||||
Display();
|
||||
virtual ~Display();
|
||||
|
||||
virtual int getID();
|
||||
virtual void write();
|
||||
virtual int getID();
|
||||
|
||||
virtual void write_score(int score);
|
||||
virtual void write_content(std::array<char, DigitCount> content);
|
||||
|
||||
public:
|
||||
int score;
|
||||
std::array<char, DigitCount> content;
|
||||
|
||||
private:
|
||||
int address;
|
||||
int id;
|
||||
int address;
|
||||
int id;
|
||||
};
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -7,17 +7,21 @@
|
||||
|
||||
#include "DisplayController.h"
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
DisplayController::DisplayController() {
|
||||
// TODO Auto-generated constructor stub
|
||||
DisplayController::DisplayController()
|
||||
{
|
||||
// TODO Auto-generated constructor stub
|
||||
|
||||
}
|
||||
|
||||
DisplayController::~DisplayController() {
|
||||
// TODO Auto-generated destructor stub
|
||||
DisplayController::~DisplayController()
|
||||
{
|
||||
// TODO Auto-generated destructor stub
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,17 +14,25 @@
|
||||
#include "IDisplay.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class DisplayController: public IDisplayController {
|
||||
class DisplayController : public IDisplayController
|
||||
{
|
||||
public:
|
||||
DisplayController();
|
||||
virtual ~DisplayController();
|
||||
|
||||
private:
|
||||
std::array<std::unique_ptr<IDisplay>, NUMBER_OF_DISPLAYS> displays;
|
||||
void cycleDisplays();
|
||||
|
||||
private:
|
||||
std::vector<std::shared_ptr<IDisplay>> displays;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -9,6 +9,11 @@
|
||||
#define _SRC_OUTPUT_ICABINETITEM_H_
|
||||
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class ICabinetItem
|
||||
{
|
||||
virtual ~ICabinetItem();
|
||||
@@ -17,5 +22,7 @@ class ICabinetItem
|
||||
virtual bool deactivate() = 0;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -8,9 +8,13 @@
|
||||
#ifndef _SRC_OUTPUT_IDISPLAY_H_
|
||||
#define _SRC_OUTPUT_IDISPLAY_H_
|
||||
|
||||
namespace output {
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class IDisplay {
|
||||
class IDisplay
|
||||
{
|
||||
public:
|
||||
IDisplay();
|
||||
virtual ~IDisplay();
|
||||
@@ -21,5 +25,5 @@ public:
|
||||
};
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -7,15 +7,18 @@
|
||||
|
||||
#ifndef _SRC_OUTPUT_IDISPLAYCONTROLLER_H_
|
||||
#define _SRC_OUTPUT_IDISPLAYCONTROLLER_H_
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
namespace output {
|
||||
|
||||
class IDisplayController {
|
||||
class IDisplayController
|
||||
{
|
||||
public:
|
||||
IDisplayController();
|
||||
virtual ~IDisplayController();
|
||||
};
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -8,10 +8,17 @@
|
||||
#ifndef _SRC_OUTPUT_ILAMP_H_
|
||||
#define _SRC_OUTPUT_ILAMP_H_
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class ILamp
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -8,14 +8,18 @@
|
||||
#ifndef _SRC_OUTPUT_IOUTPUTDRIVER_H_
|
||||
#define _SRC_OUTPUT_IOUTPUTDRIVER_H_
|
||||
|
||||
namespace output {
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class IOutputDriver {
|
||||
class IOutputDriver
|
||||
{
|
||||
public:
|
||||
IOutputDriver();
|
||||
virtual ~IOutputDriver();
|
||||
};
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -8,11 +8,17 @@
|
||||
#ifndef _SRC_OUTPUT_ISOLENOID_H_
|
||||
#define _SRC_OUTPUT_ISOLENOID_H_
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class ISolenoid
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -8,9 +8,13 @@
|
||||
#ifndef _SRC_OUTPUT_ISOUND_H_
|
||||
#define _SRC_OUTPUT_ISOUND_H_
|
||||
|
||||
namespace output {
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class ISound {
|
||||
class ISound
|
||||
{
|
||||
public:
|
||||
ISound();
|
||||
virtual ~ISound();
|
||||
@@ -19,5 +23,5 @@ public:
|
||||
};
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -7,15 +7,21 @@
|
||||
|
||||
#include "Lamp.h"
|
||||
|
||||
namespace output {
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
Lamp::Lamp() {
|
||||
// TODO Auto-generated constructor stub
|
||||
Lamp::Lamp()
|
||||
{
|
||||
// TODO Auto-generated constructor stub
|
||||
|
||||
}
|
||||
|
||||
Lamp::~Lamp() {
|
||||
// TODO Auto-generated destructor stub
|
||||
Lamp::~Lamp()
|
||||
{
|
||||
// TODO Auto-generated destructor stub
|
||||
}
|
||||
|
||||
} /* namespace output */
|
||||
}
|
||||
@@ -10,14 +10,18 @@
|
||||
|
||||
#include "CabinetItem.h"
|
||||
|
||||
namespace output {
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class Lamp: public CabinetItem {
|
||||
class Lamp : public CabinetItem
|
||||
{
|
||||
public:
|
||||
Lamp();
|
||||
virtual ~Lamp();
|
||||
};
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -7,15 +7,21 @@
|
||||
|
||||
#include "OutputDriver.h"
|
||||
|
||||
namespace output {
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
OutputDriver::OutputDriver() {
|
||||
// TODO Auto-generated constructor stub
|
||||
OutputDriver::OutputDriver()
|
||||
{
|
||||
// TODO Auto-generated constructor stub
|
||||
|
||||
}
|
||||
|
||||
OutputDriver::~OutputDriver() {
|
||||
// TODO Auto-generated destructor stub
|
||||
OutputDriver::~OutputDriver()
|
||||
{
|
||||
// TODO Auto-generated destructor stub
|
||||
}
|
||||
|
||||
} /* namespace output */
|
||||
}
|
||||
@@ -17,9 +17,13 @@
|
||||
#include "IDisplay.h"
|
||||
#include "ISound.h"
|
||||
|
||||
namespace output {
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class OutputDriver: public IOutputDriver {
|
||||
class OutputDriver : public IOutputDriver
|
||||
{
|
||||
public:
|
||||
OutputDriver();
|
||||
virtual ~OutputDriver();
|
||||
@@ -39,5 +43,5 @@ private:
|
||||
};
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
}
|
||||
#endif
|
||||
13
FlippR-Driver/src/output/OutputDriverFactory.cpp
Normal file
13
FlippR-Driver/src/output/OutputDriverFactory.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// Created by rhetenor on 04.10.18.
|
||||
//
|
||||
|
||||
#include "OutputDriverFactory.h"
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
20
FlippR-Driver/src/output/OutputDriverFactory.h
Normal file
20
FlippR-Driver/src/output/OutputDriverFactory.h
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Created by rhetenor on 04.10.18.
|
||||
//
|
||||
|
||||
#ifndef FLIPPR_DRIVER_OUTPUTDRIVERFACTORY_H
|
||||
#define FLIPPR_DRIVER_OUTPUTDRIVERFACTORY_H
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
class OutputDriverFactory
|
||||
{
|
||||
public:
|
||||
std::shared_ptr <OutputDriver> getOutputDriver(std::ifstream &output_gpio_config, std::ifstream &output_config);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif //FLIPPR_DRIVER_OUTPUTDRIVERFACTORY_H
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "Solenoid.h"
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output {
|
||||
|
||||
Solenoid::Solenoid() {
|
||||
@@ -19,3 +21,4 @@ Solenoid::~Solenoid() {
|
||||
}
|
||||
|
||||
} /* namespace output */
|
||||
}
|
||||
|
||||
@@ -10,14 +10,18 @@
|
||||
|
||||
#include "CabinetItem.h"
|
||||
|
||||
namespace output {
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class Solenoid: public CabinetItem {
|
||||
class Solenoid : public CabinetItem
|
||||
{
|
||||
public:
|
||||
Solenoid();
|
||||
virtual ~Solenoid();
|
||||
};
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "Sound.h"
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output {
|
||||
|
||||
Sound::Sound() {
|
||||
@@ -19,3 +21,4 @@ Sound::~Sound() {
|
||||
}
|
||||
|
||||
} /* namespace output */
|
||||
}
|
||||
@@ -11,9 +11,14 @@
|
||||
#include "ISound.h"
|
||||
|
||||
#include <string>
|
||||
namespace output {
|
||||
|
||||
class Sound : ISound {
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
|
||||
class Sound : ISound
|
||||
{
|
||||
public:
|
||||
Sound();
|
||||
virtual ~Sound();
|
||||
@@ -26,5 +31,5 @@ private:
|
||||
};
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user