##// END OF EJS Templates
Creates attribute to get nb points of a variable
Alexandre Leroux -
r659:880a343c8475
parent child
Show More
@@ -40,6 +40,10 public:
40 SqpRange cacheRange() const noexcept;
40 SqpRange cacheRange() const noexcept;
41 void setCacheRange(const SqpRange &cacheRange) noexcept;
41 void setCacheRange(const SqpRange &cacheRange) noexcept;
42
42
43 /// @return the number of points hold by the variable. The number of points is updated each time
44 /// the data series changes
45 int nbPoints() const noexcept;
46
43 /// Returns the real range of the variable, i.e. the min and max x-axis values of the data
47 /// Returns the real range of the variable, i.e. the min and max x-axis values of the data
44 /// series between the range of the variable. The real range is updated each time the variable
48 /// series between the range of the variable. The real range is updated each time the variable
45 /// range or the data series changed
49 /// range or the data series changed
@@ -16,7 +16,8 struct Variable::VariablePrivate {
16 m_Range{dateTime},
16 m_Range{dateTime},
17 m_Metadata{metadata},
17 m_Metadata{metadata},
18 m_DataSeries{nullptr},
18 m_DataSeries{nullptr},
19 m_RealRange{INVALID_RANGE}
19 m_RealRange{INVALID_RANGE},
20 m_NbPoints{0}
20 {
21 {
21 }
22 }
22
23
@@ -25,7 +26,8 struct Variable::VariablePrivate {
25 m_Range{other.m_Range},
26 m_Range{other.m_Range},
26 m_Metadata{other.m_Metadata},
27 m_Metadata{other.m_Metadata},
27 m_DataSeries{other.m_DataSeries != nullptr ? other.m_DataSeries->clone() : nullptr},
28 m_DataSeries{other.m_DataSeries != nullptr ? other.m_DataSeries->clone() : nullptr},
28 m_RealRange{other.m_RealRange}
29 m_RealRange{other.m_RealRange},
30 m_NbPoints{other.m_NbPoints}
29 {
31 {
30 }
32 }
31
33
@@ -67,6 +69,7 struct Variable::VariablePrivate {
67 QVariantHash m_Metadata;
69 QVariantHash m_Metadata;
68 std::shared_ptr<IDataSeries> m_DataSeries;
70 std::shared_ptr<IDataSeries> m_DataSeries;
69 SqpRange m_RealRange;
71 SqpRange m_RealRange;
72 int m_NbPoints;
70
73
71 QReadWriteLock m_Lock;
74 QReadWriteLock m_Lock;
72 };
75 };
@@ -135,6 +138,11 void Variable::setCacheRange(const SqpRange &cacheRange) noexcept
135 impl->unlock();
138 impl->unlock();
136 }
139 }
137
140
141 int Variable::nbPoints() const noexcept
142 {
143 return impl->m_NbPoints;
144 }
145
138 SqpRange Variable::realRange() const noexcept
146 SqpRange Variable::realRange() const noexcept
139 {
147 {
140 return impl->m_RealRange;
148 return impl->m_RealRange;
General Comments 0
You need to be logged in to leave comments. Login now