ATLAS Offline Software
Loading...
Searching...
No Matches
CalibDbConnection.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef CALIBDBCONNECTION_H
6#define CALIBDBCONNECTION_H
7
8// c - c++
9#include "set"
10#include "string"
11
12namespace coral {
13 class IRelationalDomain;
14 class ISessionProxy;
15 class Context;
16 class IQuery;
17 class ITableDataEditor;
18} // namespace coral
19
20namespace MuonCalib {
21
23 public:
24 //==================constructor - destructor====================================
25 CalibDbConnection(const std::string& ConnectionString, const std::string& WorkingSchema);
26 virtual ~CalibDbConnection();
27 //==================public member functions=====================================
28 // connection control
29 bool OpenConnection();
30 inline void SetLogin(const std::string& username, const std::string& password) {
31 m_username = username;
32 m_password = password;
33 }
34 inline void GetLogin(std::string& username, std::string& password) const {
35 username = m_username;
36 password = m_password;
37 }
38 inline const std::string& GetConnectionString() const { return m_connection_string; }
39 // set target user - the given login will be used as proxy
40 inline void SetTargetUser(const std::string& target_user) { m_target_user = target_user; }
41 // transaction control
42 void OpenTransaction();
43 void Commit();
44 void Rollback();
45 // get table editor - for insert and update ueries
46 coral::ITableDataEditor& GetTableEditor(const std::string& table_name);
47 // get query
48 coral::IQuery* GetQuery();
49 void DestroyQuery(coral::IQuery* query);
50 // get latest header id
51 private:
52 //==================private data members========================================
53 // connection strings
56 // pointer to the open query;
57 std::set<coral::IQuery*> m_queries;
58 // The application context
59 coral::Context* m_context;
60 // session proxy
61 coral::ISessionProxy* m_session;
62 // username
63 std::string m_username;
64 // password
65 std::string m_password;
66 // target user
67 std::string m_target_user;
68 // is true if transaction is open
70 //================private member functions=====================================
71 // Returns a reference to the domain object for a given connection
72 coral::IRelationalDomain& domain(const std::string& connectionString);
73 };
74
75} // namespace MuonCalib
76
77#endif
void SetTargetUser(const std::string &target_user)
const std::string & GetConnectionString() const
void GetLogin(std::string &username, std::string &password) const
void DestroyQuery(coral::IQuery *query)
coral::ISessionProxy * m_session
CalibDbConnection(const std::string &ConnectionString, const std::string &WorkingSchema)
coral::ITableDataEditor & GetTableEditor(const std::string &table_name)
std::set< coral::IQuery * > m_queries
coral::IRelationalDomain & domain(const std::string &connectionString)
void SetLogin(const std::string &username, const std::string &password)
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition query.py:1