EEROS  1.0.0.0
API for the EEROS Real-Time Robotics Framework
eeros::config::FileConfig Class Reference

Configuration saved to and loaded from file. More...

#include <FileConfig.hpp>

Inheritance diagram for eeros::config::FileConfig:
Collaboration diagram for eeros::config::FileConfig:

Public Member Functions

 FileConfig (const char *path=nullptr)
 
virtual ~FileConfig ()
 
virtual bool save (const char *path=nullptr)
 
virtual bool load (const char *path=nullptr)
 
- Public Member Functions inherited from eeros::config::Config
 Config (const char *path=nullptr)
 
virtual ~Config ()
 
virtual void loadDefaults ()
 

Static Public Attributes

static constexpr int buffer_size = 256
 

Additional Inherited Members

- Protected Member Functions inherited from eeros::config::Config
virtual void add (const char *name, int &value)
 
virtual void add (const char *name, double &value)
 
virtual void add (const char *name, std::size_t length, int *start, int *end, int default_value=-1)
 
virtual void add (const char *name, std::size_t length, double *start, double *end, double default_value=NAN)
 
virtual void add (const char *name, std::string &value)
 
template<typename T , std::size_t N>
void add (const char *name, std::array< T, N > &value)
 
- Protected Attributes inherited from eeros::config::Config
const char * path
 
std::map< const char *, ConfigPropertyAccessor, CharPtrCompareproperties
 

Detailed Description

Configuration saved to and loaded from file.

This allows for saving a configuration to a file on disk or loading it from there. A configuration might be useful to keep calibration values or setup data.

Constructor & Destructor Documentation

FileConfig::FileConfig ( const char *  path = nullptr)

Creates a configuration

Parameters
pathName of the configuration file.
FileConfig::~FileConfig ( )
virtual

Destructor, do not call manually.

Member Function Documentation

bool FileConfig::load ( const char *  path = nullptr)
virtual

Loads a configuration, must be overwritten by a derived clas

Parameters
pathName of the configuration file.
Returns
true if successful

Implements eeros::config::Config.

bool FileConfig::save ( const char *  path = nullptr)
virtual

Saves a configuration, must be overwritten by a derived clas

Parameters
pathName of the configuration file.
Returns
true if successful

Implements eeros::config::Config.

Member Data Documentation

constexpr int eeros::config::FileConfig::buffer_size = 256
static

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