#include <IODConfig.h>
Public Types | |
typedef oracle::occi::Clob | Clob |
typedef oracle::occi::SQLException | SQLException |
typedef oracle::occi::Statement | Statement |
typedef oracle::occi::Stream | Stream |
Public Member Functions | |
std::string | getConfigTag () |
virtual std::string | getTable ()=0 |
void | setConfigTag (std::string x) |
Public Attributes | |
std::string | m_config_tag |
Protected Member Functions | |
void | checkPrepare () throw (std::runtime_error) |
void | createReadStatement () throw (std::runtime_error) |
void | populateClob (Clob &clob, std::string fname, unsigned int bufsize) throw (std::runtime_error) |
virtual void | prepareWrite ()=0 throw (std::runtime_error) |
unsigned char * | readClob (Clob &clob, int size) throw (std::runtime_error) |
void | setPrefetchRowCount (int ncount) throw (std::runtime_error) |
void | terminateReadStatement () throw (std::runtime_error) |
void | terminateWriteStatement () throw (std::runtime_error) |
Protected Attributes | |
Statement * | m_readStmt |
Statement * | m_writeStmt |
Abstract interface for data in the conditions DB
Definition at line 19 of file IODConfig.h.
typedef oracle::occi::Clob IODConfig::Clob |
Definition at line 25 of file IODConfig.h.
Definition at line 22 of file IODConfig.h.
typedef oracle::occi::Statement IODConfig::Statement |
Definition at line 23 of file IODConfig.h.
typedef oracle::occi::Stream IODConfig::Stream |
Definition at line 24 of file IODConfig.h.
void IODConfig::checkPrepare | ( | ) | throw (std::runtime_error) [inline, protected] |
Definition at line 39 of file IODConfig.h.
References m_writeStmt, and NULL.
{ if (m_writeStmt == NULL) { throw(std::runtime_error("Write statement not prepared")); } }
void IODConfig::createReadStatement | ( | ) | throw (std::runtime_error) [inline, protected] |
Definition at line 58 of file IODConfig.h.
References IDBObject::m_conn, and m_readStmt.
{ m_readStmt=m_conn->createStatement(); }
std::string IODConfig::getConfigTag | ( | ) | [inline] |
virtual std::string IODConfig::getTable | ( | ) | [pure virtual] |
Implemented in FEConfigBadStripDat, FEConfigBadStripInfo, FEConfigBadTTDat, FEConfigBadTTInfo, FEConfigBadXTDat, FEConfigBadXTInfo, FEConfigFgrInfo, FEConfigLinInfo, FEConfigLUTInfo, FEConfigMainInfo, FEConfigPedInfo, FEConfigSlidingInfo, FEConfigSpikeInfo, FEConfigTimingInfo, FEConfigWeightInfo, ODBadTTDat, ODBadTTInfo, ODBadXTDat, ODBadXTInfo, ODCCSConfig, ODCCSCycle, ODCond2ConfInfo, ODDCCConfig, ODDCCCycle, ODDCUConfig, ODDCUCycle, ODDelaysDat, ODEcalCycle, ODFEDAQConfig, ODFEDelaysInfo, ODFEPedestalOffsetInfo, ODFEWeightsInfo, ODGolBiasCurrentDat, ODGolBiasCurrentInfo, ODJBH4Config, ODJBH4Cycle, ODLaserConfig, ODLaserCycle, ODLTCConfig, ODLTCCycle, ODLTSConfig, ODLTSCycle, ODPedestalOffsetsDat, ODRunConfigCycleInfo, ODRunConfigInfo, ODRunConfigSeqInfo, ODScanConfig, ODScanCycle, ODSRPConfig, ODSRPCycle, ODTCCConfig, ODTCCCycle, ODTCCEEConfig, ODTCCEECycle, ODTowersToByPassDat, ODTowersToByPassInfo, ODTTCciConfig, ODTTCciCycle, ODTTCFConfig, ODTTCFCycle, ODVfeToRejectDat, ODVfeToRejectInfo, ODWeightsDat, and ODWeightsSamplesDat.
void IODConfig::populateClob | ( | Clob & | clob, |
std::string | fname, | ||
unsigned int | bufsize | ||
) | throw (std::runtime_error) [inline, protected] |
Definition at line 88 of file IODConfig.h.
References gather_cfg::cout, alignCSCRings::e, end, mergeVDriftHistosByStation::file, recoMuon::in, findQualityFiles::size, and AlCaHLTBitMon_QueryRunRegistry::string.
{ try{ // Uses stream here std::cout << "Populating the Clob using writeBuffer(Stream) method" << std::endl; std::cout<<"we are here0"<<std::endl; char *file = (char *)fname.c_str(); std::cout<<"we are here0.5 file is:"<<fname<<std::endl; std::ifstream inFile; inFile.open(file,std::ios::in); if (!inFile) { std::cout << fname <<" file not found\n"; inFile.close(); std::string fname2="/nfshome0/ecaldev/francesca/null_file.txt"; inFile.open((char*)fname2.c_str(),std::ios::in); } if(bufsize==0){ inFile.seekg( 0,std::ios::end ); bufsize = inFile.tellg(); std::cout <<" bufsize ="<<bufsize<< std::endl; // set file pointer to start again inFile.seekg( 0,std::ios::beg ); } char *buffer = new char[bufsize + 1]; std::cout<<"we are here1"<<std::endl; unsigned int size; Stream *strm=clob.getStream(); std::cout<<"we are here2"<<std::endl; // while(inFile) // { int buf=0; memset (buffer, buf, bufsize + 1); inFile.read(buffer,bufsize); std::cout<<"we are here2.5"<<std::endl; strm->writeBuffer(buffer,strlen(buffer)); std::cout<<"we are here2.6"<<std::endl; //} std::cout<<"we are here3"<<std::endl; strcpy(buffer," "); size=strlen(buffer); strm->writeLastBuffer(buffer,size); clob.closeStream(strm); inFile.close(); std::cout<<"we are here4"<<std::endl; delete[] buffer; }catch (SQLException &e) { throw(std::runtime_error("populateClob(): "+e.getMessage())); } std::cout << "Populating the Clob - Success" << std::endl; }
virtual void IODConfig::prepareWrite | ( | ) | throw (std::runtime_error) [protected, pure virtual] |
Implemented in FEConfigBadStripDat, FEConfigBadStripInfo, FEConfigBadTTDat, FEConfigBadTTInfo, FEConfigBadXTDat, FEConfigBadXTInfo, FEConfigFgrInfo, FEConfigLinInfo, FEConfigLUTInfo, FEConfigMainInfo, FEConfigPedInfo, FEConfigSlidingInfo, FEConfigSpikeInfo, FEConfigTimingInfo, FEConfigWeightInfo, ODBadTTDat, ODBadTTInfo, ODBadXTDat, ODBadXTInfo, ODCCSConfig, ODCCSCycle, ODCond2ConfInfo, ODDCCConfig, ODDCCCycle, ODDCUConfig, ODDCUCycle, ODDelaysDat, ODEcalCycle, ODFEDAQConfig, ODFEDelaysInfo, ODFEPedestalOffsetInfo, ODFEWeightsInfo, ODGolBiasCurrentDat, ODGolBiasCurrentInfo, ODJBH4Config, ODJBH4Cycle, ODLaserConfig, ODLaserCycle, ODLTCConfig, ODLTCCycle, ODLTSConfig, ODLTSCycle, ODPedestalOffsetsDat, ODRunConfigCycleInfo, ODRunConfigInfo, ODRunConfigSeqInfo, ODScanConfig, ODScanCycle, ODSRPConfig, ODSRPCycle, ODTCCConfig, ODTCCCycle, ODTCCEEConfig, ODTCCEECycle, ODTowersToByPassDat, ODTowersToByPassInfo, ODTTCciConfig, ODTTCciCycle, ODTTCFConfig, ODTTCFCycle, ODVfeToRejectDat, ODVfeToRejectInfo, ODWeightsDat, and ODWeightsSamplesDat.
unsigned char* IODConfig::readClob | ( | Clob & | clob, |
int | size | ||
) | throw (std::runtime_error) [inline, protected] |
Definition at line 160 of file IODConfig.h.
References gather_cfg::cout, alignCSCRings::e, i, and findQualityFiles::size.
{ try{ Stream *instream = clob.getStream (1,0); unsigned char *buffer= new unsigned char[size]; int buf=0; memset (buffer, buf, size); instream->readBuffer ((char*)buffer, size); std::cout << "remember to delete the char* at the end of the program "; for (int i = 0; i < size; ++i) std::cout << (char) buffer[i]; std::cout << std::endl; clob.closeStream (instream); return buffer; }catch (SQLException &e) { throw(std::runtime_error("readClob(): "+e.getMessage())); } }
void IODConfig::setConfigTag | ( | std::string | x | ) | [inline] |
Definition at line 31 of file IODConfig.h.
References m_config_tag, and x.
Referenced by EcalTPGParamBuilder::analyze(), popcon::EcalTPGFineGrainEBGroupHandler::getNewObjects(), popcon::EcalTPGFineGrainTowerEEHandler::getNewObjects(), popcon::EcalTPGWeightGroupHandler::getNewObjects(), popcon::EcalTPGBadXTHandler::getNewObjects(), popcon::EcalTPGWeightIdMapHandler::getNewObjects(), popcon::EcalTPGBadTTHandler::getNewObjects(), popcon::EcalTPGSpikeThresholdHandler::getNewObjects(), popcon::EcalTPGPedestalsHandler::getNewObjects(), popcon::EcalTPGSlidingWindowHandler::getNewObjects(), popcon::EcalTPGFineGrainEBIdMapHandler::getNewObjects(), popcon::EcalTPGPhysicsConstHandler::getNewObjects(), popcon::EcalTPGLinConstHandler::getNewObjects(), popcon::EcalTPGLutIdMapHandler::getNewObjects(), popcon::EcalTPGBadStripHandler::getNewObjects(), popcon::EcalTPGFineGrainStripEEHandler::getNewObjects(), popcon::EcalTPGLutGroupHandler::getNewObjects(), EcalTPGDBApp::writeToConfDB_Delay(), EcalTPGDBApp::writeToConfDB_Spike(), EcalTPGDBApp::writeToConfDB_TPGFgr(), EcalTPGDBApp::writeToConfDB_TPGLinearCoef(), EcalTPGDBApp::writeToConfDB_TPGLUT(), EcalTPGDBApp::writeToConfDB_TPGMain(), EcalTPGDBApp::writeToConfDB_TPGPedestals(), EcalTPGDBApp::writeToConfDB_TPGSliding(), EcalTPGDBApp::writeToConfDB_TPGWeight(), and EcalDccWeightBuilder::writeWeightToDB().
{m_config_tag=x;}
void IODConfig::setPrefetchRowCount | ( | int | ncount | ) | throw (std::runtime_error) [inline, protected] |
Definition at line 64 of file IODConfig.h.
References m_readStmt.
{ m_readStmt->setPrefetchRowCount(ncount); }
void IODConfig::terminateReadStatement | ( | ) | throw (std::runtime_error) [inline, protected] |
Definition at line 70 of file IODConfig.h.
References gather_cfg::cout, IDBObject::m_conn, m_readStmt, and NULL.
{ if (m_readStmt != NULL) { m_conn->terminateStatement(m_readStmt); } else { std::cout << "Warning from IDataItem: statement was aleady closed"<< std::endl; } }
void IODConfig::terminateWriteStatement | ( | ) | throw (std::runtime_error) [inline, protected] |
Definition at line 47 of file IODConfig.h.
References gather_cfg::cout, IDBObject::m_conn, m_writeStmt, and NULL.
{ if (m_writeStmt != NULL) { m_conn->terminateStatement(m_writeStmt); } else { std::cout << "Warning from IDataItem: statement was aleady closed"<< std::endl; } }
std::string IODConfig::m_config_tag |
Definition at line 27 of file IODConfig.h.
Referenced by getConfigTag(), and setConfigTag().
Statement* IODConfig::m_readStmt [protected] |
Definition at line 37 of file IODConfig.h.
Referenced by createReadStatement(), setPrefetchRowCount(), and terminateReadStatement().
Statement* IODConfig::m_writeStmt [protected] |
Definition at line 36 of file IODConfig.h.
Referenced by checkPrepare(), and terminateWriteStatement().