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