From 096d47e83d447c9c8019c170cd621bc74fc82337 2017-07-10 15:49:16 From: mperrinel Date: 2017-07-10 15:49:16 Subject: [PATCH] Add a signal to the IDataProvider API to correspond with the network controller and ask it to download data --- diff --git a/core/include/Data/IDataProvider.h b/core/include/Data/IDataProvider.h index 59799d2..2b4cc75 100644 --- a/core/include/Data/IDataProvider.h +++ b/core/include/Data/IDataProvider.h @@ -12,6 +12,8 @@ class DataProviderParameters; class IDataSeries; +class QNetworkReply; +class QNetworkRequest; /** * @brief The IDataProvider interface aims to declare a data provider. @@ -27,14 +29,32 @@ class IDataProvider : public QObject { public: virtual ~IDataProvider() noexcept = default; - virtual void requestDataLoading(QUuid token, const QVector &dateTimeList) = 0; + /** + * @brief requestDataLoading provide datas for the data identified by identifier for all + * SqpDateTime of dateTimeList + */ + virtual void requestDataLoading(QUuid identifier, const QVector &dateTimeList) = 0; signals: - void dataProvided(QUuid token, std::shared_ptr dateSerie, + /** + * @brief dataProvided send dataSeries under dateTime and that corresponds of the data + * identified by identifier + */ + void dataProvided(QUuid identifier, std::shared_ptr dateSerie, const SqpDateTime &dateTime); + + + /** + * @brief requestConstructed send a request for the data identified by identifier + * @callback is the methode call by the reply of the request when it is finished. + */ + void requestConstructed(const QNetworkRequest &request, QUuid identifier, + std::function callback); }; // Required for using shared_ptr in signals/slots SCIQLOP_REGISTER_META_TYPE(IDATAPROVIDER_PTR_REGISTRY, std::shared_ptr) +SCIQLOP_REGISTER_META_TYPE(IDATAPROVIDER_FUNCTION_REGISTRY, + std::function) #endif // SCIQLOP_IDATAPROVIDER_H