#ifndef NATIVEDRIVER_H
#define NATIVEDRIVER_H
#include <QDebug>
#include "DoricInterfaceDriver.h"
#include "engine/DoricJSEngine.h"
class DoricNativeDriver : public DoricInterfaceDriver {
private:
static DoricNativeDriver *local_instance;
DoricNativeDriver() {}
~DoricNativeDriver() {}
DoricJSEngine jsEngine;
public:
static DoricNativeDriver *getInstance() {
static DoricNativeDriver instance;
return &instance;
}
std::shared_ptr<DoricAsyncResult>
invokeContextEntityMethod(QString contextId, QString method,
QVariantList args) override;
invokeDoricMethod(QString method, QVariantList args) override;
std::shared_ptr<DoricAsyncResult> asyncCall(std::function<void()> lambda,
DoricThreadMode mode) override;
createContext(QString contextId, QString script, QString source) override;
std::shared_ptr<DoricAsyncResult> destroyContext(QString contextId) override;
DoricRegistry *getRegistry() override;
};
#endif // NATIVEDRIVER_H