// $Id: IDbiExceptionLog.cxx,v 1.1 2011/01/18 05:49:19 finch Exp $ ////////////////////////////////////////////////////////////////////////// //////////////////////////// ROOT API //////////////////////////// ////////////////////////////////////////////////////////////////////////// #include #include "IDbiExceptionLog.hxx" #include #include using std::endl; ClassImp(COMET::IDbiExceptionLog) // Definition of static data members // ********************************* COMET::IDbiExceptionLog COMET::IDbiExceptionLog::fgGELog; // Definition of all member functions (static or otherwise) // ******************************************************* // // - ordered: ctors, dtor, operators then in alphabetical order. //..................................................................... COMET::IDbiExceptionLog::IDbiExceptionLog(const COMET::IDbiException* e) { COMETTrace( "Creating COMET::IDbiExceptionLog" << " "); if ( e ) this->AddEntry(*e); } //..................................................................... COMET::IDbiExceptionLog::~IDbiExceptionLog() { COMETTrace( "Destroying COMET::IDbiExceptionLog" << " "); } //..................................................................... std::ostream& operator<<(std::ostream& os, const COMET::IDbiExceptionLog& el) { if ( el.IsEmpty() ) { os << "The database exception log is empty" << endl; } else { os << "Database exception log:-" << endl; std::vector::const_iterator itr(el.GetEntries().begin()), itrEnd(el.GetEntries().end()); while ( itr != itrEnd ) { os << *itr << endl; ++itr; } } return os; } //..................................................................... /// /// /// Purpose: Add all entries from el. void COMET::IDbiExceptionLog::AddLog(const COMET::IDbiExceptionLog& el) { const std::vector& ve = el.GetEntries(); std::vector::const_iterator itr(ve.begin()), itrEnd(ve.end()); while ( itr != itrEnd ) this->AddEntry(*itr++); } //..................................................................... /// Purpose: Copy exception log starting at 'start' (default 0) void COMET::IDbiExceptionLog::Copy(COMET::IDbiExceptionLog& that, UInt_t start) const { // // UInt_t maxEntry = fEntries.size(); while (start <= maxEntry ) that.AddEntry(fEntries[start++]); } //..................................................................... /// Purpose: Print contents to cout. void COMET::IDbiExceptionLog::Print () const { // // std::cout << *this << std::endl; }