9#include <userver/dynamic_config/impl/snapshot.hpp>
10#include <userver/utils/fast_pimpl.hpp>
12USERVER_NAMESPACE_BEGIN
14namespace dynamic_config {
20 static auto Parse(
const DocsMap& docs_map) {
return Parser(docs_map); }
24template <
typename Key>
25using VariableOfKey = impl::VariableOfKey<Key>;
44 Snapshot(
const Snapshot&);
45 Snapshot& operator=(
const Snapshot&);
47 Snapshot(Snapshot&&)
noexcept;
48 Snapshot& operator=(Snapshot&&)
noexcept;
53 template <
typename Key>
55 return GetData()[key];
59 template <
typename Key>
61 static_assert(!
sizeof(Key),
"keep the Snapshot before using, please");
66 const T&
Get()
const& {
67 return GetData()[Key<impl::ParseByConstructor<T>>{}];
73 static_assert(!
sizeof(T),
"keep the Snapshot before using, please");
77 explicit Snapshot(
const impl::StorageData& storage);
79 const impl::SnapshotData& GetData()
const;
83 friend class impl::StorageData;
86 utils::FastPimpl<Impl, 16, 8> impl_;