7#include <unordered_map>
38 void insert(
const std::string& key, T value)
40 stencilDB_.emplace(key, value);
58 const std::any&
operator[](
const std::string& key)
const;
69 T&
get(
const std::string& key)
71 return std::any_cast<T&>(stencilDB_.at(key));
84 const T&
get(
const std::string& key)
const
86 return std::any_cast<const T&>(stencilDB_.at(key));
103 std::unordered_map<std::string, std::any> stencilDB_;
A class that represents a stencil database.
std::any & operator[](const std::string &key)
Retrieves a reference to the value associated with the given key.
StencilDataBase()=default
Default constructor for StencilDataBase.
bool contains(const std::string &key) const
Checks if the stencil database contains a value associated with the given key.
void insert(const std::string &key, T value)
Inserts a value into the stencil database.
const std::any & operator[](const std::string &key) const
Retrieves a const reference to the value associated with the given key.
const T & get(const std::string &key) const
Retrieves a const reference to the value associated with the given key.
T & get(const std::string &key)
Retrieves a reference to the value associated with the given key.