Alexandria  2.18
Please provide a description of the project.
XYDataset.h
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 
26 #ifndef XYDATASET_H_
27 #define XYDATASET_H_
28 
29 #include <iterator>
30 #include <memory>
31 #include <string>
32 #include <utility>
33 #include <vector>
34 
35 #include "ElementsKernel/Export.h"
36 
37 namespace Euclid {
38 namespace XYDataset {
39 
60 
61 public:
63 
76  XYDataset(std::vector<std::pair<double, double>> values) : m_values(std::move(values)){};
77 
79  XYDataset(const XYDataset&) = default;
80 
82  XYDataset(XYDataset&&) = default;
83 
92  static XYDataset factory(std::vector<std::pair<double, double>> vector_pair);
93 
104  static XYDataset factory(const std::vector<double>& x, const std::vector<double>& y);
105 
109  virtual ~XYDataset() = default;
110 
117  const_iterator begin() const;
118 
125  const_iterator end() const;
126 
133  const std::pair<double, double>& front() const;
134 
141  const std::pair<double, double>& back() const;
142 
149  size_t size() const {
150  return m_values.size();
151  }
152 
153 private:
155 };
156 
157 } /* namespace XYDataset */
158 } // end of namespace Euclid
159 
160 #endif // XYDATASET_H_
Export.h
Euclid::XYDataset::XYDataset::XYDataset
XYDataset(std::vector< std::pair< double, double >> values)
Constructor XYDataset interface represents an immutable data set.
Definition: XYDataset.h:76
std::pair< double, double >
Euclid::XYDataset::XYDataset
This module provides an interface for accessing two dimensional datasets (pairs of (X,...
Definition: XYDataset.h:59
std::vector
STL class.
ELEMENTS_API
#define ELEMENTS_API
Euclid::XYDataset::XYDataset::XYDataset
XYDataset(XYDataset &&)=default
Move constructor.
Euclid::XYDataset::XYDataset::XYDataset
XYDataset(const XYDataset &)=default
Copy constructor.
Euclid::XYDataset::XYDataset::~XYDataset
virtual ~XYDataset()=default
Destructor.
std
STL namespace.
Euclid
Definition: InstOrRefHolder.h:29
Euclid::XYDataset::XYDataset::const_iterator
std::vector< std::pair< double, double > >::const_iterator const_iterator
Definition: XYDataset.h:62
Euclid::XYDataset::XYDataset::size
size_t size() const
Get the size of the vector container.
Definition: XYDataset.h:149