Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DbiExceptionLog Class Reference

Concept An object that records database exceptions PurposeTo provide a place to record 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 More...

#include <DbiExceptionLog.h>

List of all members.

Public Member Functions

 DbiExceptionLog (const DbiException *e=0)
virtual ~DbiExceptionLog ()
Bool_t IsEmpty () const
const std::vector< DbiException > & GetEntries () const
void Print () const
UInt_t Size () const
void Copy (DbiExceptionLog &that, UInt_t start=0) const
void AddLog (const DbiExceptionLog &el)
void AddEntry (const DbiException &e)
void AddEntry (const char *errMsg, Int_t code=-1, Int_t dbType=-1)
void AddEntry (const std::string &errMsg, Int_t code=-1, Int_t dbType=-1)
void AddEntry (const TSQLServer &server, Int_t dbType=-1)
void AddEntry (const TSQLStatement &statement, Int_t dbType=-1)
void Clear ()

Static Public Member Functions

DbiExceptionLogGetGELog ()

Private Attributes

std::vector< DbiExceptionfEntries
 The exception entries.

Static Private Attributes

DbiExceptionLog fgGELog
 Global Exception Log.


Detailed Description

Concept An object that records database exceptions PurposeTo provide a place to record 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

Id
DbiExceptionLog.h,v 1.5 2007/04/26 14:19:57 west Exp

DatabaseInterface

Contact: n.west1@physics.ox.ac.uk

Definition at line 44 of file DbiExceptionLog.h.


Constructor & Destructor Documentation

DbiExceptionLog::DbiExceptionLog const DbiException e = 0  ) 
 

Definition at line 30 of file DbiExceptionLog.cxx.

References LEA_CTOR, and MSG.

00030                                                       {
00031 
00032   LEA_CTOR    //Leak Checker
00033   MSG("Dbi", Msg::kVerbose) << "Creating DbiExceptionLog" << endl;
00034   if ( e ) this->AddEntry(*e);
00035 
00036 }

DbiExceptionLog::~DbiExceptionLog  )  [virtual]
 

Definition at line 40 of file DbiExceptionLog.cxx.

References LEA_DTOR, and MSG.

00040                                   {
00041 
00042 
00043   LEA_DTOR    //Leak Checker
00044   MSG("Dbi", Msg::kVerbose) << "Destroying DbiExceptionLog" << endl;
00045 
00046 }


Member Function Documentation

void DbiExceptionLog::AddEntry const TSQLStatement &  statement,
Int_t  dbType = -1
[inline]
 

Definition at line 71 of file DbiExceptionLog.h.

00071                                                                   {
00072    this->AddEntry(DbiException(statement,dbType));}

void DbiExceptionLog::AddEntry const TSQLServer &  server,
Int_t  dbType = -1
[inline]
 

Definition at line 69 of file DbiExceptionLog.h.

References server.

00069                                                             {
00070    this->AddEntry(DbiException(server,dbType));}

void DbiExceptionLog::AddEntry const std::string &  errMsg,
Int_t  code = -1,
Int_t  dbType = -1
[inline]
 

Definition at line 67 of file DbiExceptionLog.h.

00067                                                                             {
00068    this->AddEntry(DbiException(errMsg.c_str(),code,dbType));}

void DbiExceptionLog::AddEntry const char *  errMsg,
Int_t  code = -1,
Int_t  dbType = -1
[inline]
 

Definition at line 65 of file DbiExceptionLog.h.

00065                                                                        {
00066    this->AddEntry(DbiException(errMsg,code,dbType));}

void DbiExceptionLog::AddEntry const DbiException e  )  [inline]
 

Definition at line 64 of file DbiExceptionLog.h.

Referenced by AddLog(), Copy(), DbiConnection::CreatePreparedStatement(), DbiStatement::ExecuteQuery(), DbiAsciiTablePreparer::GET(), DbiAsciiTablePreparer::Init(), DbiConnection::Open(), and DbiConnection::RecordException().

00064 { fEntries.push_back(e); }

void DbiExceptionLog::AddLog const DbiExceptionLog el  ) 
 

Definition at line 71 of file DbiExceptionLog.cxx.

References AddEntry(), and GetEntries().

Referenced by DbiStatement::PrintExceptions().

00071                                                       {
00072 //
00073 //
00074 //  Purpose:  Add all entries from el.
00075 
00076   const std::vector<DbiException>& ve = el.GetEntries();
00077   std::vector<DbiException>::const_iterator itr(ve.begin()), itrEnd(ve.end());
00078   while ( itr != itrEnd ) this->AddEntry(*itr++);
00079 
00080 }

void DbiExceptionLog::Clear  )  [inline]
 

Definition at line 73 of file DbiExceptionLog.h.

Referenced by DbiResult::CaptureExceptionLog().

00073 { fEntries.clear(); }

void DbiExceptionLog::Copy DbiExceptionLog that,
UInt_t  start = 0
const
 

Definition at line 84 of file DbiExceptionLog.cxx.

References AddEntry(), and fEntries.

Referenced by DbiResult::CaptureExceptionLog().

00084                                                                     {
00085 //
00086 //
00087 //  Purpose: Copy exception log starting at 'start' (default 0)
00088 
00089   UInt_t maxEntry = fEntries.size();
00090   while (start <= maxEntry ) that.AddEntry(fEntries[start++]);
00091 
00092 }

const std::vector<DbiException>& DbiExceptionLog::GetEntries  )  const [inline]
 

Definition at line 56 of file DbiExceptionLog.h.

Referenced by AddLog(), and operator<<().

00056 { return fEntries; }

DbiExceptionLog& DbiExceptionLog::GetGELog  )  [inline, static]
 

Definition at line 76 of file DbiExceptionLog.h.

Referenced by DbiResult::CaptureExceptionLog(), DbiStatement::PrintExceptions(), DbiTableProxy::Query(), and DbiTableProxyRegistry::~DbiTableProxyRegistry().

00076 { return fgGELog;}

Bool_t DbiExceptionLog::IsEmpty  )  const [inline]
 

Definition at line 54 of file DbiExceptionLog.h.

Referenced by DbiStatement::ExecuteQuery(), DbiStatement::ExecuteUpdate(), operator<<(), and DbiCascader::Lock::SetLock().

00054 { return fEntries.size() == 0; }

void DbiExceptionLog::Print  )  const
 

Definition at line 95 of file DbiExceptionLog.cxx.

Referenced by DbiTableProxyRegistry::~DbiTableProxyRegistry().

00095                                    {
00096 //
00097 //
00098 //  Purpose:  Print contents to cout.
00099 
00100   std::cout << *this << std::endl;
00101 
00102 }

UInt_t DbiExceptionLog::Size void   )  const [inline]
 

Definition at line 58 of file DbiExceptionLog.h.

Referenced by DbiConnection::PrintExceptionLog(), DbiTableProxy::Query(), and DbiTableProxyRegistry::~DbiTableProxyRegistry().

00058 { return fEntries.size(); }


Member Data Documentation

std::vector<DbiException> DbiExceptionLog::fEntries [private]
 

The exception entries.

Definition at line 86 of file DbiExceptionLog.h.

Referenced by Copy().

DbiExceptionLog DbiExceptionLog::fgGELog [static, private]
 

Global Exception Log.

Definition at line 21 of file DbiExceptionLog.cxx.


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:09:03 2010 for loon by  doxygen 1.3.9.1