Switchboard Extension SDK
Loading...
Searching...
No Matches
Parameter.hpp
1//
2// Parameter.hpp
3// SwitchboardSDK
4//
5// Created by Balazs Kiss on 2023. 05. 25..
6//
7
8#pragma once
9
10#include <switchboard_core/SwitchboardCore.hpp>
11
12#include <any>
13#include <string>
14
15namespace switchboard {
16
20class Parameter {
21public:
22 enum class Type { Float, Bool, Int, UInt, String };
23
32 Parameter(const Type type, const std::string& id, const std::string& name, const std::string& description);
33
37 virtual ~Parameter() = default;
38
44 Type getType() const;
45
51 const std::string& getID() const;
52
58 const std::string& getName() const;
59
65 const std::string& getDescription() const;
66
72 virtual void setValue(std::any newValue) = 0;
73
79 virtual std::any getAnyValue() = 0;
80
81protected:
82 Type type;
83 std::string id;
84 std::string name;
85 std::string description;
86};
87
88}
Parameter(const Type type, const std::string &id, const std::string &name, const std::string &description)
Construct a new Parameter object.
virtual std::any getAnyValue()=0
Gets the value of the parameter.
virtual void setValue(std::any newValue)=0
Sets the value of the parameter.
const std::string & getName() const
Gets the name of the parameter.
Type getType() const
Gets the type of the parameter.
const std::string & getDescription() const
Gets the description of the parameter.
const std::string & getID() const
Gets the unique identifier of the parameter.
virtual ~Parameter()=default
Parameter destructor.