libfly  6.2.2
C++20 utility library for Linux, macOS, and Windows
fly::config::Config Class Reference

#include <config.hpp>

Inheritance diagram for fly::config::Config:

Protected Member Functions

virtual ~Config ()=default
 
template<typename T >
get_value (const std::string &name, T def) const
 
void update (const Json &)
 

Friends

class ConfigManager
 

Detailed Description

Class to hold a set of related configuration values.

Configuration classes must derive from this class and define helper getter functions for each of its config values. Any derived class must define a constexpr C-string named "identifier" to uniquely identify that class.

Author
Timothy Flynn (trfly.nosp@m.nn89.nosp@m.@pm.m.nosp@m.e)
Version
July 18, 2016

Constructor & Destructor Documentation

◆ ~Config()

virtual fly::config::Config::~Config ( )
protectedvirtualdefault

Destructor.

Member Function Documentation

◆ get_value()

template<typename T >
T fly::config::Config::get_value ( const std::string &  name,
def 
) const
protected

Get a value converted to a basic type, e.g. int or bool. If the value could not be found, or could not be converted to the given type, returns the provided default value.

Template Parameters
TThe basic return type of the value.
Parameters
nameThe name of the value.
defDefault value to use if needed.
Returns
The converted value or the default value.

◆ update()

void fly::config::Config::update ( const Json values)
protected

Update this configuration with a new set of parsed values.


The documentation for this class was generated from the following files: