mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Add a ddb (default database) member to DatabaseManager.
This commit is contained in:
parent
06ef029280
commit
c7ae476853
@ -12,8 +12,15 @@ uint32_t DatabaseManager::create_database(const std::string &name) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Database %s successfully created!\n", name.c_str());
|
||||
|
||||
databases.push_back(db);
|
||||
|
||||
if (ddb == nullptr) {
|
||||
printf("Database %s has been set as the default database!\n", name.c_str());
|
||||
ddb = db;
|
||||
}
|
||||
|
||||
return databases.size() - 1;
|
||||
}
|
||||
|
||||
@ -53,6 +60,8 @@ Database *DatabaseManager::_create_database(const std::string &name) {
|
||||
|
||||
DatabaseManager::DatabaseManager() {
|
||||
_instance = this;
|
||||
|
||||
ddb = nullptr;
|
||||
}
|
||||
|
||||
DatabaseManager::~DatabaseManager() {
|
||||
|
@ -10,6 +10,7 @@
|
||||
class DatabaseManager {
|
||||
public:
|
||||
std::vector<Database *> databases;
|
||||
Database *ddb;
|
||||
|
||||
void load();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user