mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-23 20:36:53 +01:00
34 lines
661 B
C++
34 lines
661 B
C++
#ifndef DATABASE_MULTI_THREADED_H
|
|
#define DATABASE_MULTI_THREADED_H
|
|
|
|
#include "core/containers/rb_map.h"
|
|
#include "core/os/rw_lock.h"
|
|
#include "core/os/thread.h"
|
|
|
|
#include "database.h"
|
|
|
|
class QueryBuilder;
|
|
class TableBuilder;
|
|
class QueryResult;
|
|
class DatabaseConnection;
|
|
|
|
class DatabaseMultiThreaded : public Database {
|
|
GDCLASS(DatabaseMultiThreaded, Database);
|
|
|
|
public:
|
|
Ref<DatabaseConnection> get_connection();
|
|
|
|
DatabaseMultiThreaded();
|
|
~DatabaseMultiThreaded();
|
|
|
|
protected:
|
|
Ref<DatabaseConnection> _allocate_connection();
|
|
|
|
static void _bind_methods();
|
|
|
|
RWLock _connection_map_lock;
|
|
RBMap<Thread::ID, Ref<DatabaseConnection>> _connections;
|
|
};
|
|
|
|
#endif
|