Skip to content
Snippets Groups Projects
  • Jim's avatar
    9116be8d
    Improve safety for settings usage · 9116be8d
    Jim authored
    - Add 'set_default' functions to obs-data.*.  These functions ensure
      that a paramter exists and that the parameter is of a specific type.
      If not, it will create or overwrite the value with the default setting
      instead.
    
      These functions are meant to be explicitly called before using any of
      the 'get' functions.  The reason why it was designed this way is to
      encourage defaults to be set in a single place/function.
    
      For example, ideal usage is to create one function for your data,
      "set_my_defaults(obs_data_t data)", set all the default values within
      that function, and then call that function on create/update, that way
      all defaults are centralized to a single place.
    
    - Ensure that data passed to sources/encoders/outputs/etc is always
      valid, and not a null value.
    
    - While I'm remembering, fix a few defaults of the main program config
      file data.
    9116be8d
    History
    Improve safety for settings usage
    Jim authored
    - Add 'set_default' functions to obs-data.*.  These functions ensure
      that a paramter exists and that the parameter is of a specific type.
      If not, it will create or overwrite the value with the default setting
      instead.
    
      These functions are meant to be explicitly called before using any of
      the 'get' functions.  The reason why it was designed this way is to
      encourage defaults to be set in a single place/function.
    
      For example, ideal usage is to create one function for your data,
      "set_my_defaults(obs_data_t data)", set all the default values within
      that function, and then call that function on create/update, that way
      all defaults are centralized to a single place.
    
    - Ensure that data passed to sources/encoders/outputs/etc is always
      valid, and not a null value.
    
    - While I'm remembering, fix a few defaults of the main program config
      file data.