This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-Qt/example/doric/loader/DoricJSLoaderManager.h

36 lines
731 B
C
Raw Permalink Normal View History

2021-06-09 18:06:56 +08:00
#ifndef DORICJSLOADERMANAGER_H
#define DORICJSLOADERMANAGER_H
#include <QDebug>
#include "DoricExport.h"
2021-06-09 18:06:56 +08:00
#include "DoricInterfaceLoader.h"
class DORIC_EXPORT DoricJSLoaderManager {
2021-06-09 18:06:56 +08:00
private:
static DoricJSLoaderManager *local_instance;
DoricJSLoaderManager();
~DoricJSLoaderManager() { qDebug() << "DoricJSLoaderManager destructor"; }
public:
static DoricJSLoaderManager *getInstance() {
static DoricJSLoaderManager instance;
return &instance;
}
private:
QSet<DoricInterfaceLoader *> jsLoaders;
public:
void addJSLoader(DoricInterfaceLoader *jsLoader);
QSet<DoricInterfaceLoader *> *getJSLoaders();
std::shared_ptr<DoricAsyncResult> request(QString source);
};
#endif // DORICJSLOADERMANAGER_H