Reinforcement Learning  1.1
reinforcement_learning::utility::configuration Class Reference

Configuration class to initialize the API Represents a collection of (name,value) pairs used to configure the API. More...

#include <configuration.h>

Public Member Functions

 configuration (const configuration &)=default
 Copy constructor.
 
configurationoperator= (const configuration &)=default
 Assignment operator.
 
configurationoperator= (configuration &&)=default
 Move constructor.
 
 configuration (configuration &&)=default
 Move assignment operator.
 
void set (const char *name, const char *value)
 Sets the value for a given name. It overrides any existing values for that name.
 
const char * get (const char *name, const char *defval) const
 Gets the value for a given name. If the value does not exist, it returns defval.
 
int get_int (const char *name, int defval) const
 Gets the value as an integer. If the value does not exist or if there is an error, it returns defval.
 
bool get_bool (const char *name, bool defval) const
 Gets the value as a boolean. If the value does not exist or if there is an error, it returns defval.
 
float get_float (const char *name, float defval) const
 Gets the value as a float. If the value does not exist or if there is an error, it returns defval.
 
bool get_bool (const char *section, const char *name, bool defval) const
 

Friends

std::ostream & operator<< (std::ostream &os, const reinforcement_learning::utility::configuration &)
 friend Left shift operator
 

Detailed Description

Configuration class to initialize the API Represents a collection of (name,value) pairs used to configure the API.

Examples
rl_sim.cc.

Member Function Documentation

◆ get_bool()

bool reinforcement_learning::utility::configuration::get_bool ( const char *  section,
const char *  name,
bool  defval 
) const

Same as get_bool, but use global value as fallback before defval. Sections names are dot delimited. IE: section.property


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