userver: dynamic_config::KeyValue Class Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
dynamic_config::KeyValue Class Referencefinal

#include <userver/dynamic_config/storage_mock.hpp>

Detailed Description

A type-erased config key-value pair.

Definition at line 26 of file storage_mock.hpp.

Public Member Functions

template<typename VariableType , typename Value = VariableType>
 KeyValue (const Key< VariableType > &key, Value &&value)
 
impl::ConfigId GetId () const
 For internal use only.
 
std::any GetValue () const
 For internal use only.
 

Constructor & Destructor Documentation

◆ KeyValue()

template<typename VariableType , typename Value = VariableType>
dynamic_config::KeyValue::KeyValue ( const Key< VariableType > & key,
Value && value )
inline

Uses the provided value directly. It can also be constructed in-place:

{kMyConfig, {"foo", 42}}

When passed a formats::json::Value, parses the value from it:

{kMyConfig, formats::json::FromString(R"({"foo": "what", "bar": 42})")}

Definition at line 38 of file storage_mock.hpp.

Member Function Documentation

◆ GetId()

impl::ConfigId dynamic_config::KeyValue::GetId ( ) const
inline

For internal use only.

Definition at line 43 of file storage_mock.hpp.

◆ GetValue()

std::any dynamic_config::KeyValue::GetValue ( ) const
inline

For internal use only.

Definition at line 46 of file storage_mock.hpp.


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