Alexandria  2.14.1
Please provide a description of the project.
XYDataset.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2020 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 <memory>
30 #include <vector>
31 #include <string>
32 #include <iterator>
33 #include <utility>
34 
35 #include "ElementsKernel/Export.h"
36 
37 namespace Euclid {
38 namespace XYDataset {
39 
60  {
61 
62  public:
63 
65 
79  : m_values(std::move(values)) { };
80 
82  XYDataset(const XYDataset&) = default;
83 
85  XYDataset(XYDataset&&) = default;
86 
95  static XYDataset factory(std::vector<std::pair<double, double>> vector_pair);
96 
107  static XYDataset factory(const std::vector<double>& x, const std::vector<double>& y);
108 
112  virtual ~XYDataset() = default;
113 
120  const_iterator begin() const;
121 
128  const_iterator end() const;
129 
136  const std::pair<double, double>& front() const;
137 
144  const std::pair<double, double>& back() const;
145 
152  size_t size() const { return m_values.size(); }
153 
154  private:
155 
157 
158  };
159 
160 } /* namespace XYDataset */
161 } // end of namespace Euclid
162 
163 
164 
165 #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:78
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
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:64
Euclid::XYDataset::XYDataset::size
size_t size() const
Get the size of the vector container.
Definition: XYDataset.h:152