CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
cond::SQLReport Class Reference

#include <SQLReport.h>

Public Member Functions

bool putOnFile (std::string fileName=std::string(""))
 
void reportForConnection (const std::string &connectionString)
 
 SQLReport (DbConnection &connection)
 
virtual ~SQLReport ()
 

Private Member Functions

 SQLReport ()
 

Private Attributes

DbConnection m_connection
 
std::stringstream m_report
 

Detailed Description

Definition at line 11 of file SQLReport.h.

Constructor & Destructor Documentation

cond::SQLReport::SQLReport ( DbConnection connection)
inlineexplicit

Definition at line 35 of file SQLReport.h.

35  :m_connection(connection),m_report(){
36 }
std::stringstream m_report
Definition: SQLReport.h:29
DbConnection m_connection
Definition: SQLReport.h:27
virtual cond::SQLReport::~SQLReport ( )
inlinevirtual

Definition at line 17 of file SQLReport.h.

17 {}
cond::SQLReport::SQLReport ( )
private

Member Function Documentation

bool cond::SQLReport::putOnFile ( std::string  fileName = std::string(""))

Definition at line 13 of file SQLReport.cc.

References edm::hlt::Exception, lumiQueryAPI::msg, and SQLREPORT_DEFAULT_FILENAME.

Referenced by cond::Utilities::run().

13  {
14  std::ofstream outFile;
15  if(fileName.empty()) fileName.append(SQLREPORT_DEFAULT_FILENAME);
16  outFile.open(fileName.c_str());
17  if(!outFile.good()){
18  std::stringstream msg;
19  msg << "Cannot open the output file \""<<fileName<<"\"";
20  outFile.close();
21  throw cond::Exception(msg.str());
22  }
23  outFile << m_report.str();
24  outFile.flush();
25  outFile.close();
26  return true;
27 }
std::stringstream m_report
Definition: SQLReport.h:29
constexpr char SQLREPORT_DEFAULT_FILENAME[]
Definition: SQLReport.cc:6
void cond::SQLReport::reportForConnection ( const std::string &  connectionString)

Definition at line 8 of file SQLReport.cc.

References m_connection, m_report, and cond::DbConnection::monitoringReporter().

Referenced by cond::Utilities::run().

8  {
9  m_report << "-- connection: "<< connectionString << std::endl;
10  m_connection.monitoringReporter().reportToOutputStream( connectionString, m_report );
11 }
std::stringstream m_report
Definition: SQLReport.h:29
const coral::IMonitoringReporter & monitoringReporter() const
DbConnection m_connection
Definition: SQLReport.h:27

Member Data Documentation

DbConnection cond::SQLReport::m_connection
private

Definition at line 27 of file SQLReport.h.

Referenced by reportForConnection().

std::stringstream cond::SQLReport::m_report
private

Definition at line 29 of file SQLReport.h.

Referenced by reportForConnection().