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