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.
ConfigurableOrcaObject::ConfigurableOrcaObject |
( |
const std::string & |
config_name | ) |
|
ConfigurableOrcaObject::~ConfigurableOrcaObject |
( |
| ) |
|
|
virtual |
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
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 |
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
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
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
bool ConfigurableOrcaObject::isConfigured |
( |
| ) |
const |
void ConfigurableOrcaObject::onConfigureSuccess |
( |
std::function< void()> |
f | ) |
|
void ConfigurableOrcaObject::printParameters |
( |
| ) |
const |
Print all parameters to std::cout.
The documentation for this class was generated from the following files: