-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCPostgresManager.hpp
More file actions
42 lines (34 loc) · 1.12 KB
/
CPostgresManager.hpp
File metadata and controls
42 lines (34 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*********************************************************
*
* Multi Theft Auto: San Andreas - Deathmatch
*
* ml_base, External lua add-on module
*
* Copyright � 2003-2008 MTA. All Rights Reserved.
*
* Grand Theft Auto is (c) 2002-2003 Rockstar North
*
* THE FOLLOWING SOURCES ARE PART OF THE MULTI THEFT
* AUTO SOFTWARE DEVELOPMENT KIT AND ARE RELEASED AS
* OPEN SOURCE FILES. THESE FILES MAY BE USED AS LONG
* AS THE DEVELOPER AGREES TO THE LICENSE THAT IS
* PROVIDED WITH THIS PACKAGE.
*
*********************************************************/
#pragma once
#include "ml_pgsql.hpp"
#include "CPostgresConnection.hpp"
#include <vector>
class CPostgresManager
{
private:
std::vector<CPostgresConnection*> m_vecConnections;
public:
CPostgresManager();
~CPostgresManager();
void Add(CPostgresConnection* pConnection) { m_vecConnections.push_back(pConnection); }
static CPostgresConnection* NewConnection(lua_State* pLuaVM);
void CloseAllConnections(lua_State* pLuaVM = nullptr);
void RemoveConnection(CPostgresConnection* pConnection);
};
extern std::unique_ptr<CPostgresManager> g_pPostgresManager;