Belle II Software
development
PostgreSQLInterface.h
1
/**************************************************************************
2
* basf2 (Belle II Analysis Software Framework) *
3
* Author: The Belle II Collaboration *
4
* *
5
* See git log for contributors and copyright holders. *
6
* This file is licensed under LGPL-3.0, see LICENSE.md. *
7
**************************************************************************/
8
#ifndef _Belle2_PostgreSQLInterface_hh
9
#define _Belle2_PostgreSQLInterface_hh
10
11
#include "daq/slc/database/DBInterface.h"
12
#include "daq/slc/system/Mutex.h"
13
14
typedef
struct
pg_conn PGconn;
15
typedef
struct
pg_result PGresult;
16
17
namespace
Belle2
{
23
class
PostgreSQLInterface
:
public
DBInterface
{
24
25
public
:
26
PostgreSQLInterface
(
const
std::string& host,
27
const
std::string& database,
28
const
std::string& user,
29
const
std::string& password,
30
int
port);
31
PostgreSQLInterface
();
32
virtual
~PostgreSQLInterface
() {}
33
34
public
:
35
void
connect()
override
;
36
bool
isConnected()
override
;
37
void
execute_imp(
const
char
* command)
override
;
38
void
close()
override
;
39
void
clear()
override
;
40
DBRecordList loadRecords()
override
;
41
bool
checkTable(
const
std::string& tablename)
override
;
42
DBFieldTypeList getTableContents(
const
std::string& tablename)
override
;
43
44
private
:
45
PGconn* m_sq_conn;
46
PGresult* m_sq_result;
47
Mutex
m_mutex;
48
49
};
50
52
}
53
54
#endif
Belle2::DBInterface
Definition:
DBInterface.h:26
Belle2::Mutex
Definition:
Mutex.h:19
Belle2::PostgreSQLInterface
Definition:
PostgreSQLInterface.h:23
Belle2
Abstract base class for different kinds of events.
Definition:
MillepedeAlgorithm.h:17
daq
slc
psql
include
PostgreSQLInterface.h
Generated on Fri Nov 8 2024 02:35:43 for Belle II Software by
1.9.6