#ifndef DBIEXCEPTION
#define DBIEXCEPTION
/**
*
*
* \class COMET::IDbiException
*
*
* \brief
* Concept An object that records a single database exception.
*
* \brief
* PurposeTo provide a place to record an exception. Currently
* it is embedded in TSQLServer and TSQStatement. Each exception has an associated message string
* and error code.
*
* Contact: A.Finch@lancaster.ac.uk
*
*
*/
#include
#include
#include "Rtypes.h"
namespace COMET {
class IDbiException;
}
class TSQLServer;
class TSQLStatement;
class ostreamx;
std::ostream& operator<<(std::ostream& s, const COMET::IDbiException& e);
namespace COMET {
class IDbiException
{
public:
IDbiException(const char* msg = 0, Int_t code = -1);
IDbiException(const TSQLServer& server);
IDbiException(const TSQLStatement& statement);
IDbiException(const IDbiException& that);
virtual ~IDbiException();
// State testing member functions
const std::string & GetMessage() const { return fMessage; }
Int_t GetErrorCode() const { return fErrorCode; }
private:
// Data members
private:
/// The message associated with the exception.
std::string fMessage;
/// The exception error code.
Int_t fErrorCode;
ClassDef(IDbiException,0) // Object to hold a single database exception record.
};
};
#endif // DBIEXCEPTIONLOG