Variable.h
55 lines
| 1.4 KiB
| text/x-c
|
CLexer
|
r107 | #ifndef SCIQLOP_VARIABLE_H | ||
#define SCIQLOP_VARIABLE_H | ||||
r210 | #include <Data/SqpDateTime.h> | |||
#include <QLoggingCategory> | ||||
|
r158 | #include <QObject> | ||
|
r285 | #include <Common/MetaTypes.h> | ||
r210 | #include <Common/spimpl.h> | |||
Q_DECLARE_LOGGING_CATEGORY(LOG_Variable) | ||||
|
r152 | class IDataSeries; | ||
|
r151 | class QString; | ||
|
r107 | |||
/** | ||||
|
r151 | * @brief The Variable class represents a variable in SciQlop. | ||
|
r107 | */ | ||
r219 | class Variable : public QObject { | |||
Q_OBJECT | ||||
|
r151 | public: | ||
r212 | explicit Variable(const QString &name, const QString &unit, const QString &mission, | |||
const SqpDateTime &dateTime); | ||||
|
r151 | |||
QString name() const noexcept; | ||||
QString mission() const noexcept; | ||||
QString unit() const noexcept; | ||||
r219 | SqpDateTime dateTime() const noexcept; | |||
r241 | void setDateTime(const SqpDateTime &dateTime) noexcept; | |||
|
r152 | |||
|
r169 | /// @return the data of the variable, nullptr if there is no data | ||
IDataSeries *dataSeries() const noexcept; | ||||
r293 | bool contains(const SqpDateTime &dateTime) const noexcept; | |||
bool intersect(const SqpDateTime &dateTime) const noexcept; | ||||
bool isInside(const SqpDateTime &dateTime) const noexcept; | ||||
r219 | ||||
r210 | public slots: | |||
|
r287 | void setDataSeries(std::shared_ptr<IDataSeries> dataSeries) noexcept; | ||
r219 | ||||
signals: | ||||
r276 | void updated(); | |||
r219 | ||||
|
r151 | private: | ||
class VariablePrivate; | ||||
spimpl::unique_impl_ptr<VariablePrivate> impl; | ||||
|
r107 | }; | ||
|
r158 | // Required for using shared_ptr in signals/slots | ||
|
r285 | SCIQLOP_REGISTER_META_TYPE(VARIABLE_PTR_REGISTRY, std::shared_ptr<Variable>) | ||
|
r158 | |||
|
r107 | #endif // SCIQLOP_VARIABLE_H | ||