Switchboard SDK
Loading...
Searching...
No Matches
switchboard::FloatPointerParameter Class Reference

FloatPointerParameter class. A float parameter class that wraps an external float variable. More...

#include <FloatPointerParameter.hpp>

Inheritance diagram for switchboard::FloatPointerParameter:
switchboard::FloatParameter switchboard::Parameter

Public Member Functions

 FloatPointerParameter (const std::string &id, const std::string &name, const std::string &description, float *valuePointer, const float minimumValue, const float maximumValue)
 FloatPointerParameter constructor with a float pointer.
 
 FloatPointerParameter (const std::string &id, const std::string &name, const std::string &description, std::atomic< float > *atomicValuePointer, const float minimumValue, const float maximumValue)
 FloatPointerParameter constructor with an atomic float pointer.
 
float getValue () const override
 Gets the current value of the parameter.
 
void setValue (const float newValue) override
 Sets a new value for the parameter.
 
float getMinimumValue () const override
 Gets the minimum value for the parameter.
 
float getMaximumValue () const override
 Gets the maximum value for the parameter.
 
- Public Member Functions inherited from switchboard::FloatParameter
 FloatParameter (const std::string &id, const std::string &name, const std::string &description)
 FloatParameter constructor.
 
virtual ~FloatParameter ()=default
 FloatParameter 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

- 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

FloatPointerParameter class. A float parameter class that wraps an external float variable.

Constructor & Destructor Documentation

◆ FloatPointerParameter() [1/2]

switchboard::FloatPointerParameter::FloatPointerParameter ( const std::string & id,
const std::string & name,
const std::string & description,
float * valuePointer,
const float minimumValue,
const float maximumValue )

FloatPointerParameter constructor with a float pointer.

Parameters
idThe unique identifier of the parameter.
nameThe name of the parameter.
descriptionThe description of the parameter.
valuePointerPointer to the float value.
minimumValueMinimum value for the parameter.
maximumValueMaximum value for the parameter.

◆ FloatPointerParameter() [2/2]

switchboard::FloatPointerParameter::FloatPointerParameter ( const std::string & id,
const std::string & name,
const std::string & description,
std::atomic< float > * atomicValuePointer,
const float minimumValue,
const float maximumValue )

FloatPointerParameter constructor with an atomic float pointer.

Parameters
nameThe name of the parameter.
atomicValuePointerAtomic pointer to the float value.
minimumValueMinimum value for the parameter.
maximumValueMaximum value for the parameter.

Member Function Documentation

◆ getMaximumValue()

float switchboard::FloatPointerParameter::getMaximumValue ( ) const
overridevirtual

Gets the maximum value for the parameter.

Returns
The maximum value.

Implements switchboard::FloatParameter.

◆ getMinimumValue()

float switchboard::FloatPointerParameter::getMinimumValue ( ) const
overridevirtual

Gets the minimum value for the parameter.

Returns
The minimum value.

Implements switchboard::FloatParameter.

◆ getValue()

float switchboard::FloatPointerParameter::getValue ( ) const
overridevirtual

Gets the current value of the parameter.

Returns
The current value.

Implements switchboard::FloatParameter.

◆ setValue()

void switchboard::FloatPointerParameter::setValue ( const float newValue)
overridevirtual

Sets a new value for the parameter.

Parameters
newValueThe new value for the parameter.

Implements switchboard::FloatParameter.