Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
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
24template <bool Const>
25Photometry::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
28template <bool Const>
29Photometry::PhotometryIterator<Const>::PhotometryIterator(const PhotometryIterator<false>& other)
30 : m_filters_iter{other.m_filters_iter}, m_values_iter{other.m_values_iter} {}
31
32template <bool Const>
33Photometry::PhotometryIterator<Const>& Photometry::PhotometryIterator<Const>::operator++() {
34 ++m_filters_iter;
35 ++m_values_iter;
36 return *this;
37}
38
39template <bool Const>
40bool Photometry::PhotometryIterator<Const>::operator==(const PhotometryIterator& other) const {
41 return m_filters_iter == other.m_filters_iter;
42}
43
44template <bool Const>
45bool Photometry::PhotometryIterator<Const>::operator!=(const PhotometryIterator& other) const {
46 return m_filters_iter != other.m_filters_iter;
47}
48
49template <bool Const>
50auto Photometry::PhotometryIterator<Const>::operator*() -> reference {
51 return *m_values_iter;
52}
53
54template <bool Const>
55auto Photometry::PhotometryIterator<Const>::operator->() -> pointer {
56 return m_values_iter.operator->();
57}
58
59template <bool Const>
60ssize_t Photometry::PhotometryIterator<Const>::operator-(const PhotometryIterator& other) const {
61 return m_values_iter - other.m_values_iter;
62}
63
64template <bool Const>
65const std::string& Photometry::PhotometryIterator<Const>::filterName() const {
66 return *m_filters_iter;
67}
68
69#endif