Represents a set of parameters that can be loaded from a YAML file.
More...
#include <ConfigurableOrcaObject.h>
Represents a set of parameters that can be loaded from a YAML file.
◆ ParamMap
◆ Ptr
◆ ConfigurableOrcaObject()
ConfigurableOrcaObject::ConfigurableOrcaObject |
( |
const std::string & |
config_name | ) |
|
◆ ~ConfigurableOrcaObject()
ConfigurableOrcaObject::~ConfigurableOrcaObject |
( |
| ) |
|
|
virtual |
◆ addParameter() [1/2]
template<class T >
void orca::common::ConfigurableOrcaObject::addParameter |
( |
const std::string & |
param_name, |
|
|
Parameter< T > * |
param, |
|
|
ParamPolicy |
policy = ParamPolicy::Required , |
|
|
std::function< void()> |
on_loading_success = 0 |
|
) |
| |
|
inline |
Returns true if all params added with have been set.
- Returns
- true is all the required parameters are loaded properly
◆ addParameter() [2/2]
template<class T >
void orca::common::ConfigurableOrcaObject::addParameter |
( |
const std::string & |
param_name, |
|
|
T & |
param, |
|
|
ParamPolicy |
policy = ParamPolicy::Required , |
|
|
std::function< void()> |
on_loading_success = 0 |
|
) |
| |
|
inline |
◆ configureFromFile()
bool ConfigurableOrcaObject::configureFromFile |
( |
const std::string & |
yaml_url | ) |
|
Configure the task from YAML/JSON file. It must contain all the required parameters.
- Returns
- true is all the required parameters are loaded properly
◆ configureFromString()
bool ConfigurableOrcaObject::configureFromString |
( |
const std::string & |
yaml_str | ) |
|
Configure the task from YAML/JSON string. It must contain all the required parameters.
- Returns
- true is all the required parameters are loaded properly
◆ getParameter()
ParameterBase * ConfigurableOrcaObject::getParameter |
( |
const std::string & |
param_name | ) |
|
Returns a param via its name.
- Parameters
-
param_name | The name of the param (might not exist) |
- Returns
- orca::common::ParameterBase* The param pointer, nullptr if if does not exists
◆ getParameters()
◆ isConfigured()
bool ConfigurableOrcaObject::isConfigured |
( |
| ) |
const |
◆ onConfigureSuccess()
void ConfigurableOrcaObject::onConfigureSuccess |
( |
std::function< void()> |
f | ) |
|
◆ printParameters()
void ConfigurableOrcaObject::printParameters |
( |
| ) |
const |
Print all parameters to std::cout.
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/orca-controller/checkouts/latest/include/orca/common/ConfigurableOrcaObject.h
- /home/docs/checkouts/readthedocs.org/user_builds/orca-controller/checkouts/latest/src/common/ConfigurableOrcaObject.cc