Concept An object that records database exceptions More...
#include <TDbiExceptionLog.hxx>
Public Member Functions | |
TDbiExceptionLog (const TDbiException *e=0) | |
virtual | ~TDbiExceptionLog () |
Bool_t | IsEmpty () const |
const std::vector < TDbiException > & | GetEntries () const |
void | Print () const |
Purpose: Print contents to cout. | |
UInt_t | Size () const |
void | Copy (TDbiExceptionLog &that, UInt_t start=0) const |
Purpose: Copy exception log starting at 'start' (default 0). | |
void | AddLog (const TDbiExceptionLog &el) |
void | AddEntry (const TDbiException &e) |
void | AddEntry (const char *errMsg, Int_t code=-1) |
void | AddEntry (const std::string &errMsg, Int_t code=-1) |
void | AddEntry (const TSQLServer &server) |
void | AddEntry (const TSQLStatement &statement) |
void | Clear () |
Static Public Member Functions | |
static TDbiExceptionLog & | GetGELog () |
Private Attributes | |
std::vector< TDbiException > | fEntries |
The exception entries. | |
Static Private Attributes | |
static TDbiExceptionLog | fgGELog |
Global Exception Log. |
Concept An object that records database exceptions
PurposeTo provide a place to record (in memory) exceptions from the time they arise in the lower levels of the DBI and below until they can be analysed in the upper levels of the DBI and beyond. They are stored in a std::vector of TDbiException s Contact: A.Finch@lancaster.ac.uk
Definition at line 47 of file TDbiExceptionLog.hxx.
TDbiExceptionLog::TDbiExceptionLog | ( | const TDbiException * | e = 0 |
) |
TDbiExceptionLog::~TDbiExceptionLog | ( | ) | [virtual] |
Definition at line 39 of file TDbiExceptionLog.cxx.
References SK_DBI_Trace.
00039 { 00040 00041 00042 SK_DBI_Trace( "Destroying TDbiExceptionLog" << " "); 00043 00044 }
void TDbiExceptionLog::AddEntry | ( | const TSQLStatement & | statement | ) | [inline] |
Definition at line 74 of file TDbiExceptionLog.hxx.
References AddEntry().
00074 { 00075 this->AddEntry(TDbiException(statement));}
void TDbiExceptionLog::AddEntry | ( | const TSQLServer & | server | ) | [inline] |
Definition at line 72 of file TDbiExceptionLog.hxx.
References AddEntry().
00072 { 00073 this->AddEntry(TDbiException(server));}
void TDbiExceptionLog::AddEntry | ( | const std::string & | errMsg, | |
Int_t | code = -1 | |||
) | [inline] |
Definition at line 70 of file TDbiExceptionLog.hxx.
References AddEntry().
00070 { 00071 this->AddEntry(TDbiException(errMsg.c_str(),code));}
void TDbiExceptionLog::AddEntry | ( | const char * | errMsg, | |
Int_t | code = -1 | |||
) | [inline] |
Definition at line 68 of file TDbiExceptionLog.hxx.
References AddEntry().
00068 { 00069 this->AddEntry(TDbiException(errMsg,code));}
void TDbiExceptionLog::AddEntry | ( | const TDbiException & | e | ) | [inline] |
Definition at line 67 of file TDbiExceptionLog.hxx.
References fEntries.
Referenced by AddEntry(), AddLog(), TDbiStatement::AppendExceptionLog(), Copy(), TDbiConnection::CreatePreparedStatement(), TDbiStatement::ExecuteQuery(), TDbiAsciiTablePreparer::GET(), TDbiAsciiDbImporter::Import(), TDbiAsciiTablePreparer::Init(), TDbiAsciiDbImporter::LoadCatalog(), TDbiAsciiDbImporter::LoadTable(), TDbiConnection::Open(), and TDbiConnection::RecordException().
00067 { fEntries.push_back(e); }
void TDbiExceptionLog::AddLog | ( | const TDbiExceptionLog & | el | ) |
Purpose: Add all entries from el.
Definition at line 71 of file TDbiExceptionLog.cxx.
References AddEntry(), and GetEntries().
Referenced by TDbiStatement::AppendExceptionLog(), and TDbiAsciiDbImporter::LoadTable().
00071 { 00072 00073 const std::vector<TDbiException>& ve = el.GetEntries(); 00074 std::vector<TDbiException>::const_iterator itr(ve.begin()), itrEnd(ve.end()); 00075 while ( itr != itrEnd ) this->AddEntry(*itr++); 00076 00077 }
void TDbiExceptionLog::Clear | ( | ) | [inline] |
Definition at line 76 of file TDbiExceptionLog.hxx.
References fEntries.
Referenced by TDbiResultSet::CaptureExceptionLog(), TDbiStatement::ClearExceptionLog(), and TDbiConnection::ClearExceptionLog().
00076 { fEntries.clear(); }
void TDbiExceptionLog::Copy | ( | TDbiExceptionLog & | that, | |
UInt_t | start = 0 | |||
) | const |
Purpose: Copy exception log starting at 'start' (default 0).
Definition at line 81 of file TDbiExceptionLog.cxx.
References AddEntry(), and fEntries.
Referenced by TDbiResultSet::CaptureExceptionLog().
00081 { 00082 // 00083 // 00084 00085 00086 UInt_t maxEntry = fEntries.size(); 00087 while (start <= maxEntry ) that.AddEntry(fEntries[start++]); 00088 00089 }
const std::vector<TDbiException>& TDbiExceptionLog::GetEntries | ( | ) | const [inline] |
Definition at line 59 of file TDbiExceptionLog.hxx.
References fEntries.
Referenced by AddLog(), and operator<<().
00059 { return fEntries; }
static TDbiExceptionLog& TDbiExceptionLog::GetGELog | ( | ) | [inline, static] |
Definition at line 79 of file TDbiExceptionLog.hxx.
References fgGELog.
Referenced by TDbiResultSet::CaptureExceptionLog(), TDbiTableProxy::Query(), and TDbiDatabaseManager::~TDbiDatabaseManager().
00079 { return fgGELog;}
Bool_t TDbiExceptionLog::IsEmpty | ( | ) | const [inline] |
Definition at line 57 of file TDbiExceptionLog.hxx.
References fEntries.
Referenced by TDbiStatement::ExecuteQuery(), TDbiStatement::ExecuteUpdate(), TDbiAsciiDbImporter::LoadTable(), operator<<(), TDbiStatement::PrintExceptions(), and TDbiCascader::Lock::SetLock().
00057 { return fEntries.size() == 0; }
void TDbiExceptionLog::Print | ( | ) | const |
Purpose: Print contents to cout.
Definition at line 92 of file TDbiExceptionLog.cxx.
Referenced by TDbiDatabaseManager::~TDbiDatabaseManager().
UInt_t TDbiExceptionLog::Size | ( | ) | const [inline] |
Definition at line 61 of file TDbiExceptionLog.hxx.
References fEntries.
Referenced by TDbiConnection::PrintExceptionLog(), and TDbiTableProxy::Query().
00061 { return fEntries.size(); }
std::vector<TDbiException> TDbiExceptionLog::fEntries [private] |
The exception entries.
Definition at line 89 of file TDbiExceptionLog.hxx.
Referenced by AddEntry(), Clear(), Copy(), GetEntries(), IsEmpty(), and Size().
TDbiExceptionLog TDbiExceptionLog::fgGELog [static, private] |