|
QEverCloud 6.1.0
Unofficial Evernote Cloud API for Qt
|
Returned by asynchonous versions of functions. More...
#include <AsyncResult.h>
Public Types | |
| typedef QVariant(* | ReadFunctionType) (QByteArray replyData) |
Signals | |
| void | finished (QVariant result, EverCloudExceptionDataPtr error, IRequestContextPtr ctx) |
| Emitted upon asynchronous call completition. | |
Public Member Functions | |
| AsyncResult (QString url, QByteArray postData, IRequestContextPtr ctx, ReadFunctionType readFunction=AsyncResult::asIs, bool autoDelete=true, QObject *parent=nullptr) | |
| AsyncResult (QNetworkRequest request, QByteArray postData, IRequestContextPtr ctx, ReadFunctionType readFunction=AsyncResult::asIs, bool autoDelete=true, QObject *parent=nullptr) | |
| AsyncResult (QVariant result, EverCloudExceptionDataPtr error, IRequestContextPtr ctx, bool autoDelete=true, QObject *parent=nullptr) | |
| ~AsyncResult () | |
| bool | waitForFinished (int timeout=-1) |
| Wait for asynchronous operation to complete. | |
Static Public Member Functions | |
| static QVariant | asIs (QByteArray replyData) |
Friends | |
| class | DurableService |
Returned by asynchonous versions of functions.
Wait for AsyncResult::finished signal.
Intended usage is something like this:
| typedef QVariant(* qevercloud::AsyncResult::ReadFunctionType) (QByteArray replyData) |
| qevercloud::AsyncResult::AsyncResult | ( | QString | url, |
| QByteArray | postData, | ||
| IRequestContextPtr | ctx, | ||
| ReadFunctionType | readFunction = AsyncResult::asIs, | ||
| bool | autoDelete = true, | ||
| QObject * | parent = nullptr ) |
| qevercloud::AsyncResult::AsyncResult | ( | QNetworkRequest | request, |
| QByteArray | postData, | ||
| IRequestContextPtr | ctx, | ||
| ReadFunctionType | readFunction = AsyncResult::asIs, | ||
| bool | autoDelete = true, | ||
| QObject * | parent = nullptr ) |
| qevercloud::AsyncResult::AsyncResult | ( | QVariant | result, |
| EverCloudExceptionDataPtr | error, | ||
| IRequestContextPtr | ctx, | ||
| bool | autoDelete = true, | ||
| QObject * | parent = nullptr ) |
Constructor accepting already prepared value and/or exception, for use in tests
| qevercloud::AsyncResult::~AsyncResult | ( | ) |
|
static |
|
signal |
Emitted upon asynchronous call completition.
| result | Request result |
| error | Non-nullptr in case of an error. See EverCloudExceptionData for more details |
| ctx | Request context used to make the request |
AsyncResult deletes itself after emitting this signal (if autoDelete parameter passed to its constructor was set to true). You don't have to manage it's lifetime explicitly.
| bool qevercloud::AsyncResult::waitForFinished | ( | int | timeout = -1 | ) |
Wait for asynchronous operation to complete.
| timeout | Maximum time to wait in milliseconds. Forever if < 0. |
|
friend |