This PR introduces changes to mc_rtc::Configuration that will be used in a subsequent PR that introduces a schema-like structure builder to mc_rtc. It is the first of three PRs leading to mc_rtc::Schema introduction
The following features have been added:
Support for loading/saving std::variant
Support for intrusive methods for user-defined load/save operations (in addition to the existing and non-intrusive approach)
Add Configuration::find(key), Configuration(key, others...) and Configuration.find<T>(keys, others...)
I started to refactor the use Configuration::has (e.g. replace the very common usage of if(cfg.has("foo")) { foo = cfg("foo"); do_something(foo); } with if(auto foo = cfg.find("foo")) { do_something(foo); } but many of these instances will be better served by introducing Schema-like structures so I'll wait for this PR to come
This PR introduces changes to
mc_rtc::Configuration
that will be used in a subsequent PR that introduces a schema-like structure builder to mc_rtc. It is the first of three PRs leading tomc_rtc::Schema
introductionThe following features have been added:
std::variant
Configuration::find(key)
,Configuration(key, others...)
andConfiguration.find<T>(keys, others...)
I started to refactor the use
Configuration::has
(e.g. replace the very common usage ofif(cfg.has("foo")) { foo = cfg("foo"); do_something(foo); }
withif(auto foo = cfg.find("foo")) { do_something(foo); }
but many of these instances will be better served by introducing Schema-like structures so I'll wait for this PR to come