2015-10-28 19:21:55 +01:00
|
|
|
#ifndef CONTEXT_H
|
|
|
|
|
#define CONTEXT_H
|
|
|
|
|
|
|
|
|
|
#include <QList>
|
2015-10-30 13:57:13 +01:00
|
|
|
#include "core_global.h"
|
2015-11-10 16:08:06 +01:00
|
|
|
#include "transaction.h"
|
2015-10-30 13:57:13 +01:00
|
|
|
|
2015-10-28 19:21:55 +01:00
|
|
|
#include <odb/database.hxx>
|
|
|
|
|
|
|
|
|
|
class IPlugin;
|
|
|
|
|
|
2015-10-30 13:57:13 +01:00
|
|
|
class CORESHARED_EXPORT Context
|
2015-10-28 19:21:55 +01:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
static Context &instance();
|
|
|
|
|
QList<IPlugin*> plugins();
|
|
|
|
|
void loadPlugins();
|
|
|
|
|
void openDb(const QString &path);
|
2015-10-30 13:57:13 +01:00
|
|
|
odb::database *db() { return m_db; }
|
2015-10-28 19:21:55 +01:00
|
|
|
|
|
|
|
|
private:
|
2015-11-10 16:08:06 +01:00
|
|
|
friend class Transaction;
|
|
|
|
|
|
2015-10-28 19:21:55 +01:00
|
|
|
Context();
|
|
|
|
|
QList<IPlugin*> m_plugins;
|
|
|
|
|
odb::database *m_db;
|
2015-11-10 16:08:06 +01:00
|
|
|
bool m_inTransaction;
|
2015-10-28 19:21:55 +01:00
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // CONTEXT_H
|