5#include <unordered_map>
36 void insert(
const std::string& key, T value)
38 stencilDB_.emplace(key, value);
56 const std::any&
operator[](
const std::string& key)
const;
67 T&
get(
const std::string& key)
69 return std::any_cast<T&>(stencilDB_.at(key));
82 const T&
get(
const std::string& key)
const
84 return std::any_cast<const T&>(stencilDB_.at(key));
101 std::unordered_map<std::string, std::any> stencilDB_;
A class that represents a stencil database.
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.
std::any & operator[](const std::string &key)
Retrieves a reference to the value associated with the given key.
StencilDataBase()=default
Default constructor for StencilDataBase.
const std::any & operator[](const std::string &key) const
Retrieves a const reference to the value associated with the given key.
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.