Fawkes API  Fawkes Development Version
fawkes::ExecutionTimeEstimator::Property< T > Class Template Reference

A configurable property that is skill-specific and may have a default value. More...

#include <execution_time_estimator.h>

Public Member Functions

 Property (fawkes::Configuration *config, const std::string &path, const std::string &property, const std::optional< T > &default_value=std::nullopt)
 Constructor. More...
 
get_property (const std::string &key) const
 Get the property falue for a given skill. More...
 
get_default_value () const
 Get the default value if it is set, otherwise throw an exception. More...
 

Public Attributes

std::map< std::string, T > property_entries
 Mapping from skill entry id to property value. More...
 

Detailed Description

template<typename T>
class fawkes::ExecutionTimeEstimator::Property< T >

A configurable property that is skill-specific and may have a default value.

Definition at line 55 of file execution_time_estimator.h.

Constructor & Destructor Documentation

◆ Property()

template<typename T >
fawkes::ExecutionTimeEstimator::Property< T >::Property ( fawkes::Configuration config,
const std::string &  path,
const std::string &  property,
const std::optional< T > &  default_value = std::nullopt 
)

Constructor.

Create a property by reading all values from the config.

Parameters
configConfig to read form
pathPath under which the config values can be found
propertyProperty name
default_valueDefault value in case values are not specified

Definition at line 244 of file execution_time_estimator.cpp.

References fawkes::Configuration::get_bool(), fawkes::Configuration::get_float(), fawkes::Configuration::get_string(), fawkes::Configuration::search(), and fawkes::str_split().

Member Function Documentation

◆ get_default_value()

template<typename T >
T fawkes::ExecutionTimeEstimator::Property< T >::get_default_value ( ) const

Get the default value if it is set, otherwise throw an exception.

Returns
the default value for the property

Definition at line 290 of file execution_time_estimator.cpp.

◆ get_property()

template<typename T >
T fawkes::ExecutionTimeEstimator::Property< T >::get_property ( const std::string &  key) const

Get the property falue for a given skill.

Parameters
keySkill entry id
Returns
Value associated with key or the default value, if no skill-specific value can be found

Definition at line 301 of file execution_time_estimator.cpp.

Member Data Documentation

◆ property_entries

template<typename T >
std::map<std::string, T> fawkes::ExecutionTimeEstimator::Property< T >::property_entries

Mapping from skill entry id to property value.

Definition at line 66 of file execution_time_estimator.h.


The documentation for this class was generated from the following files: