Variable.h
54 lines
| 1.2 KiB
| text/x-c
|
CLexer
|
r112 | #ifndef SCIQLOP_VARIABLE_H | ||
#define SCIQLOP_VARIABLE_H | ||||
r226 | #include <Data/SqpDateTime.h> | |||
|
r163 | |||
r226 | #include <QLoggingCategory> | |||
|
r170 | #include <QObject> | ||
r226 | #include <Common/spimpl.h> | |||
Q_DECLARE_LOGGING_CATEGORY(LOG_Variable) | ||||
|
r164 | class IDataSeries; | ||
|
r163 | class QString; | ||
|
r112 | |||
/** | ||||
|
r163 | * @brief The Variable class represents a variable in SciQlop. | ||
|
r112 | */ | ||
r235 | class Variable : public QObject { | |||
Q_OBJECT | ||||
|
r163 | public: | ||
r228 | explicit Variable(const QString &name, const QString &unit, const QString &mission, | |||
const SqpDateTime &dateTime); | ||||
|
r163 | |||
QString name() const noexcept; | ||||
QString mission() const noexcept; | ||||
QString unit() const noexcept; | ||||
r235 | SqpDateTime dateTime() const noexcept; | |||
|
r164 | |||
|
r182 | /// @return the data of the variable, nullptr if there is no data | ||
IDataSeries *dataSeries() const noexcept; | ||||
r235 | bool contains(SqpDateTime dateTime); | |||
void setDataSeries(std::unique_ptr<IDataSeries> dataSeries) noexcept; | ||||
r226 | public slots: | |||
r235 | void onAddDataSeries(std::shared_ptr<IDataSeries> dataSeries) noexcept; | |||
signals: | ||||
void dataCacheUpdated(); | ||||
r226 | ||||
|
r163 | private: | ||
class VariablePrivate; | ||||
spimpl::unique_impl_ptr<VariablePrivate> impl; | ||||
|
r112 | }; | ||
|
r170 | // Required for using shared_ptr in signals/slots | ||
Q_DECLARE_METATYPE(std::shared_ptr<Variable>) | ||||
|
r112 | #endif // SCIQLOP_VARIABLE_H | ||