Variable.h
35 lines
| 842 B
| text/x-c
|
CLexer
Alexandre Leroux
|
r112 | #ifndef SCIQLOP_VARIABLE_H | ||
#define SCIQLOP_VARIABLE_H | ||||
Alexandre Leroux
|
r163 | #include <Common/spimpl.h> | ||
Alexandre Leroux
|
r170 | #include <QObject> | ||
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 | */ | ||
Alexandre Leroux
|
r163 | class Variable { | ||
public: | ||||
explicit Variable(const QString &name, const QString &unit, const QString &mission); | ||||
QString name() const noexcept; | ||||
QString mission() const noexcept; | ||||
QString unit() const noexcept; | ||||
Alexandre Leroux
|
r112 | |||
Alexandre Leroux
|
r164 | void addDataSeries(std::unique_ptr<IDataSeries> dataSeries) noexcept; | ||
Alexandre Leroux
|
r182 | /// @return the data of the variable, nullptr if there is no data | ||
IDataSeries *dataSeries() const noexcept; | ||||
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 | ||