SpaIot Library
SpaIot::HardwareSettings

This class represents the hardware settings of a SpaIot device. More...

Public Member Functions

 HardwareSettings ()
 The default constructor.
 
virtual ~HardwareSettings ()
 Destructor.
 
 HardwareSettings (const BusSettings &bus, const std::map< int, LedSettings > &leds, const std::map< int, ButtonSettings > &buttons)
 The constructor for the HardwareSettings class takes three parameters. More...
 
 HardwareSettings (const HardwareSettings &other)
 Copy Constructor.
 
 HardwareSettings (HardwareSettings &&other)
 Move Constructor after the move, other is null, other.clear() must be called if it is to be used again.
 
HardwareSettingsoperator= (const HardwareSettings &other)
 Sets the HardwareSettings object to be equal to other.
 
HardwareSettingsoperator= (HardwareSettings &&other)
 Move assignment after the move, other is null, other.clear() must be called if it is to be used again.
 
void clear ()
 Clears the HardwareSettings object After the call to this function, the HardwareSettings object is the same as one that has been default constructed.
 
bool isNull () const
 Returns true if the object is null (i.e. it has not been initialized, d_ptr is null)
 
bool isEmpty () const
 Checks if all attributes are set to their default values (same as the default constructor)
 
bool operator== (const HardwareSettings &other) const
 Checks if the two objects are equal.
 
bool operator!= (const HardwareSettings &other) const
 Checks if the two objects are not equal.
 
const BusSettingsbus () const
 Returns the bus settings.
 
const std::map< int, LedSettings > & leds () const
 Returns the led settings as a map.
 
const std::map< int, ButtonSettings > & buttons () const
 Returns the button settings as a map.
 
void print (Print &out) const
 Prints the object to the Print interface. More...
 

Static Public Member Functions

static bool addToRegister (const String &name, const HardwareSettings &settings)
 Adds a HardwareSettings object to the register. More...
 
static const HardwareSettingsgetFromRegister (const String &name)
 Returns the HardwareSettings object from the register. More...
 
static bool registerContains (const String &name)
 Returns true if the register contains the name. More...
 

Detailed Description

This class represents the hardware settings of a SpaIot device.

This class is copyable and movable.

Constructor & Destructor Documentation

◆ HardwareSettings()

SpaIot::HardwareSettings::HardwareSettings ( const BusSettings bus,
const std::map< int, LedSettings > &  leds,
const std::map< int, ButtonSettings > &  buttons 
)

The constructor for the HardwareSettings class takes three parameters.

Parameters
busthe bus settings
ledsthe led settings
buttonsthe button settings

Member Function Documentation

◆ addToRegister()

static bool SpaIot::HardwareSettings::addToRegister ( const String &  name,
const HardwareSettings settings 
)
static

Adds a HardwareSettings object to the register.

Parameters
namethe registered name designating the HardwareSettings object in the register
settingsthe HardwareSettings object to be added to the register
Returns
true if the object has been added to the register, false if the name is already in the register

◆ getFromRegister()

static const HardwareSettings& SpaIot::HardwareSettings::getFromRegister ( const String &  name)
static

Returns the HardwareSettings object from the register.

Parameters
namethe registered name designating the HardwareSettings object in the register

You must check if the register contains the name with registerContains() before calling this function

Returns
the HardwareSettings object from the register

◆ print()

void SpaIot::HardwareSettings::print ( Print &  out) const

Prints the object to the Print interface.

Parameters
outthe Print interface, for example Serial

◆ registerContains()

static bool SpaIot::HardwareSettings::registerContains ( const String &  name)
static

Returns true if the register contains the name.

Parameters
namethe registered name designating the HardwareSettings object in the register
Returns
true if the register contains the name