Class for storing block's parameters.
More...
#include <Parameters.h>
Class for storing block's parameters.
This class can contain scalar and vector parameters of the supported types.
- See also
- core::Parameter, core::ParameterMetadata, core::ParameterType
blockfactory::core::Parameters::Parameters |
( |
| ) |
|
blockfactory::core::Parameters::~Parameters |
( |
| ) |
|
bool blockfactory::core::Parameters::existName |
( |
const ParamName & |
name | ) |
const |
Check if a parameter with a given name is stored.
- Parameters
-
name | The name of the parameter. |
- Returns
- True if the parameters exists, false otherwise.
std::vector<Parameter<bool> > blockfactory::core::Parameters::getBoolParameters |
( |
| ) |
const |
Get all the boolean parameters.
- Returns
- The boolean parameters
std::vector<Parameter<double> > blockfactory::core::Parameters::getDoubleParameters |
( |
| ) |
const |
Get all the double parameters.
- Returns
- The double parameters
std::vector<Parameter<int> > blockfactory::core::Parameters::getIntParameters |
( |
| ) |
const |
Get all the integer parameters.
- Returns
- The integer parameters
unsigned blockfactory::core::Parameters::getNumberOfParameters |
( |
| ) |
const |
Get the number of stored parameters.
- Returns
- The number of stored parameters.
template<typename T >
bool blockfactory::core::Parameters::getParameter |
( |
const ParamName & |
name, |
|
|
T & |
param |
|
) |
| const |
Get a scalar parameter.
- Template Parameters
-
The | type of the output argument |
- Parameters
-
| name | The name of the parameter. |
[out] | param | The variable where the parameter value will be stored. Data get cast internally, even for string to numeric types. |
- Returns
- True for success, false otherwise.
template<typename T >
bool blockfactory::core::Parameters::getParameter |
( |
const ParamName & |
name, |
|
|
std::vector< T > & |
param |
|
) |
| const |
Get a vector parameter.
- Template Parameters
-
The | type of the output argument |
- Parameters
-
| name | The name of the parameter. |
[out] | param | The variable where the parameter value will be stored. Data get cast internally, even for string to numeric types. |
- Returns
- True for success, false otherwise.
Get the metadata associated to a stored parameter.
- Parameters
-
name | The name of the parameter. |
- Returns
- The metadata associate with the parameter for success, a metadata with a stored name
dummy
otherwise.
- Todo:
- Use std::optional as soon as we switch to C++17
Get the index of a stored parameter from its name.
- Parameters
-
name | The name of the parameter. |
- Returns
- The index if the parameter exists, core::PARAM_INVALID_INDEX otherwise.
Get the name of a stored parameter from its index.
- Parameters
-
index | The index of the parameter. |
- Returns
- The name if the parameter exists, core::PARAM_INVALID_NAME otherwise.
std::vector<Parameter<std::string> > blockfactory::core::Parameters::getStringParameters |
( |
| ) |
const |
Get all the string parameters.
- Returns
- The string parameters
Store a scalar parameter.
- Template Parameters
-
The | type of the parameter to store. Despite this, the parameter get cast accordingly to its metadata. |
- Parameters
-
param | The value of the scalar parameter to store. |
paramMetadata | The metadata associated to the parameter to store. |
- Returns
- True for success, false otherwise.
Store a vector parameter.
- Template Parameters
-
The | type of the parameter to store. Despite this, the parameter get cast accordingly to its metadata. |
- Parameters
-
param | The value of the vector parameter to store. |
paramMetadata | The metadata associated to the parameter to store. |
- Returns
- True for success, false otherwise.
template<typename T >
bool blockfactory::core::Parameters::storeParameter |
( |
const Parameter< T > & |
parameter | ) |
|
Store a parameter.
- Template Parameters
-
The | type of the parameter to store. |
- Parameters
-
parameter | The parameter object to store. |
- Returns
- True for success, false otherwise.
- See also
- wbt::Parameter
The documentation for this class was generated from the following file:
- /home/travis/build/robotology/blockfactory/sources/Core/include/BlockFactory/Core/Parameters.h