8#ifndef _Belle2_DBInterface_hh
9#define _Belle2_DBInterface_hh
11#include "daq/slc/database/DBRecord.h"
12#include "daq/slc/system/Mutex.h"
23 typedef std::vector<DBRecord> DBRecordList;
24 typedef std::map<std::string, std::string> DBFieldTypeList;
30 const std::string& database,
31 const std::string& user,
32 const std::string& password,
37 virtual void connect() = 0;
38 virtual bool isConnected() = 0;
39 virtual void execute_imp(
const char* command) = 0;
40 void execute(
const char* command, ...);
41 void execute(
const std::string& command);
42 virtual void close() = 0;
43 virtual void clear() = 0;
44 virtual DBRecordList loadRecords() = 0;
45 virtual bool checkTable(
const std::string& tablename) = 0;
46 virtual DBFieldTypeList getTableContents(
const std::string& tablename) = 0;
47 void clearRecords() { m_record_v.resize(0); }
48 DBRecordList& getRecords() {
return m_record_v; }
49 const std::string& getHostName()
const {
return m_host; }
50 const std::string& getDatabase()
const {
return m_database; }
51 const std::string& getUserName()
const {
return m_user; }
52 const std::string& getPassword()
const {
return m_password; }
53 int getPort()
const {
return m_port; }
57 void init(
const std::string& host,
58 const std::string& database,
59 const std::string& user,
60 const std::string& password,
64 DBRecordList m_record_v;
66 std::string m_database;
68 std::string m_password;
73 static const int m_buf_size = 1024 * 1000;
Abstract base class for different kinds of events.