Alexandria  2.19
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Photometry.icpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2021 Euclid Science Ground Segment
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License as published by the Free
6  * Software Foundation; either version 3.0 of the License, or (at your option)
7  * any later version.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifdef PHOTOMETRY_IMPL
20 
21 //-----------------------------------------------------------------------------
22 // Implementation of the iterator
23 
24 template <bool Const>
25 Photometry::PhotometryIterator<Const>::PhotometryIterator(const filters_iter_t& filters_iter, const values_iter_t& values_iter)
26  : m_filters_iter{filters_iter}, m_values_iter{values_iter} {}
27 
28 template <bool Const>
29 Photometry::PhotometryIterator<Const>::PhotometryIterator(const PhotometryIterator<false>& other)
30  : m_filters_iter{other.m_filters_iter}, m_values_iter{other.m_values_iter} {}
31 
32 template <bool Const>
33 Photometry::PhotometryIterator<Const>& Photometry::PhotometryIterator<Const>::operator++() {
34  ++m_filters_iter;
35  ++m_values_iter;
36  return *this;
37 }
38 
39 template <bool Const>
40 bool Photometry::PhotometryIterator<Const>::operator==(const PhotometryIterator& other) const {
41  return m_filters_iter == other.m_filters_iter;
42 }
43 
44 template <bool Const>
45 bool Photometry::PhotometryIterator<Const>::operator!=(const PhotometryIterator& other) const {
46  return m_filters_iter != other.m_filters_iter;
47 }
48 
49 template <bool Const>
50 auto Photometry::PhotometryIterator<Const>::operator*() -> reference {
51  return *m_values_iter;
52 }
53 
54 template <bool Const>
55 auto Photometry::PhotometryIterator<Const>::operator->() -> pointer {
56  return m_values_iter.operator->();
57 }
58 
59 template <bool Const>
60 ssize_t Photometry::PhotometryIterator<Const>::operator-(const PhotometryIterator& other) const {
61  return m_values_iter - other.m_values_iter;
62 }
63 
64 template <bool Const>
65 const std::string& Photometry::PhotometryIterator<Const>::filterName() const {
66  return *m_filters_iter;
67 }
68 
69 #endif
bool operator!=(const Euclid::SourceCatalog::Source::id_type &a, const Euclid::SourceCatalog::Source::id_type &b)
boost::variant specifies an equality operator (==), but, in older boost versions, not an inequality o...
Definition: Source.h:145
STL class.