#ifndef CONTEXTMANAGER_H #define CONTEXTMANAGER_H #include #include "context.h" class ContextManager { private: static ContextManager *local_instance; ContextManager() { qDebug() << "ContextManager create"; } ~ContextManager() { qDebug() << "ContextManager destroy"; } QAtomicInt *counter = new QAtomicInt(); QMap *contextMap = new QMap(); public: static ContextManager *getInstance() { static ContextManager instance; return &instance; } Context *createContext(QString script, QString source, QString extra); }; #endif // CONTEXTMANAGER_H