userver: dynamic_config::KeyValue Class Reference
Loading...
Searching...
No Matches
dynamic_config::KeyValue Class Referencefinal

A type-erased config key-value pair. More...

#include <userver/dynamic_config/storage_mock.hpp>

Public Member Functions

template<typename Key >
 KeyValue (Key, VariableOfKey< Key > value)
 
template<typename Key , typename Json , typename = impl::IsJson<Json>>
 KeyValue (Key, const Json &value)
 Parses the value from formats::json::Value
 
impl::ConfigId GetId () const
 For internal use only.
 
std::any GetValue () const
 For internal use only.
 

Detailed Description

A type-erased config key-value pair.

Definition at line 26 of file storage_mock.hpp.

Constructor & Destructor Documentation

◆ KeyValue() [1/2]

template<typename Key >
dynamic_config::KeyValue::KeyValue ( Key  ,
VariableOfKey< Key value 
)
inline

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

{kMyConfig, {"foo", 42}}

Definition at line 33 of file storage_mock.hpp.

◆ KeyValue() [2/2]

template<typename Key , typename Json , typename = impl::IsJson<Json>>
dynamic_config::KeyValue::KeyValue ( Key  ,
const Json &  value 
)
inline

Parses the value from formats::json::Value

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: