8#include "daq/slc/database/DBInterface.h"
10#include <daq/slc/base/StringUtil.h>
11#include <daq/slc/system/LockGuard.h>
12#include <daq/slc/system/LogFile.h>
19DBInterface::DBInterface(
const std::string& host,
20 const std::string& database,
21 const std::string& user,
22 const std::string& password,
int port)
24 init(host, database, user, password, port);
27DBInterface::~DBInterface()
32void DBInterface::init(
const std::string& host,
33 const std::string& database,
34 const std::string& user,
35 const std::string& password,
int port)
38 m_database = database;
40 m_password = password;
42 m_buf =
new char[m_buf_size];
45void DBInterface::execute(
const char* text, ...)
54 vsnprintf(m_buf, m_buf_size, text, ap);
58 s = StringUtil::split(m_buf,
';');
61 for (
size_t i = 0; i < s.size(); i++)
62 execute_imp(s[i].c_str());
65void DBInterface::execute(
const std::string& text)
68 StringList s = StringUtil::split(text,
';');
69 for (
size_t i = 0; i < s.size(); i++)
70 execute_imp(s[i].c_str());
Lock Guard for a Mutex instance.
Abstract base class for different kinds of events.