split project with app & doric module
This commit is contained in:
34
doric-Qt/example/doric/async/DoricAsyncResult.h
Normal file
34
doric-Qt/example/doric/async/DoricAsyncResult.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef ASYNCRESULT_H
|
||||
#define ASYNCRESULT_H
|
||||
|
||||
#include <QJSValue>
|
||||
|
||||
#include "DoricCallback.h"
|
||||
#include "DoricSettableFuture.h"
|
||||
|
||||
static QJSValue EMPTY(QJSValue::NullValue);
|
||||
|
||||
class DoricAsyncResult {
|
||||
private:
|
||||
QJSValue result = EMPTY;
|
||||
DoricCallback *callback;
|
||||
|
||||
public:
|
||||
DoricAsyncResult();
|
||||
|
||||
DoricAsyncResult(QJSValue result);
|
||||
|
||||
void setResult(QJSValue result);
|
||||
|
||||
void setError(QJSValue exception);
|
||||
|
||||
bool hasResult();
|
||||
|
||||
QJSValue getResult();
|
||||
|
||||
void setCallback(DoricCallback *callback);
|
||||
|
||||
DoricSettableFuture *synchronous();
|
||||
};
|
||||
|
||||
#endif // ASYNCRESULT_H
|
Reference in New Issue
Block a user