LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
StorableMap.cc
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 /*
3  * This file is part of afw.
4  *
5  * Developed for the LSST Data Management System.
6  * This product includes software developed by the LSST Project
7  * (https://www.lsst.org).
8  * See the COPYRIGHT file at the top-level directory of this distribution
9  * for details of code ownership.
10  *
11  * This program is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation, either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program. If not, see <https://www.gnu.org/licenses/>.
23  */
24 
25 #include <unordered_map>
26 #include <utility>
27 
29 
30 namespace lsst {
31 namespace afw {
32 namespace image {
33 namespace detail {
34 
35 StorableMap::StorableMap() = default;
36 StorableMap::StorableMap(StorableMap const& other) = default;
37 StorableMap::StorableMap(StorableMap&& other) = default;
38 StorableMap& StorableMap::operator=(StorableMap const& other) = default;
39 StorableMap& StorableMap::operator=(StorableMap&& other) = default;
40 StorableMap::~StorableMap() noexcept = default;
41 
42 StorableMap::StorableMap(std::initializer_list<value_type> init) : _contents(init){};
43 
44 StorableMap::size_type StorableMap::size() const noexcept { return _contents.size(); }
45 
46 bool StorableMap::empty() const noexcept { return _contents.empty(); }
47 
48 StorableMap::size_type StorableMap::max_size() const noexcept { return _contents.max_size(); }
49 
50 bool StorableMap::contains(std::string const& key) const { return _contents.count(key_type(key)) == 1; }
51 
52 bool StorableMap::operator==(StorableMap const& other) const noexcept { return _contents == other._contents; }
53 
54 void StorableMap::clear() noexcept { _contents.clear(); }
55 
57  return StorableMap::const_iterator(_contents.begin());
58 }
60  return StorableMap::const_iterator(_contents.end());
61 };
62 
65 
66 } // namespace detail
67 } // namespace image
68 } // namespace afw
69 } // namespace lsst
T begin(T... args)
A map of Storable supporting strongly-typed access.
Definition: StorableMap.h:59
bool operator==(StorableMap const &other) const noexcept
Test for map equality.
Definition: StorableMap.cc:52
bool empty() const noexcept
Return true if this map contains no key-value pairs.
Definition: StorableMap.cc:46
bool contains(std::string const &key) const
Return true if this map contains a mapping whose key has the specified label.
Definition: StorableMap.cc:50
void clear() noexcept
Remove all of the mappings from this map.
Definition: StorableMap.cc:54
size_type size() const noexcept
Return the number of key-value pairs in the map.
Definition: StorableMap.cc:44
typehandling::Key< std::string, mapped_type > key_type
Definition: StorableMap.h:62
iterator begin() noexcept
Return an iterator to the first element of the map.
Definition: StorableMap.cc:63
_Impl::const_iterator const_iterator
Definition: StorableMap.h:77
iterator end() noexcept
Return an iterator to the element past the end of the map.
Definition: StorableMap.cc:64
StorableMap & operator=(StorableMap const &other)
size_type max_size() const noexcept
Return the maximum number of elements the container is able to hold due to system or library implemen...
Definition: StorableMap.cc:48
T clear(T... args)
T count(T... args)
T empty(T... args)
T end(T... args)
T max_size(T... args)
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
A base class for image defects.
STL namespace.
T size(T... args)