Variable.h
45 lines
| 1.0 KiB
| text/x-c
|
CLexer
Alexandre Leroux
|
r107 | #ifndef SCIQLOP_VARIABLE_H | ||
#define SCIQLOP_VARIABLE_H | ||||
r210 | #include <Data/SqpDateTime.h> | |||
Alexandre Leroux
|
r151 | |||
r210 | #include <QLoggingCategory> | |||
Alexandre Leroux
|
r158 | #include <QObject> | ||
r210 | #include <Common/spimpl.h> | |||
Q_DECLARE_LOGGING_CATEGORY(LOG_Variable) | ||||
Alexandre Leroux
|
r152 | class IDataSeries; | ||
Alexandre Leroux
|
r151 | class QString; | ||
Alexandre Leroux
|
r107 | |||
/** | ||||
Alexandre Leroux
|
r151 | * @brief The Variable class represents a variable in SciQlop. | ||
Alexandre Leroux
|
r107 | */ | ||
Alexandre Leroux
|
r151 | class Variable { | ||
public: | ||||
r212 | explicit Variable(const QString &name, const QString &unit, const QString &mission, | |||
const SqpDateTime &dateTime); | ||||
Alexandre Leroux
|
r151 | |||
QString name() const noexcept; | ||||
QString mission() const noexcept; | ||||
QString unit() const noexcept; | ||||
Alexandre Leroux
|
r107 | |||
Alexandre Leroux
|
r152 | void addDataSeries(std::unique_ptr<IDataSeries> dataSeries) noexcept; | ||
Alexandre Leroux
|
r169 | /// @return the data of the variable, nullptr if there is no data | ||
IDataSeries *dataSeries() const noexcept; | ||||
r210 | public slots: | |||
void onXRangeChanged(SqpDateTime dateTime); | ||||
Alexandre Leroux
|
r151 | private: | ||
class VariablePrivate; | ||||
spimpl::unique_impl_ptr<VariablePrivate> impl; | ||||
Alexandre Leroux
|
r107 | }; | ||
Alexandre Leroux
|
r158 | // Required for using shared_ptr in signals/slots | ||
Q_DECLARE_METATYPE(std::shared_ptr<Variable>) | ||||
Alexandre Leroux
|
r107 | #endif // SCIQLOP_VARIABLE_H | ||