@@ -12,6 +12,8 | |||||
12 |
|
12 | |||
13 | class DataProviderParameters; |
|
13 | class DataProviderParameters; | |
14 | class IDataSeries; |
|
14 | class IDataSeries; | |
|
15 | class QNetworkReply; | |||
|
16 | class QNetworkRequest; | |||
15 |
|
17 | |||
16 | /** |
|
18 | /** | |
17 | * @brief The IDataProvider interface aims to declare a data provider. |
|
19 | * @brief The IDataProvider interface aims to declare a data provider. | |
@@ -27,14 +29,32 class IDataProvider : public QObject { | |||||
27 | public: |
|
29 | public: | |
28 | virtual ~IDataProvider() noexcept = default; |
|
30 | virtual ~IDataProvider() noexcept = default; | |
29 |
|
31 | |||
30 | virtual void requestDataLoading(QUuid token, const QVector<SqpDateTime> &dateTimeList) = 0; |
|
32 | /** | |
|
33 | * @brief requestDataLoading provide datas for the data identified by identifier for all | |||
|
34 | * SqpDateTime of dateTimeList | |||
|
35 | */ | |||
|
36 | virtual void requestDataLoading(QUuid identifier, const QVector<SqpDateTime> &dateTimeList) = 0; | |||
31 |
|
37 | |||
32 | signals: |
|
38 | signals: | |
33 | void dataProvided(QUuid token, std::shared_ptr<IDataSeries> dateSerie, |
|
39 | /** | |
|
40 | * @brief dataProvided send dataSeries under dateTime and that corresponds of the data | |||
|
41 | * identified by identifier | |||
|
42 | */ | |||
|
43 | void dataProvided(QUuid identifier, std::shared_ptr<IDataSeries> dateSerie, | |||
34 | const SqpDateTime &dateTime); |
|
44 | const SqpDateTime &dateTime); | |
|
45 | ||||
|
46 | ||||
|
47 | /** | |||
|
48 | * @brief requestConstructed send a request for the data identified by identifier | |||
|
49 | * @callback is the methode call by the reply of the request when it is finished. | |||
|
50 | */ | |||
|
51 | void requestConstructed(const QNetworkRequest &request, QUuid identifier, | |||
|
52 | std::function<void(QNetworkReply *, QUuid)> callback); | |||
35 | }; |
|
53 | }; | |
36 |
|
54 | |||
37 | // Required for using shared_ptr in signals/slots |
|
55 | // Required for using shared_ptr in signals/slots | |
38 | SCIQLOP_REGISTER_META_TYPE(IDATAPROVIDER_PTR_REGISTRY, std::shared_ptr<IDataProvider>) |
|
56 | SCIQLOP_REGISTER_META_TYPE(IDATAPROVIDER_PTR_REGISTRY, std::shared_ptr<IDataProvider>) | |
|
57 | SCIQLOP_REGISTER_META_TYPE(IDATAPROVIDER_FUNCTION_REGISTRY, | |||
|
58 | std::function<void(QNetworkReply *, QUuid)>) | |||
39 |
|
59 | |||
40 | #endif // SCIQLOP_IDATAPROVIDER_H |
|
60 | #endif // SCIQLOP_IDATAPROVIDER_H |
General Comments 0
You need to be logged in to leave comments.
Login now