##// END OF EJS Templates
Forwarded constness of value type for SqpIterator + PB11 stuff...
jeandet -
r42:303cd0ae5d46
parent child
Show More
@@ -9,11 +9,11
9 * @tparam T the type of object handled in iterator
9 * @tparam T the type of object handled in iterator
10 * @sa http://www.cplusplus.com/reference/iterator/
10 * @sa http://www.cplusplus.com/reference/iterator/
11 */
11 */
12 template <typename T>
12 template <typename T, bool isConst=false>
13 class SCIQLOP_CORE_EXPORT SqpIterator {
13 class SCIQLOP_CORE_EXPORT SqpIterator {
14 public:
14 public:
15 using iterator_category = std::random_access_iterator_tag;
15 using iterator_category = std::random_access_iterator_tag;
16 using value_type = const T;
16 using value_type = typename std::conditional<isConst, const T, T>::type;
17 using difference_type = std::ptrdiff_t;
17 using difference_type = std::ptrdiff_t;
18 using pointer = value_type *;
18 using pointer = value_type *;
19 using reference = value_type &;
19 using reference = value_type &;
@@ -1,4 +1,5
1 #include <Data/SpectrogramSeries.h>
1 #include <Data/SpectrogramSeries.h>
2 #include <Data/DataSeriesUtils.h>
2
3
3 SpectrogramSeries::SpectrogramSeries(std::vector<double> xAxisData, std::vector<double> yAxisData,
4 SpectrogramSeries::SpectrogramSeries(std::vector<double> xAxisData, std::vector<double> yAxisData,
4 std::vector<double> valuesData, const Unit &xAxisUnit,
5 std::vector<double> valuesData, const Unit &xAxisUnit,
@@ -22,6 +23,10 SpectrogramSeries::SpectrogramSeries(std::shared_ptr<ArrayData<1> > xAxisData,
22 std::move(yAxis)},
23 std::move(yAxis)},
23 m_XResolution{resolution}
24 m_XResolution{resolution}
24 {
25 {
26 if(std::isnan(m_XResolution))
27 {
28 //m_XResolution = DataSeriesUtils::resolution(xAxisData->begin(), xAxisData->end()).m_Val;
29 }
25 }
30 }
26
31
27 std::unique_ptr<IDataSeries> SpectrogramSeries::clone() const
32 std::unique_ptr<IDataSeries> SpectrogramSeries::clone() const
@@ -4,6 +4,8
4 #include <pybind11/numpy.h>
4 #include <pybind11/numpy.h>
5 #include <pybind11/chrono.h>
5 #include <pybind11/chrono.h>
6 #include <pybind11/functional.h>
6 #include <pybind11/functional.h>
7 #include <pybind11/stl.h>
8
7
9
8 #include <string>
10 #include <string>
9 #include <sstream>
11 #include <sstream>
@@ -69,6 +71,7 PYBIND11_MODULE(pysciqlopcore,m){
69
71
70 py::class_<DataSeriesIteratorValue>(m,"DataSeriesIteratorValue")
72 py::class_<DataSeriesIteratorValue>(m,"DataSeriesIteratorValue")
71 .def_property_readonly("x", &DataSeriesIteratorValue::x)
73 .def_property_readonly("x", &DataSeriesIteratorValue::x)
74 .def_property_readonly("y", &DataSeriesIteratorValue::y)
72 .def("value", py::overload_cast<>(&DataSeriesIteratorValue::value, py::const_))
75 .def("value", py::overload_cast<>(&DataSeriesIteratorValue::value, py::const_))
73 .def("value", py::overload_cast<int>(&DataSeriesIteratorValue::value, py::const_))
76 .def("value", py::overload_cast<int>(&DataSeriesIteratorValue::value, py::const_))
74 .def("values", &DataSeriesIteratorValue::values);
77 .def("values", &DataSeriesIteratorValue::values);
General Comments 0
You need to be logged in to leave comments. Login now