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

IntCallbackParameter class. A int parameter class that wraps a getter and a setter methods. More...

#include <IntCallbackParameter.hpp>

Inheritance diagram for switchboard::IntCallbackParameter< T >:
switchboard::IntParameter switchboard::Parameter

Public Types

typedef int(T::*) IntGetter() const
 
typedef void(T::*) IntSetter(int)
 
- Public Types inherited from switchboard::Parameter
enum class  Type {
  Float , Bool , Int , UInt ,
  String
}
 

Public Member Functions

 IntCallbackParameter (const std::string name, T *instance, IntGetter getter, IntSetter setter, const int minimumValue, const int maximumValue)
 IntCallbackParameter constructor.
 
int getValue () const override
 Gets the current value of the parameter.
 
void setValue (const int newValue) override
 Sets a new value for the parameter.
 
int getMinimumValue () const override
 Gets the minimum value for the parameter.
 
int getMaximumValue () const override
 Gets the maximum value for the parameter.
 
- Public Member Functions inherited from switchboard::IntParameter
 IntParameter (const std::string &id, const std::string &name, const std::string &description)
 IntParameter constructor.
 
virtual ~IntParameter ()=default
 IntParameter destructor.
 
void setValue (std::any newValue) override
 Sets the value of the parameter.
 
- Public Member Functions inherited from switchboard::Parameter
 Parameter (const Type type, const std::string &id, const std::string &name, const std::string &description)
 Construct a new Parameter object.
 
virtual ~Parameter ()=default
 Parameter destructor.
 
Type getType () const
 Gets the type of the parameter.
 
const std::string & getID () const
 Gets the unique identifier of the parameter.
 
const std::string & getName () const
 Gets the name of the parameter.
 
const std::string & getDescription () const
 Gets the description of the parameter.
 

Additional Inherited Members

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

Detailed Description

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

IntCallbackParameter class. A int parameter class that wraps a getter and a setter methods.

Constructor & Destructor Documentation

◆ IntCallbackParameter()

template<typename T >
switchboard::IntCallbackParameter< T >::IntCallbackParameter ( const std::string name,
T * instance,
IntGetter getter,
IntSetter setter,
const int minimumValue,
const int maximumValue )
inline

IntCallbackParameter 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.
minimumValueMinimum value for the parameter.
maximumValueMaximum value for the parameter.

Member Function Documentation

◆ getMaximumValue()

template<typename T >
int switchboard::IntCallbackParameter< T >::getMaximumValue ( ) const
inlineoverridevirtual

Gets the maximum value for the parameter.

Returns
The maximum value.

Implements switchboard::IntParameter.

◆ getMinimumValue()

template<typename T >
int switchboard::IntCallbackParameter< T >::getMinimumValue ( ) const
inlineoverridevirtual

Gets the minimum value for the parameter.

Returns
The minimum value.

Implements switchboard::IntParameter.

◆ getValue()

template<typename T >
int switchboard::IntCallbackParameter< T >::getValue ( ) const
inlineoverridevirtual

Gets the current value of the parameter.

Returns
The current value.

Implements switchboard::IntParameter.

◆ setValue()

template<typename T >
void switchboard::IntCallbackParameter< T >::setValue ( const int newValue)
inlineoverridevirtual

Sets a new value for the parameter.

Parameters
newValueThe new value for the parameter.

Implements switchboard::IntParameter.