11 inline std::string
findType(
const YAML::Node& n)
16 if(c.first.as<std::string>() ==
"type")
17 return c.second.as<std::string>();
34 YAML::Node node = YAML::Load(s);
39 <<
getName() <<
" of type " <<
typeid(T).name() <<
"::Ptr" 40 <<
"\nConfig provided : \n" << s );
42 LOG_DEBUG <<
"Param " <<
getName() <<
" is of type " << type_name;
46 LOG_DEBUG <<
"Param " <<
getName() <<
" is already set, just configuring " << type_name;
47 return this->
get()->configureFromString(s);
55 LOG_DEBUG <<
"Param " <<
getName() <<
" created class of type " << type_name <<
", now configuring it if it has params itself.";
57 if(!task_base->configureFromString(s))
60 this->
set( std::dynamic_pointer_cast<T>( task_base ));
66 std::cout <<
getName() <<
" [ " <<
typeid(T).name() <<
"::Ptr" <<
'\n';
73 std::shared_ptr<T>&
get()
77 }
catch (std::exception& e) {
81 const std::shared_ptr<T>&
get()
const 85 }
catch (std::exception& e) {
const std::string & getName() const
Definition: ParameterBase.h:50
This class holds the data for a parameter of any type.
Definition: ParameterData.h:14
std::shared_ptr< ConfigurableOrcaObject > createPtr(const std::string &instance_name, const std::string &class_name)
Definition: Factory.h:21
void orca_throw(const std::string &arg)
Definition: Utils.h:153
static Factory * Instance()
Definition: Factory.h:16
bool onLoadFromString(const std::string &s)
Definition: ParameterSharedPtr.h:32
Parameter(const std::shared_ptr< T > &t)
Definition: ParameterSharedPtr.h:28
T & get()
Definition: Parameter.h:149
std::string findType(const YAML::Node &n)
Definition: ParameterSharedPtr.h:11
Parameter< std::shared_ptr< T > > & operator=(std::shared_ptr< T2 > val)
Definition: ParameterSharedPtr.h:90
Definition: CartesianAccelerationPID.h:44
Parameter()
Definition: ParameterSharedPtr.h:27
ParameterBase is the public interface to any parameter.
Definition: ParameterBase.h:21
This class holds the conversion from a string (YAML string) to the data type.
Definition: Parameter.h:113
void print() const
Definition: ParameterSharedPtr.h:64
bool isSet() const
Definition: ParameterSharedPtr.h:69
bool isSet() const
Definition: Parameter.h:144