LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
25 #ifndef LSST_AFW_IMAGE_DETAIL_STORABLEMAP_H
26 #define LSST_AFW_IMAGE_DETAIL_STORABLEMAP_H
32 #include <type_traits>
33 #include <unordered_map>
121 template <typename T>
124 "Can only retrieve pointers to subclasses of Storable.");
126 "Due to implementation constraints, pointers to non-const are not supported.");
139 if (typedPointer.use_count() > 0) {
143 message <<
"Key " <<
key <<
" not found, but a key labeled " <<
key.getId() <<
" is present.";
148 "No key labeled " +
key.getId() +
" found."));
156 bool empty() const noexcept;
200 template <typename T>
203 "Can only retrieve pointers to subclasses of Storable.");
205 "Due to implementation constraints, pointers to non-const are not supported.");
218 return typedPointer.use_count() > 0;
243 void clear() noexcept;
262 template <typename T>
265 "Can only store shared pointers to subclasses of Storable.");
267 "Due to implementation constraints, pointers to non-const are not supported.");
292 template <
typename T>
294 auto strongKey = typehandling::makeKey<T>(
key);
310 template <
typename T>
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
iterator begin() noexcept
Return an iterator to the first element of the map.
size_type size() const noexcept
Return the number of key-value pairs in the map.
StorableMap & operator=(StorableMap const &other)
bool empty() const noexcept
Return true if this map contains no key-value pairs.
bool insert(Key< std::shared_ptr< T >> const &key, std::shared_ptr< T > const &value)
Insert an element into the map, if the map doesn't already contain a mapping with the same or a confl...
bool operator==(StorableMap const &other) const noexcept
Test for map equality.
void clear() noexcept
Remove all of the mappings from this map.
value_type const * const_pointer
bool erase(Key< T > const &key) noexcept
Remove the mapping for a key from this map, if it exists.
const_iterator cbegin() const noexcept
Return an iterator to the first element of the map.
Interface supporting iteration over heterogenous containers.
StorableMap & operator=(StorableMap &&other)
std::shared_ptr< T > at(Key< std::shared_ptr< T >> const &key) const
Return a the mapped value of the element with key equal to key.
const_iterator cend() const noexcept
Return an iterator to the element past the end of the map.
T throw_with_nested(T... args)
ItemVariant const * other
A base class for image defects.
bool operator!=(StorableMap const &other) const noexcept
Test for map equality.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Key for type-safe lookup in a GenericMap.
value_type const & const_reference
StorableMap(StorableMap &&other)
Reports attempts to access elements outside a valid range of indices.
size_type max_size() const noexcept
Return the maximum number of elements the container is able to hold due to system or library implemen...
std::pair< Key< T >, bool > insert(std::string const &key, T const &value)
Insert an element into the map, if the map doesn't already contain a mapping with a conflicting key.
iterator end() noexcept
Return an iterator to the element past the end of the map.
bool contains(std::string const &key) const
Return true if this map contains a mapping whose key has the specified label.
StorableMap(StorableMap const &other)
_Impl::const_iterator const_iterator
A map of Storable supporting strongly-typed access.