##// END OF EJS Templates
Added core wrapper meson build def...
Added core wrapper meson build def Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r67:a8a4e48c21af
r80:0c2e5a797af5
Show More
IDataProvider.h
51 lines | 1.5 KiB | text/x-c | CLexer
#ifndef SCIQLOP_IDATAPROVIDER_H
#define SCIQLOP_IDATAPROVIDER_H
#include "CoreGlobal.h"
#include <Common/MetaTypes.h>
#include <Common/deprecate.h>
#include <Data/DateTimeRange.h>
#include <QObject>
#include <QUuid>
#include <TimeSeries.h>
#include <functional>
#include <memory>
class DataProviderParameters;
class IDataSeries;
DEPRECATE(class QNetworkReply; class QNetworkRequest;)
/**
* @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.) Since
* its client mihgt use it from different threads it has to be either stateless
* and/or thread safe
*
* @sa IDataSeries
*/
class SCIQLOP_CORE_EXPORT IDataProvider : public QObject
{
Q_OBJECT
public:
virtual ~IDataProvider() noexcept = default;
virtual std::shared_ptr<IDataProvider> clone() const = 0;
// Synchronous call -> asyncGetData may be written for asynchronous get
virtual TimeSeries::ITimeSerie*
getData(const DataProviderParameters& parameters) = 0;
signals:
void progress(QUuid requestID, double progress);
};
// Required for using shared_ptr in signals/slots
SCIQLOP_REGISTER_META_TYPE(IDATAPROVIDER_PTR_REGISTRY,
std::shared_ptr<IDataProvider>)
SCIQLOP_REGISTER_META_TYPE(IDATAPROVIDER_FUNCTION_REGISTRY,
std::function<void(QNetworkReply*, QUuid)>)
#endif // SCIQLOP_IDATAPROVIDER_H