BmnRoot
Loading...
Searching...
No Matches
TangoConnection.h
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- TangoConnection header file -----
3// -------------------------------------------------------------------------
4
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
43 TSQLServer* GetSQLServer() { return tango_db_server; }
44
45 static const char* DbToString() { return "TANGO_DB"; }
46
47 protected:
49
50 private:
51 TSQLServer* tango_db_server;
52
53 TangoConnection(TSQLServer* pSQLServer);
54 static TangoConnection* OpenConnection(const TString& connect_string,
55 const char* strDBHost,
56 const char* strUID,
57 const char* strPassword);
58
59 ClassDef(TangoConnection, 2)
60};
61
62#endif
TSQLServer * GetSQLServer()
static TangoConnection * Open(enumDBMS database_type, const char *strDBHost, const char *strDBName, const char *strUID, const char *strPassword)
virtual ~TangoConnection()
static TangoConnection * Open()
static const char * DbToString()
static mapSQLServer * mapConnection
map< string, TSQLServer * > mapSQLServer
map< string, TSQLServer * > mapSQLServer
map< string, TSQLServer * >::iterator itSQLServer
pair< string, TSQLServer * > pairSQLServer
STL namespace.