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

StringCallbackParameter class. A String parameter class that wraps a getter and a setter methods. More...

#include <StringCallbackParameter.hpp>

Inheritance diagram for switchboard::StringCallbackParameter< T >:
switchboard::StringParameter

Public Types

typedef std::string(T::* StringGetter) () const
 
typedef void(T::* StringSetter) (std::string)
 

Public Member Functions

 StringCallbackParameter (const std::string &id, const std::string &name, const std::string &description, T *instance, StringGetter getter, StringSetter setter)
 StringCallbackParameter constructor.
 
std::string getValue () const override
 Gets the current value of the parameter.
 
void setValue (const std::string newValue) override
 Sets a new value for the parameter.
 
- Public Member Functions inherited from switchboard::StringParameter
 StringParameter (const std::string &id, const std::string &name, const std::string &description)
 StringParameter constructor.
 
virtual ~StringParameter ()=default
 StringParameter destructor.
 
void setValue (std::any newValue) override
 
std::any getAnyValue () override
 

Detailed Description

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

StringCallbackParameter class. A String parameter class that wraps a getter and a setter methods.

Constructor & Destructor Documentation

◆ StringCallbackParameter()

template<typename T>
switchboard::StringCallbackParameter< T >::StringCallbackParameter ( const std::string & id,
const std::string & name,
const std::string & description,
T * instance,
StringGetter getter,
StringSetter setter )
inline

StringCallbackParameter constructor.

Parameters
idThe unique identifier of the parameter.
nameThe name of the parameter.
descriptionThe description 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>
std::string switchboard::StringCallbackParameter< T >::getValue ( ) const
inlineoverridevirtual

Gets the current value of the parameter.

Returns
The current value.

Implements switchboard::StringParameter.

◆ setValue()

template<typename T>
void switchboard::StringCallbackParameter< T >::setValue ( const std::string newValue)
inlineoverridevirtual

Sets a new value for the parameter.

Parameters
newValueThe new value for the parameter.

Implements switchboard::StringParameter.