#ifndef DATABASE_MANAGER_H #define DATABASE_MANAGER_H #include "core/string.h" #include #include #include #include "database.h" class DatabaseManager { public: std::vector databases; Database *ddb; void load(); static DatabaseManager *get_singleton(); //note: not threadsafe, create these at the start of your program! uint32_t create_database(const String &name); static void _register_db_creation_func(const String &name, std::function func); static void _unregister_db_creation_func(const String &name); static Database *_create_database(const String &name); DatabaseManager(); ~DatabaseManager(); private: static DatabaseManager * _instance; static std::map > _db_creation_func_map; }; #endif