IDataProvider.h
42 lines
| 1.0 KiB
| text/x-c
|
CLexer
|
r122 | #ifndef SCIQLOP_IDATAPROVIDER_H | ||
#define SCIQLOP_IDATAPROVIDER_H | ||||
#include <memory> | ||||
|
r169 | #include <QObject> | ||
|
r308 | #include <Common/MetaTypes.h> | ||
r233 | #include <Data/SqpDateTime.h> | |||
|
r122 | class DataProviderParameters; | ||
class IDataSeries; | ||||
/** | ||||
* @brief The IDataProvider interface aims to declare a data provider. | ||||
* | ||||
* A data provider is an entity that generates data and returns it according to various parameters | ||||
* (time interval, product to retrieve the data, etc.) | ||||
* | ||||
* @sa IDataSeries | ||||
*/ | ||||
r233 | class IDataProvider : public QObject { | |||
Q_OBJECT | ||||
|
r122 | public: | ||
virtual ~IDataProvider() noexcept = default; | ||||
virtual std::unique_ptr<IDataSeries> | ||||
retrieveData(const DataProviderParameters ¶meters) const = 0; | ||||
r233 | ||||
virtual void requestDataLoading(const QVector<SqpDateTime> &dateTimeList) = 0; | ||||
signals: | ||||
r243 | void dataProvided(std::shared_ptr<IDataSeries> dateSerie, const SqpDateTime &dateTime); | |||
r233 | }; | |||
|
r308 | |||
|
r169 | // Required for using shared_ptr in signals/slots | ||
|
r308 | SCIQLOP_REGISTER_META_TYPE(IDATAPROVIDER_PTR_REGISTRY, std::shared_ptr<IDataProvider>) | ||
|
r169 | |||
|
r122 | #endif // SCIQLOP_IDATAPROVIDER_H | ||