Feature #2489

Support value inheritance for configuration options

Added by J. Moringen over 6 years ago. Updated about 6 years ago.

Status:ResolvedStart date:02/15/2016
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:Configuration
Target version:Robotics Service Bus - rsb-0.13

Description

  • plugins.cpp.load and plugins.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

Revision bd64a093
Added by J. Moringen about 6 years ago

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:

  1. earlier.conf
    [plugins.cpp]
    path = foo:bar:
    ^ previous is spliced in here
  2. 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 6 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF