openDAQ
Open data acquisition platform
ConfigProviderPtr Class Reference

Config provider is an interface that was made for populating an options dictionary of an instance builder from external sources like a config file, environment variables, or command line arguments. The process of population of the dictionary have to be alligned with rules: More...

Inherits ObjectPtr< IConfigProvider >.

Detailed Description

Config provider is an interface that was made for populating an options dictionary of an instance builder from external sources like a config file, environment variables, or command line arguments. The process of population of the dictionary have to be alligned with rules:

  • all keys are set in lowercase. Values are set without case changes.
  • if a provider is trying to override an existing value, it has to have the same type. For example provider can not replace integer value with string or object with list
  • if a provider is overriding a list, it replaces old list items with a new one.

Public Member Functions

ConfigProviderPtr populateOptions (const daq::DictPtr< daq::IString, daq::IBaseObject > &options) const
 Populate the existing options dictionary with variables from config provider. More...