##// END OF EJS Templates
Add dataseries getter with new signature
perrinel -
r543:0ff42e877af8
parent child
Show More
@@ -1,65 +1,65
1 1 #ifndef SCIQLOP_VARIABLE_H
2 2 #define SCIQLOP_VARIABLE_H
3 3
4 4 #include "CoreGlobal.h"
5 5
6 6 #include <Data/SqpRange.h>
7 7
8 8 #include <QLoggingCategory>
9 9 #include <QObject>
10 10
11 11 #include <Common/MetaTypes.h>
12 12 #include <Common/spimpl.h>
13 13
14 14 Q_DECLARE_LOGGING_CATEGORY(LOG_Variable)
15 15
16 16 class IDataSeries;
17 17 class QString;
18 18
19 19 /**
20 20 * @brief The Variable class represents a variable in SciQlop.
21 21 */
22 22 class SCIQLOP_CORE_EXPORT Variable : public QObject {
23 23
24 24 Q_OBJECT
25 25
26 26 public:
27 27 explicit Variable(const QString &name, const SqpRange &dateTime,
28 28 const QVariantHash &metadata = {});
29 29
30 30 QString name() const noexcept;
31 31 SqpRange range() const noexcept;
32 32 void setRange(const SqpRange &range) noexcept;
33 33 SqpRange cacheRange() const noexcept;
34 34 void setCacheRange(const SqpRange &cacheRange) noexcept;
35 35
36 36 /// @return the data of the variable, nullptr if there is no data
37 IDataSeries *dataSeries() const noexcept;
37 std::shared_ptr<IDataSeries> dataSeries() const noexcept;
38 38
39 39 QVariantHash metadata() const noexcept;
40 40
41 41 bool contains(const SqpRange &range) const noexcept;
42 42 bool intersect(const SqpRange &range) const noexcept;
43 43 bool isInside(const SqpRange &range) const noexcept;
44 44
45 45 bool cacheContains(const SqpRange &range) const noexcept;
46 46 bool cacheIntersect(const SqpRange &range) const noexcept;
47 47 bool cacheIsInside(const SqpRange &range) const noexcept;
48 48
49 49 QVector<SqpRange> provideNotInCacheRangeList(const SqpRange &range) const noexcept;
50 50 void setDataSeries(std::shared_ptr<IDataSeries> dataSeries) noexcept;
51 51 void mergeDataSeries(std::shared_ptr<IDataSeries> dataSeries) noexcept;
52 52
53 53 signals:
54 54 void updated();
55 55
56 56 private:
57 57 class VariablePrivate;
58 58 spimpl::unique_impl_ptr<VariablePrivate> impl;
59 59 };
60 60
61 61 // Required for using shared_ptr in signals/slots
62 62 SCIQLOP_REGISTER_META_TYPE(VARIABLE_PTR_REGISTRY, std::shared_ptr<Variable>)
63 63 SCIQLOP_REGISTER_META_TYPE(VARIABLE_PTR_VECTOR_REGISTRY, QVector<std::shared_ptr<Variable> >)
64 64
65 65 #endif // SCIQLOP_VARIABLE_H
General Comments 0
You need to be logged in to leave comments. Login now