##// END OF EJS Templates
Add a signal to the IDataProvider API to correspond with the network...
perrinel -
r387:096d47e83d44
parent child
Show More
@@ -1,40 +1,60
1 1 #ifndef SCIQLOP_IDATAPROVIDER_H
2 2 #define SCIQLOP_IDATAPROVIDER_H
3 3
4 4 #include <memory>
5 5
6 6 #include <QObject>
7 7 #include <QUuid>
8 8
9 9 #include <Common/MetaTypes.h>
10 10
11 11 #include <Data/SqpDateTime.h>
12 12
13 13 class DataProviderParameters;
14 14 class IDataSeries;
15 class QNetworkReply;
16 class QNetworkRequest;
15 17
16 18 /**
17 19 * @brief The IDataProvider interface aims to declare a data provider.
18 20 *
19 21 * A data provider is an entity that generates data and returns it according to various parameters
20 22 * (time interval, product to retrieve the data, etc.)
21 23 *
22 24 * @sa IDataSeries
23 25 */
24 26 class IDataProvider : public QObject {
25 27
26 28 Q_OBJECT
27 29 public:
28 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 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 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 55 // Required for using shared_ptr in signals/slots
38 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 60 #endif // SCIQLOP_IDATAPROVIDER_H
General Comments 0
You need to be logged in to leave comments. Login now