tools:config
This is an old revision of the document!
Configuration Files
There is often a need to load a configuration from a text file on the disk or write configuration into such a file. This could be calibration data, ip-numbers, etc. This can be achieved in EEROS by packing this configuration data into a class as follows:
TestConfig : public eeros::config::FileConfig { public: TestConfig(const char *name) : FileConfig(name), // set default values a(1), b(2.2), c{0.1, 0.2, 0.3}, d("127.0.0.0") { add("id", a); add("offset", b); add("init values", c); add("ip", d); } int a; double b; std::array<double, 3> c; std::string d; };
tools/config.1513234812.txt.gz · Last modified: 2017/12/14 08:00 by graf