#include <userver/utils/any_storage.hpp>
map-like heterogeneous data storage
Definition at line 79 of file any_storage.hpp.
Public Member Functions | |
template<typename Data > | |
const Data & | Get (const AnyStorageDataTag< StorageTag, Data > &tag) const |
template<typename Data > | |
Data & | Get (const AnyStorageDataTag< StorageTag, Data > &tag) |
template<typename Data > | |
Data & | Set (AnyStorageDataTag< StorageTag, Data > tag, Data data) |
Stores the data. | |
template<typename Data , typename... Args> | |
Data & | Emplace (const AnyStorageDataTag< StorageTag, Data > &tag, Args &&... args) |
Emplaces the data. The data is rewritten if already stored. | |
template<typename Data > | |
Data * | GetOptional (const AnyStorageDataTag< StorageTag, Data > &tag) noexcept |
template<typename Data > | |
const Data * | GetOptional (const AnyStorageDataTag< StorageTag, Data > &tag) const noexcept |
template<typename Data > | |
void | Erase (const AnyStorageDataTag< StorageTag, Data > &tag) |
Erase data. | |
utils::AnyStorage< StorageTag >::AnyStorage | ( | ) |
Definition at line 130 of file any_storage.hpp.
utils::AnyStorage< StorageTag >::~AnyStorage | ( | ) |
Definition at line 144 of file any_storage.hpp.
Data & utils::AnyStorage< StorageTag >::Emplace | ( | const AnyStorageDataTag< StorageTag, Data > & | tag, |
Args &&... | args ) |
Emplaces the data. The data is rewritten if already stored.
Definition at line 165 of file any_storage.hpp.
Data & utils::AnyStorage< StorageTag >::Get | ( | const AnyStorageDataTag< StorageTag, Data > & | tag | ) |
std::runtime_error | if no data was stored |
Definition at line 179 of file any_storage.hpp.
const Data & utils::AnyStorage< StorageTag >::Get | ( | const AnyStorageDataTag< StorageTag, Data > & | tag | ) | const |
Definition at line 188 of file any_storage.hpp.
|
noexcept |
Definition at line 206 of file any_storage.hpp.
|
noexcept |
Definition at line 196 of file any_storage.hpp.
Data & utils::AnyStorage< StorageTag >::Set | ( | AnyStorageDataTag< StorageTag, Data > | tag, |
Data | data ) |
Stores the data.
Definition at line 154 of file any_storage.hpp.