25 #ifndef LSST_AFW_TYPEHANDLING_SIMPLEGENERICMAP_H 26 #define LSST_AFW_TYPEHANDLING_SIMPLEGENERICMAP_H 30 #include <unordered_map> 33 #include "boost/variant.hpp" 39 namespace typehandling {
68 bool empty() const noexcept
override {
return _storage.
empty(); }
77 for (
auto const& pair : _storage) {
88 return _storage.
at(key);
91 message <<
"Key not found: " <<
key;
virtual ~SimpleGenericMap() noexcept=default
bool unsafeInsert(K key, StorableType &&value) override
Create a new mapping with key equal to key and value equal to value.
bool unsafeErase(K key) override
Remove the mapping for a key from this map, if it exists.
ItemVariant const * other
bool empty() const noexcept override
Return true if this map contains no key-value pairs.
ValueReference unsafeLookup(K key) const override
Return a reference to the mapped value of the element with key equal to key.
boost::variant< bool const &, std::int32_t const &, std::int64_t const &, float const &, double const &, std::string const &, PolymorphicValue const &, std::shared_ptr< Storable > const & > ValueReference
A type-agnostic reference to the value stored inside the map.
A base class for image defects.
decltype(_referenceToType(std::declval< ValueReference >())) StorableType
The types that can be stored in a map.
A GenericMap that allows insertion and deletion of arbitrary values.
T throw_with_nested(T... args)
std::vector< K > keys() const override
Return the set of all keys, without type information.
SimpleGenericMap()=default
#define LSST_EXCEPT(type,...)
GenericMap< K >::size_type size() const noexcept override
Return the number of key-value pairs in the map.
bool contains(K const &key) const override
Return true if this map contains a mapping whose key has the specified label.
SimpleGenericMap & operator=(SimpleGenericMap const &other)=default
void clear() noexcept override
Remove all of the mappings from this map.
GenericMap< K >::size_type max_size() const noexcept override
Return the maximum number of elements the container is able to hold due to system or library implemen...
Interface for a GenericMap that allows element addition and removal.