##// END OF EJS Templates
Adds data series to a variable
Alexandre Leroux -
r164:dcd9684539fa
parent child
Show More
@@ -3,6 +3,7
3 3
4 4 #include <Common/spimpl.h>
5 5
6 class IDataSeries;
6 7 class QString;
7 8
8 9 /**
@@ -16,6 +17,8 public:
16 17 QString mission() const noexcept;
17 18 QString unit() const noexcept;
18 19
20 void addDataSeries(std::unique_ptr<IDataSeries> dataSeries) noexcept;
21
19 22 private:
20 23 class VariablePrivate;
21 24 spimpl::unique_impl_ptr<VariablePrivate> impl;
@@ -1,14 +1,17
1 1 #include "Variable/Variable.h"
2 2
3 #include <Data/IDataSeries.h>
4
3 5 struct Variable::VariablePrivate {
4 6 explicit VariablePrivate(const QString &name, const QString &unit, const QString &mission)
5 : m_Name{name}, m_Unit{unit}, m_Mission{mission}
7 : m_Name{name}, m_Unit{unit}, m_Mission{mission}, m_DataSeries{nullptr}
6 8 {
7 9 }
8 10
9 11 QString m_Name;
10 12 QString m_Unit;
11 13 QString m_Mission;
14 std::unique_ptr<IDataSeries> m_DataSeries;
12 15 };
13 16
14 17 Variable::Variable(const QString &name, const QString &unit, const QString &mission)
@@ -30,3 +33,11 QString Variable::unit() const noexcept
30 33 {
31 34 return impl->m_Unit;
32 35 }
36
37 void Variable::addDataSeries(std::unique_ptr<IDataSeries> dataSeries) noexcept
38 {
39 if (!impl->m_DataSeries) {
40 impl->m_DataSeries = std::move(dataSeries);
41 }
42 /// @todo : else, merge the two data series (if possible)
43 }
General Comments 0
You need to be logged in to leave comments. Login now