Feature #2489
Support value inheritance for configuration options
Status: | Resolved | Start date: | 02/15/2016 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 100% | |
Category: | Configuration | |||
Target version: | Robotics Service Bus - rsb-0.13 |
Description
plugins.cpp.load
andplugins.cpp.path
already support this, except inconsistently and wrong- The behavior can probably be turned into a generally applicable helper function
"Split the option value at :, if there is an element (i.e. ::), splice in the previous value."
A default value used to initialize the option will automatically work with this scheme.
Associated revisions
Proper inheritance for plugin options in src/rsc/plugins/Configurator.{h,cpp}
fixes #2489
The options plugins.cpp.{path,load} are list-valued.
Previously, only the path option supported a half-assed version of
inheriting previous/default values.
Now, both options use the new helper function mergeSequenceValue to
enable splicing of values that earlier in the configuration cascades or
default values.
Example:
- earlier.conf
[plugins.cpp]
path = foo:bar:
^ previous is spliced in here - later.conf
[plugins.cpp]
path = baz::fez
^ previous is spliced in here
=> plugins.cpp.path = bazaar:foo:bar:<default-path>:fez
- src/rsc/config/Utility.{h,cpp}: new files; contain utility functions
for processing configuration options - src/rsc/plugins/Configurator.cpp (header): updated copyright
(Configurator::Configurator): minor adaptations
(Configurator::execute): add search entries; when encountering an
empty search path entry, splice in the default search path
(Configurator::handleOption): use config::mergeSequenceValue to handle
inheritance of search path and load list options
(Configurator::addDefaultPath): minor adaptation
(Configurator::splitValue): removed; no longer needed
History
#1 Updated by J. Moringen about 7 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset rsc|bd64a09312a44e654cc96c5440e5255ccacf6c61.