refactored utility namespace
This commit is contained in:
@@ -10,6 +10,9 @@
|
||||
|
||||
#include "ICabinetItem.h"
|
||||
|
||||
#include "utilities/IOutputGPIOInterface.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace FlippR_Driver
|
||||
@@ -17,21 +20,22 @@ namespace FlippR_Driver
|
||||
namespace output
|
||||
{
|
||||
|
||||
class CabinetItem : public ICabinetItem
|
||||
{
|
||||
public:
|
||||
CabinetItem();
|
||||
virtual ~CabinetItem();
|
||||
virtual bool isActivated();
|
||||
virtual bool activate();
|
||||
virtual bool deactivate();
|
||||
class CabinetItem : public ICabinetItem
|
||||
{
|
||||
public:
|
||||
CabinetItem(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, int address, std::string name);
|
||||
virtual ~CabinetItem();
|
||||
|
||||
protected:
|
||||
int address;
|
||||
std::string name;
|
||||
virtual bool isActivated();
|
||||
virtual bool activate();
|
||||
virtual bool deactivate();
|
||||
|
||||
bool activated;
|
||||
};
|
||||
protected:
|
||||
int address;
|
||||
std::string name;
|
||||
|
||||
bool activated;
|
||||
};
|
||||
|
||||
} /* namespace output */
|
||||
}
|
||||
|
||||
@@ -9,15 +9,16 @@
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output {
|
||||
namespace output
|
||||
{
|
||||
|
||||
Sound::Sound() {
|
||||
// TODO Auto-generated constructor stub
|
||||
Sound::Sound(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, int address, std::string name)
|
||||
: output_gpio_interface(output_gpio_interface), address(address), name(name)
|
||||
{}
|
||||
|
||||
}
|
||||
|
||||
Sound::~Sound() {
|
||||
// TODO Auto-generated destructor stub
|
||||
void Sound::play()
|
||||
{
|
||||
this->output_gpio_interface->activate(this);
|
||||
}
|
||||
|
||||
} /* namespace output */
|
||||
|
||||
@@ -10,8 +10,11 @@
|
||||
|
||||
#include "ISound.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "utilities/IOutputGPIOInterface.h"
|
||||
|
||||
namespace FlippR_Driver
|
||||
{
|
||||
namespace output
|
||||
@@ -20,12 +23,14 @@ namespace output
|
||||
class Sound : ISound
|
||||
{
|
||||
public:
|
||||
Sound();
|
||||
virtual ~Sound();
|
||||
Sound(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, int address, std::string name);
|
||||
virtual ~Sound() = default;
|
||||
|
||||
virtual void play();
|
||||
|
||||
private:
|
||||
std::shared_ptr<IOutputGPIOInterface> output_gpio_interface;
|
||||
|
||||
int address;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user