2 * Copyright (C) 2012-2021 Euclid Science Ground Segment
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)
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
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
20 * @file GridContainer/_impl/GridAxis.icpp
22 * @author Nikolaos Apostolakos
28 namespace GridContainer {
31 GridAxis<T>::GridAxis(std::string name_, std::vector<T> values) : m_name(std::move(name_)), m_values(std::move(values)) {}
34 size_t GridAxis<T>::size() const {
35 return m_values.size();
39 const std::string& GridAxis<T>::name() const {
44 const T& GridAxis<T>::operator[](size_t index) const {
45 return m_values[index];
49 auto GridAxis<T>::begin() const -> const_iterator {
50 return m_values.cbegin();
54 auto GridAxis<T>::end() const -> const_iterator {
55 return m_values.end();
60 bool GridAxis<T>::operator==(const GridAxis<U>& other) const {
62 if (this->size() == other.size()) {
63 same = std::equal(this->begin(), this->end(), other.begin());
70 bool GridAxis<T>::operator!=(const GridAxis<U>& other) const {
71 return !this->operator==(other);
74 } // end of namespace GridContainer
75 } // end of namespace Euclid