Template Class Registry#
Defined in File registry.h
Class Documentation#
-
template<typename Key, typename Value>
class Registry# Global key -> value store, used for self-registration at static-initialization time. There is exactly one instance per (Key, Value) pair, reachable through instance(). An entry can never be overwritten: registering an existing key is a no-op.
Public Types
Public Functions
-
Registry() = default#
-
inline bool register_entry(Key key, Value value)#
- Returns:
true if the entry was inserted, false if the key already existed.
-
inline bool register_entries(std::vector<std::pair<Key, Value>> list)#
- Returns:
true if all the entries were inserted.
-
inline const Value &get(const Key &key) const#
- Throws:
std::out_of_range – if the key is not registered.
-
inline std::size_t size() const#
-
inline const_iterator find(const Key &key) const#
-
inline const_iterator begin() const#
-
inline const_iterator end() const#
-
Registry() = default#