Switchboard SDK
Loading...
Searching...
No Matches
switchboard::FloatParameter Class Referenceabstract

Float parameter abstract class. Intended to be subclassed. More...

#include <FloatParameter.hpp>

Inheritance diagram for switchboard::FloatParameter:
switchboard::Parameter switchboard::FloatCallbackParameter< T > switchboard::FloatPointerParameter switchboard::FloatStoredParameter

Public Member Functions

 FloatParameter (const std::string &id, const std::string &name, const std::string &description)
 FloatParameter constructor.
 
virtual ~FloatParameter ()=default
 FloatParameter destructor.
 
virtual float getValue () const =0
 Gets the current value of the parameter.
 
virtual void setValue (const float newValue)=0
 Sets a new value for the parameter.
 
virtual float getMinimumValue () const =0
 Gets the minimum value for the parameter.
 
virtual float getMaximumValue () const =0
 Gets the maximum value for the parameter.
 
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

- Public Types inherited from switchboard::Parameter
enum class  Type {
  Float , Bool , Int , UInt ,
  String
}
 
- Protected Attributes inherited from switchboard::Parameter
Type type
 
std::string id
 
std::string name
 
std::string description
 

Detailed Description

Float parameter abstract class. Intended to be subclassed.

Constructor & Destructor Documentation

◆ FloatParameter()

switchboard::FloatParameter::FloatParameter ( const std::string & id,
const std::string & name,
const std::string & description )

FloatParameter constructor.

Parameters
idThe unique identifier of the parameter.
nameThe name of the parameter.
descriptionThe description of the parameter.

Member Function Documentation

◆ getMaximumValue()

virtual float switchboard::FloatParameter::getMaximumValue ( ) const
pure virtual

Gets the maximum value for the parameter.

Returns
The maximum value.

Implemented in switchboard::FloatCallbackParameter< T >, switchboard::FloatPointerParameter, and switchboard::FloatStoredParameter.

◆ getMinimumValue()

virtual float switchboard::FloatParameter::getMinimumValue ( ) const
pure virtual

Gets the minimum value for the parameter.

Returns
The minimum value.

Implemented in switchboard::FloatCallbackParameter< T >, switchboard::FloatPointerParameter, and switchboard::FloatStoredParameter.

◆ getValue()

virtual float switchboard::FloatParameter::getValue ( ) const
pure virtual

Gets the current value of the parameter.

Returns
The current value.

Implemented in switchboard::FloatCallbackParameter< T >, switchboard::FloatPointerParameter, and switchboard::FloatStoredParameter.

◆ setValue() [1/2]

virtual void switchboard::FloatParameter::setValue ( const float newValue)
pure virtual

Sets a new value for the parameter.

Parameters
newValueThe new value for the parameter.

Implemented in switchboard::FloatCallbackParameter< T >, switchboard::FloatPointerParameter, and switchboard::FloatStoredParameter.

◆ setValue() [2/2]

void switchboard::FloatParameter::setValue ( std::any newValue)
overridevirtual

Sets the value of the parameter.

Parameters
newValueThe new value for the parameter.

Implements switchboard::Parameter.