Variable.h
57 lines
| 1.4 KiB
| text/x-c
|
CLexer
Alexandre Leroux
|
r107 | #ifndef SCIQLOP_VARIABLE_H | ||
#define SCIQLOP_VARIABLE_H | ||||
Alexandre Leroux
|
r425 | #include "CoreGlobal.h" | ||
r210 | #include <Data/SqpDateTime.h> | |||
#include <QLoggingCategory> | ||||
Alexandre Leroux
|
r158 | #include <QObject> | ||
Alexandre Leroux
|
r285 | #include <Common/MetaTypes.h> | ||
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
|
r425 | class SCIQLOP_CORE_EXPORT Variable : public QObject { | ||
r219 | ||||
Q_OBJECT | ||||
Alexandre Leroux
|
r151 | public: | ||
Alexandre Leroux
|
r373 | explicit Variable(const QString &name, const SqpDateTime &dateTime, | ||
const QVariantHash &metadata = {}); | ||||
Alexandre Leroux
|
r151 | |||
QString name() const noexcept; | ||||
r219 | SqpDateTime dateTime() const noexcept; | |||
r241 | void setDateTime(const SqpDateTime &dateTime) noexcept; | |||
Alexandre Leroux
|
r152 | |||
Alexandre Leroux
|
r169 | /// @return the data of the variable, nullptr if there is no data | ||
IDataSeries *dataSeries() const noexcept; | ||||
Alexandre Leroux
|
r373 | QVariantHash metadata() 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: | |||
Alexandre Leroux
|
r287 | void setDataSeries(std::shared_ptr<IDataSeries> dataSeries) noexcept; | ||
r219 | ||||
signals: | ||||
r276 | void updated(); | |||
r219 | ||||
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 | ||
Alexandre Leroux
|
r285 | SCIQLOP_REGISTER_META_TYPE(VARIABLE_PTR_REGISTRY, std::shared_ptr<Variable>) | ||
Alexandre Leroux
|
r158 | |||
Alexandre Leroux
|
r107 | #endif // SCIQLOP_VARIABLE_H | ||