openDAQ
Open data acquisition platform
IConfigProvider Struct Referenceabstract

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...

+ Inheritance diagram for IConfigProvider:
+ Collaboration diagram for 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

virtual ErrCode INTERFACE_FUNC populateOptions (IDict *options)=0
 Populate the existing options dictionary with variables from config provider. More...
 
- Public Member Functions inherited from IBaseObject
virtual ErrCode INTERFACE_FUNC borrowInterface (const IntfID &intfID, void **obj) const =0
 Returns another interface which is supported by the object without incrementing the reference count. More...
 
virtual ErrCode INTERFACE_FUNC dispose ()=0
 Disposes all references held by the object. More...
 
virtual ErrCode INTERFACE_FUNC getHashCode (SizeT *hashCode)=0
 Returns hash code of the object. More...
 
virtual ErrCode INTERFACE_FUNC equals (IBaseObject *other, Bool *equal) const =0
 Compares object to another object for equality. More...
 
virtual ErrCode INTERFACE_FUNC toString (CharPtr *str)=0
 Returns a string representation of the object. More...
 
- Public Member Functions inherited from IUnknown
virtual ErrCode INTERFACE_FUNC queryInterface (const IntfID &intfID, void **obj)=0
 Returns another interface which is supported by the object and increments the reference count. More...
 
virtual int INTERFACE_FUNC addRef ()=0
 Increments the reference count for an interface on an object. More...
 
virtual int INTERFACE_FUNC releaseRef ()=0
 Decrements the reference count for an interface on an object. More...
 

Member Function Documentation

◆ populateOptions()

virtual ErrCode INTERFACE_FUNC populateOptions ( IDict options)
pure virtual

Populate the existing options dictionary with variables from config provider.

Parameters
optionsThe options dictionary