split project with app & doric module
This commit is contained in:
32
doric-Qt/example/doric/DoricContextManager.h
Normal file
32
doric-Qt/example/doric/DoricContextManager.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef CONTEXTMANAGER_H
|
||||
#define CONTEXTMANAGER_H
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include "DoricContext.h"
|
||||
|
||||
class DoricContextManager {
|
||||
private:
|
||||
static DoricContextManager *local_instance;
|
||||
DoricContextManager() {}
|
||||
|
||||
~DoricContextManager() {}
|
||||
|
||||
QAtomicInt *counter = new QAtomicInt();
|
||||
QMap<QString, DoricContext *> *contextMap =
|
||||
new QMap<QString, DoricContext *>();
|
||||
|
||||
public:
|
||||
static DoricContextManager *getInstance() {
|
||||
static DoricContextManager instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
DoricContext *createContext(QString script, QString source, QString extra);
|
||||
|
||||
DoricContext *getContext(QString contextId);
|
||||
|
||||
void destroyContext(DoricContext *context);
|
||||
};
|
||||
|
||||
#endif // CONTEXTMANAGER_H
|
||||
Reference in New Issue
Block a user