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/doric/DoricContextManager.h

31 lines
648 B
C
Raw Normal View History

2021-02-04 16:59:58 +08:00
#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);
};
#endif // CONTEXTMANAGER_H