#include <ODTTCciConfig.h>
Definition at line 15 of file ODTTCciConfig.h.
ODTTCciConfig::ODTTCciConfig |
( |
| ) |
|
Definition at line 15 of file ODTTCciConfig.cc.
References clear().
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
std::string m_configuration_script
std::string m_configuration_script_params
ODTTCciConfig::~ODTTCciConfig |
( |
| ) |
|
|
override |
void ODTTCciConfig::clear |
( |
void |
| ) |
|
|
private |
Definition at line 182 of file ODTTCciConfig.cc.
References edmScanValgrind::buffer, gather_cfg::cout, alignCSCRings::e, mps_fire::i, mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.
186 throw(std::runtime_error(
"ODTTCciConfig::fetchData(): no Id defined for this ODTTCciConfig "));
192 "FROM ECAL_TTCci_CONFIGURATION "
193 " where ( ttcci_configuration_id = :1 or ttcci_tag=:2 )");
201 result->
setId(rset->getInt(1));
211 Clob clob = rset->getClob(6);
212 cout <<
"Opening the clob in Read only mode" << endl;
213 clob.open(OCCI_LOB_READONLY);
214 int clobLength = clob.length();
215 cout <<
"Length of the clob is: " << clobLength << endl;
219 cout <<
"the clob buffer is:" << endl;
220 for (
int i = 0;
i < clobLength; ++
i)
221 cout << (
char)buffer[
i];
227 throw(std::runtime_error(
std::string(
"ODTTCciConfig::fetchData(): ") + e.getMessage()));
void setConfigurationScript(std::string x)
unsigned char * readClob(Clob &clob, int size) noexcept(false)
void checkConnection() const noexcept(false)
void setTTCciClob(unsigned char *x)
void setTTCciConfigurationFile(std::string x)
void setTrgMode(std::string x)
void setConfigurationScriptParams(std::string x)
void setConfigTag(std::string x)
oracle::occi::SQLException SQLException
std::string getConfigTag()
int ODTTCciConfig::fetchID |
( |
| ) |
|
|
privatenoexcept |
Definition at line 231 of file ODTTCciConfig.cc.
References alignCSCRings::e, and AlCaHLTBitMon_QueryRunRegistry::string.
241 "SELECT ttcci_configuration_id FROM ecal_ttcci_configuration "
242 "WHERE ttcci_tag=:ttcci_tag ");
246 ResultSet* rset = stmt->executeQuery();
249 m_ID = rset->getInt(1);
253 m_conn->terminateStatement(stmt);
255 throw(std::runtime_error(
std::string(
"ODTTCciConfig::fetchID: ") + e.getMessage()));
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
oracle::occi::Statement Statement
oracle::occi::SQLException SQLException
std::string getConfigTag()
int ODTTCciConfig::fetchNextId |
( |
| ) |
|
|
privatenoexcept |
std::string ODTTCciConfig::getConfigurationScript |
( |
| ) |
const |
|
inline |
std::string ODTTCciConfig::getConfigurationScriptParams |
( |
| ) |
const |
|
inline |
int ODTTCciConfig::getId |
( |
void |
| ) |
const |
|
inline |
unsigned int ODTTCciConfig::getSize |
( |
| ) |
const |
|
inline |
std::string ODTTCciConfig::getTable |
( |
| ) |
|
|
inlineoverridevirtual |
std::string ODTTCciConfig::getTrgMode |
( |
| ) |
const |
|
inline |
int ODTTCciConfig::getTrgSleep |
( |
| ) |
const |
|
inline |
unsigned char* ODTTCciConfig::getTTCciClob |
( |
| ) |
const |
|
inline |
std::string ODTTCciConfig::getTTCciConfigurationFile |
( |
| ) |
const |
|
inline |
void ODTTCciConfig::prepareWrite |
( |
| ) |
|
|
overrideprivatevirtualnoexcept |
Implements IODConfig.
Definition at line 58 of file ODTTCciConfig.cc.
References gather_cfg::cout, alignCSCRings::e, and AlCaHLTBitMon_QueryRunRegistry::string.
66 "INSERT INTO ECAL_TTCci_CONFIGURATION (ttcci_configuration_id, ttcci_tag, "
67 " TTCCI_configuration_file, TRG_MODE, TRG_SLEEP, Configuration, configuration_script, "
68 "configuration_script_params ) "
69 "VALUES (:1, :2, :3, :4, :5, :6, :7, :8 )");
79 oracle::occi::Clob clob(
m_conn);
86 std::cout <<
"TTCci Clob inserted into CONFIGURATION with id=" << next_id << std::endl;
91 "SELECT Configuration FROM ECAL_TTCci_CONFIGURATION WHERE"
92 " ttcci_configuration_id=:1 FOR UPDATE");
94 std::cout <<
"updating the clob 0" << std::endl;
97 throw(std::runtime_error(
std::string(
"ODTTCciConfig::prepareWrite(): ") + e.getMessage()));
100 std::cout <<
"updating the clob 1 " << std::endl;
oracle::occi::Connection * m_conn
std::string getConfigurationScript() const
void checkConnection() const noexcept(false)
std::string getTTCciConfigurationFile() const
std::string getConfigurationScriptParams() const
int fetchNextId() noexcept(false)
oracle::occi::SQLException SQLException
std::string getConfigTag()
std::string getTrgMode() const
void ODTTCciConfig::setConfigurationScript |
( |
std::string |
x | ) |
|
|
inline |
void ODTTCciConfig::setConfigurationScriptParams |
( |
std::string |
x | ) |
|
|
inline |
void ODTTCciConfig::setId |
( |
int |
id | ) |
|
|
inline |
void ODTTCciConfig::setParameters |
( |
const std::map< std::string, std::string > & |
my_keys_map | ) |
|
Definition at line 103 of file ODTTCciConfig.cc.
References gather_cfg::cout, dataset::end, alignmentValidation::fname, and AlCaHLTBitMon_QueryRunRegistry::string.
107 for (std::map<std::string, std::string>::const_iterator ci = my_keys_map.begin(); ci != my_keys_map.end(); ci++) {
108 if (ci->first ==
"TRG_MODE")
110 if (ci->first ==
"TRG_SLEEP")
112 if (ci->first ==
"TTCci_CONFIGURATION_ID")
114 if (ci->first ==
"CONFIGURATION_SCRIPT")
116 if (ci->first ==
"CONFIGURATION_SCRIPT_PARAMS")
118 if (ci->first ==
"CONFIGURATION_SCRIPT_PARAMETERS")
120 if (ci->first ==
"Configuration") {
125 pos = fname.find(
'=');
127 str3 = fname.substr(pos + 1, pose - pos - 2);
129 cout <<
"fname=" << fname <<
" and reduced is: " << str3 << endl;
133 std::cout <<
"Going to read file: " << str3 << endl;
136 inpFile.open(str3.c_str());
141 bufsize = inpFile.tellg();
142 std::cout <<
" bufsize =" << bufsize << std::endl;
144 inpFile.seekg(0, ios::beg);
void setConfigurationScript(std::string x)
void setTTCciConfigurationFile(std::string x)
void setTrgMode(std::string x)
void setConfigurationScriptParams(std::string x)
void setConfigTag(std::string x)
void ODTTCciConfig::setSize |
( |
unsigned int |
id | ) |
|
|
inline |
void ODTTCciConfig::setTrgMode |
( |
std::string |
x | ) |
|
|
inline |
void ODTTCciConfig::setTrgSleep |
( |
int |
id | ) |
|
|
inline |
void ODTTCciConfig::setTTCciClob |
( |
unsigned char * |
x | ) |
|
|
inline |
void ODTTCciConfig::setTTCciConfigurationFile |
( |
std::string |
x | ) |
|
|
inline |
void ODTTCciConfig::writeDB |
( |
| ) |
|
|
privatenoexcept |
Definition at line 152 of file ODTTCciConfig.cc.
References gather_cfg::cout, alignCSCRings::e, and AlCaHLTBitMon_QueryRunRegistry::string.
153 std::cout <<
"updating the clob 2" << std::endl;
159 while (rset->next()) {
160 oracle::occi::Clob clob = rset->getClob(1);
161 cout <<
"Opening the clob in read write mode" << endl;
162 cout <<
"Populating the clob" << endl;
164 int clobLength = clob.length();
165 cout <<
"Length of the clob is: " << clobLength << endl;
174 throw(std::runtime_error(
std::string(
"ODTTCciConfig::writeDB(): ") + e.getMessage()));
178 throw(std::runtime_error(
"ODTTCciConfig::writeDB: Failed to write"));
void populateClob(Clob &clob, std::string fname, unsigned int bufsize) noexcept(false)
std::string getTTCciConfigurationFile() const
int fetchID() noexcept(false)
oracle::occi::SQLException SQLException
std::string ODTTCciConfig::m_configuration_script |
|
private |
std::string ODTTCciConfig::m_configuration_script_params |
|
private |
int ODTTCciConfig::m_size |
|
private |
std::string ODTTCciConfig::m_trg_mode |
|
private |
int ODTTCciConfig::m_trg_sleep |
|
private |
unsigned char* ODTTCciConfig::m_ttcci_clob |
|
private |
std::string ODTTCciConfig::m_ttcci_file |
|
private |