Switchboard SDK
Loading...
Searching...
No Matches
switchboard::BoolCallbackParameter< T > Class Template Reference

BoolCallbackParameter class. A boolean parameter class that wraps a getter and a setter methods. More...

#include <BoolCallbackParameter.hpp>

Inheritance diagram for switchboard::BoolCallbackParameter< T >:
switchboard::BoolParameter switchboard::Parameter

Public Types

typedef bool(T::* BoolGetter) () const
 
typedef void(T::* BoolSetter) (bool)
 
- Public Types inherited from switchboard::Parameter
enum class  Type { Float , Bool , Int , UInt }
 

Public Member Functions

 BoolCallbackParameter (const std::string name, T *instance, BoolGetter getter, BoolSetter setter)
 BoolCallbackParameter constructor.
 
bool getValue () const override
 Gets the current value of the parameter.
 
void setValue (const bool newValue) override
 Sets a new value for the parameter.
 
- Public Member Functions inherited from switchboard::BoolParameter
 BoolParameter (const std::string name)
 BoolParameter constructor.
 
virtual ~BoolParameter ()=default
 BoolParameter destructor.
 
- Public Member Functions inherited from switchboard::Parameter
 Parameter (const Type type, const std::string name)
 
virtual ~Parameter ()=default
 Parameter destructor.
 
const std::string & getName () const
 Gets the name of the parameter.
 
Type getType () const
 Gets the type of the parameter.
 

Additional Inherited Members

- Protected Attributes inherited from switchboard::Parameter
Type type
 
std::string name
 

Detailed Description

template<typename T>
class switchboard::BoolCallbackParameter< T >

BoolCallbackParameter class. A boolean parameter class that wraps a getter and a setter methods.

Constructor & Destructor Documentation

◆ BoolCallbackParameter()

template<typename T >
switchboard::BoolCallbackParameter< T >::BoolCallbackParameter ( const std::string name,
T * instance,
BoolGetter getter,
BoolSetter setter )
inline

BoolCallbackParameter constructor.

Parameters
nameThe name of the parameter.
instancePointer to the instance that the getter and setter methods belong to.
getterThe getter method for the parameter.
setterThe setter method for the parameter.

Member Function Documentation

◆ getValue()

template<typename T >
bool switchboard::BoolCallbackParameter< T >::getValue ( ) const
inlineoverridevirtual

Gets the current value of the parameter.

Returns
The current value.

Implements switchboard::BoolParameter.

◆ setValue()

template<typename T >
void switchboard::BoolCallbackParameter< T >::setValue ( const bool newValue)
inlineoverridevirtual

Sets a new value for the parameter.

Parameters
newValueThe new value for the parameter.

Implements switchboard::BoolParameter.