OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ConfigPatch Class Reference

#include <ConfigPatch.h>

Public Member Functions

 ConfigPatch ()=default
 
const std::vector< ConfigPatchEntry > & entries () const
 
void apply (Config *config) const
 

Static Public Member Functions

static ConfigPatch fromConfig (const Config *config)
 
template<class Filter >
static ConfigPatch fromConfig (const Config *config, Filter &&filter)
 
static ConfigPatch fromEntries (std::vector< ConfigPatchEntry > entries)
 

Private Attributes

std::vector< ConfigPatchEntry_entries
 

Detailed Description

Config patch, can be used to dump config state & restore it later.

Note that values are stored as string and not as std::any. This makes it easy to implement patch serialization, and also means that we don't need to think what happens if the types in config patch and in AnyConfigValue don't match (deserialization will throw if they don't).

Constructor & Destructor Documentation

◆ ConfigPatch()

ConfigPatch::ConfigPatch ( )
default

Member Function Documentation

◆ apply()

void ConfigPatch::apply ( Config config) const

Applies this config patch.

Parameters
configConfig to apply this patch to.
Exceptions
ExceptionIf non-existent keys were found in the patch, and on value deserialization errors.

◆ entries()

const std::vector< ConfigPatchEntry > & ConfigPatch::entries ( ) const
inline

◆ fromConfig() [1/2]

static ConfigPatch ConfigPatch::fromConfig ( const Config config)
inlinestatic

◆ fromConfig() [2/2]

template<class Filter >
static ConfigPatch ConfigPatch::fromConfig ( const Config config,
Filter &&  filter 
)
inlinestatic

◆ fromEntries()

static ConfigPatch ConfigPatch::fromEntries ( std::vector< ConfigPatchEntry entries)
inlinestatic

Member Data Documentation

◆ _entries

std::vector<ConfigPatchEntry> ConfigPatch::_entries
private

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