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

BoolPointerParameter class. A boolean parameter class that wraps an external bool variable. More...

#include <BoolPointerParameter.hpp>

Inheritance diagram for switchboard::BoolPointerParameter:
switchboard::BoolParameter

Public Member Functions

 BoolPointerParameter (const std::string &id, const std::string &name, const std::string &description, bool *valuePointer)
 BoolPointerParameter constructor with a bool pointer.
 
 BoolPointerParameter (const std::string &id, const std::string &name, const std::string &description, std::atomic< bool > *atomicValuePointer)
 BoolPointerParameter constructor with an atomic bool pointer.
 
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 &id, const std::string &name, const std::string &description)
 BoolParameter constructor.
 
virtual ~BoolParameter ()=default
 BoolParameter destructor.
 
void setValue (std::any newValue) override
 
std::any getAnyValue () override
 

Detailed Description

BoolPointerParameter class. A boolean parameter class that wraps an external bool variable.

Constructor & Destructor Documentation

◆ BoolPointerParameter() [1/2]

switchboard::BoolPointerParameter::BoolPointerParameter ( const std::string & id,
const std::string & name,
const std::string & description,
bool * valuePointer )

BoolPointerParameter constructor with a bool pointer.

Parameters
idThe unique identifier of the parameter.
nameThe name of the parameter.
descriptionThe description of the parameter.
valuePointerPointer to the boolean value.

◆ BoolPointerParameter() [2/2]

switchboard::BoolPointerParameter::BoolPointerParameter ( const std::string & id,
const std::string & name,
const std::string & description,
std::atomic< bool > * atomicValuePointer )

BoolPointerParameter constructor with an atomic bool pointer.

Parameters
nameThe name of the parameter.
atomicValuePointerAtomic pointer to the boolean value.

Member Function Documentation

◆ getValue()

bool switchboard::BoolPointerParameter::getValue ( ) const
overridevirtual

Gets the current value of the parameter.

Returns
The current value.

Implements switchboard::BoolParameter.

◆ setValue()

void switchboard::BoolPointerParameter::setValue ( const bool newValue)
overridevirtual

Sets a new value for the parameter.

Parameters
newValueThe new value for the parameter.

Implements switchboard::BoolParameter.