2022-06-30 13:23:48 +02:00
|
|
|
#ifndef DATABASE_MANAGER_H
|
|
|
|
#define DATABASE_MANAGER_H
|
|
|
|
|
2022-07-05 23:30:14 +02:00
|
|
|
#include "core/reference.h"
|
|
|
|
#include "core/ustring.h"
|
2022-06-30 13:23:48 +02:00
|
|
|
|
|
|
|
#include "core/object.h"
|
|
|
|
|
2022-07-05 23:30:14 +02:00
|
|
|
class Database;
|
2022-06-30 13:23:48 +02:00
|
|
|
|
|
|
|
class DatabaseManager : public Object {
|
2022-07-05 23:30:14 +02:00
|
|
|
GDCLASS(DatabaseManager, Object);
|
2022-06-30 13:23:48 +02:00
|
|
|
|
|
|
|
public:
|
2022-07-05 23:30:14 +02:00
|
|
|
Ref<Database> get_ddb();
|
|
|
|
void set_ddb(const Ref<Database> &db);
|
2022-06-30 13:23:48 +02:00
|
|
|
|
2022-07-05 23:30:14 +02:00
|
|
|
void load();
|
2022-06-30 13:23:48 +02:00
|
|
|
|
2022-07-05 23:30:14 +02:00
|
|
|
static DatabaseManager *get_singleton();
|
2022-06-30 13:23:48 +02:00
|
|
|
|
2022-07-05 23:30:14 +02:00
|
|
|
DatabaseManager();
|
|
|
|
~DatabaseManager();
|
2022-06-30 13:23:48 +02:00
|
|
|
|
2022-07-05 23:30:14 +02:00
|
|
|
protected:
|
|
|
|
Vector<Ref<Database>> _databases;
|
|
|
|
Ref<Database> _ddb;
|
2022-06-30 13:23:48 +02:00
|
|
|
|
|
|
|
private:
|
2022-07-05 23:30:14 +02:00
|
|
|
static DatabaseManager *_instance;
|
2022-06-30 13:23:48 +02:00
|
|
|
};
|
|
|
|
|
2022-07-05 23:30:14 +02:00
|
|
|
#endif
|