BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
ElogConnection.h
Go to the documentation of this file.
1
// -------------------------------------------------------------------------
2
// ----- ElogConnection header file -----
3
// -------------------------------------------------------------------------
4
5
/** ElogConnection.h
6
*@author K.Gertsenberger <gertsen@jinr.ru>
7
**
8
** Class for connection to the experiment database: Electronic Logbook Database
9
**/
10
11
#ifndef ELOGCONNECTION_H
12
#define ELOGCONNECTION_H 1
13
14
#include "
elog_db_settings.h
"
15
16
#include <
TSQLServer.h
>
17
#include <iostream>
18
#include <map>
19
#include <string>
20
using namespace
std
;
21
22
typedef
map<string, TSQLServer*>
mapSQLServer
;
23
typedef
pair<string, TSQLServer*>
pairSQLServer
;
24
typedef
map<string, TSQLServer*>::iterator
itSQLServer
;
25
26
class
ElogConnection
:
public
TObject
27
{
28
public
:
29
enum
enumDBMS
30
{
31
MySQL
,
32
PgSQL
33
};
34
35
static
ElogConnection
*
Open
();
36
static
ElogConnection
*
Open
(
enumDBMS
database_type,
37
const
char
* strDBHost,
38
const
char
* strDBName,
39
const
char
* strUID,
40
const
char
* strPassword);
41
virtual
~ElogConnection
();
// Destructor
42
43
TSQLServer
*
GetSQLServer
() {
return
elog_db_server
; }
44
45
static
const
char
*
DbToString
() {
return
"ELOG_DB"
; }
46
47
protected
:
48
static
mapSQLServer
*
mapConnection
;
49
50
private
:
51
TSQLServer
*
elog_db_server
;
52
53
ElogConnection
(
TSQLServer
* pSQLServer);
54
static
ElogConnection
*
OpenConnection
(
const
TString
& connect_string,
55
const
char
* strDBHost,
56
const
char
* strUID,
57
const
char
* strPassword);
58
59
ClassDef
(
ElogConnection
, 2)
60
};
61
62
#endif
ClassDef
#define ClassDef(name, id)
TSQLServer.h
ElogConnection
Definition
ElogConnection.h:27
ElogConnection::Open
static ElogConnection * Open(enumDBMS database_type, const char *strDBHost, const char *strDBName, const char *strUID, const char *strPassword)
ElogConnection::ElogConnection
ElogConnection(TSQLServer *pSQLServer)
Definition
ElogConnection.cxx:15
ElogConnection::OpenConnection
static ElogConnection * OpenConnection(const TString &connect_string, const char *strDBHost, const char *strUID, const char *strPassword)
ElogConnection::Open
static ElogConnection * Open()
ElogConnection::DbToString
static const char * DbToString()
Definition
ElogConnection.h:45
ElogConnection::GetSQLServer
TSQLServer * GetSQLServer()
Definition
ElogConnection.h:43
ElogConnection::enumDBMS
enumDBMS
Definition
ElogConnection.h:30
ElogConnection::PgSQL
@ PgSQL
Definition
ElogConnection.h:32
ElogConnection::MySQL
@ MySQL
Definition
ElogConnection.h:31
ElogConnection::~ElogConnection
virtual ~ElogConnection()
ElogConnection::mapConnection
static mapSQLServer * mapConnection
Definition
ElogConnection.h:48
ElogConnection::elog_db_server
TSQLServer * elog_db_server
Definition
ElogConnection.h:51
TObject
TSQLServer
TString
mapSQLServer
map< string, TSQLServer * > mapSQLServer
Definition
ElogConnection.h:22
itSQLServer
map< string, TSQLServer * >::iterator itSQLServer
Definition
ElogConnection.h:24
pairSQLServer
pair< string, TSQLServer * > pairSQLServer
Definition
ElogConnection.h:23
elog_db_settings.h
std
Definition
json.hpp:4446
install
include
ElogConnection.h
Generated on
for BmnRoot by
1.17.0