erased some codesmells
This commit is contained in:
@@ -19,7 +19,7 @@ namespace items
|
||||
class IDriverBoardItem : public IItem
|
||||
{
|
||||
public:
|
||||
virtual ~IDriverBoardItem() = default;
|
||||
~IDriverBoardItem() override = default;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ namespace items
|
||||
|
||||
Item::Item(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name) :
|
||||
address(address),
|
||||
name(name),
|
||||
gpio_interface(output_gpio_interface)
|
||||
name(std::move(name)),
|
||||
gpio_interface(std::move(output_gpio_interface))
|
||||
{}
|
||||
|
||||
uint8_t Item::get_address()
|
||||
|
||||
@@ -26,7 +26,7 @@ class Item : public IItem
|
||||
{
|
||||
public:
|
||||
Item(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name);
|
||||
virtual ~Item() = default;
|
||||
~Item() override = default;
|
||||
|
||||
uint8_t get_address() override;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace items
|
||||
|
||||
Lamp::Lamp(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name)
|
||||
:
|
||||
Item(output_gpio_interface, address, name),
|
||||
Item(std::move(output_gpio_interface), address, std::move(name)),
|
||||
activated(false)
|
||||
{}
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ class Lamp : public Item, ILamp, IDriverBoardItem
|
||||
{
|
||||
public:
|
||||
Lamp(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name);
|
||||
virtual ~Lamp() = default;
|
||||
~Lamp() override = default;
|
||||
|
||||
void activate();
|
||||
void deactivate();
|
||||
bool is_activated();
|
||||
void activate() override;
|
||||
void deactivate() override;
|
||||
bool is_activated() override;
|
||||
|
||||
private:
|
||||
bool activated;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace items
|
||||
{
|
||||
|
||||
Solenoid::Solenoid(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time):
|
||||
Item(output_gpio_interface, address, name),
|
||||
Item(std::move(output_gpio_interface), address, std::move(name)),
|
||||
deactivation_time(deactivation_time)
|
||||
{}
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ class Solenoid : public Item, ISolenoid, IDriverBoardItem
|
||||
{
|
||||
public:
|
||||
Solenoid(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, u_int8_t address, std::string name, std::chrono::milliseconds deactivation_time);
|
||||
virtual ~Solenoid() = default;
|
||||
~Solenoid() override = default;
|
||||
|
||||
void trigger();
|
||||
void trigger() override;
|
||||
|
||||
private:
|
||||
std::chrono::milliseconds deactivation_time;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace items
|
||||
{
|
||||
|
||||
Sound::Sound(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id) :
|
||||
Item(output_gpio_interface, address, name),
|
||||
Item(std::move(output_gpio_interface), address, std::move(name)),
|
||||
deactivation_time(deactivation_time),
|
||||
id(id)
|
||||
{}
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
|
||||
public:
|
||||
Sound(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id);
|
||||
virtual ~Sound() = default;
|
||||
~Sound() override = default;
|
||||
|
||||
void play() override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user