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