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