Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

Sct::AbstractThrowable Class Reference
[Exceptions]

A base implementation for Throwable All important information should be included in the string returned by getMessage(). More...

#include <Exception.h>

Inheritance diagram for Sct::AbstractThrowable:

Sct::Throwable exception Sct::Error Sct::Exception Sct::LogicError Sct::MathsError Sct::ConfigurationException Sct::IoException Sct::IpcObjectException Sct::StdExceptionWrapper Sct::IllegalStateError Sct::InvalidArgumentError Sct::InvariantViolatedError Sct::OutOfRangeError< T > Sct::UnsupportedOperationError Sct::FileException Sct::IpcException Sct::IsException Sct::NoSuchStreamerException Sct::StreamCorruptedException Sct::VersionNotSupportedException

Public Member Functions

virtual ~AbstractThrowable () throw ()
virtual long sendToMrs (SEVERITY s) throw ()
 Send the message to the message reporting service.

virtual long sendToMrs () const throw ()
 Send the message to the message reporting service.

virtual void setSeverity (SEVERITY s) throw ()
 Set the severity of this exception.

virtual SEVERITY getSeverity () const throw ()
 Get the severity.

virtual const char * what () const throw ()
 Override of std::exception::what().

virtual const ThrowablegetCause () const throw ()
 Get the cause.

virtual shared_ptr< Throwableclone () const throw ()
 Necessary for chaining of exceptions unfortunately.


Protected Member Functions

 AbstractThrowable () throw ()
 To ease implementation in long exception hierarchies, sub-classes can provide a default constructor then must use the initialize method in all substansive constructors.

virtual string getMessage () const throw ()
 Gets the detail message for this.

void initialize (const string &id, const string &name, const string &msg, Throwable *cause, const string &file, int line) throw ()

Protected Attributes

string id
string name
string msg
string file
int line
SEVERITY severity
shared_ptr< Throwablecause
string text

Detailed Description

A base implementation for Throwable All important information should be included in the string returned by getMessage().

An exception should not rely on adding extra parameters to an MRS message as if it is nested, it won't get this opportunity.

If a sub-class has its own data members or overrides any methods then it should override the clone() method also. Most sub-classes will probably just provide constuctors in the same pattern as shown for the Error and Exception classes.

Definition at line 93 of file Exception.h.


Constructor & Destructor Documentation

virtual Sct::AbstractThrowable::~AbstractThrowable   throw () [inline, virtual]
 

Definition at line 95 of file Exception.h.

Sct::AbstractThrowable::AbstractThrowable   throw () [protected]
 

To ease implementation in long exception hierarchies, sub-classes can provide a default constructor then must use the initialize method in all substansive constructors.

Definition at line 13 of file Exception.cpp.


Member Function Documentation

shared_ptr< Throwable > Sct::AbstractThrowable::clone   const throw () [virtual]
 

Necessary for chaining of exceptions unfortunately.

Should return a copy of this allocated on the heap. It is necessary for sub-classes to override this if they add new data members or if they do and special processing in what() or sentToMrs()

Implements Sct::Throwable.

Reimplemented in Sct::IsException, Sct::FileException, Sct::NoSuchStreamerException, Sct::IpcException, and Sct::OutOfRangeError< T >.

Definition at line 60 of file Exception.cpp.

Referenced by SctAnalysis::AnalysisAlgorithmMap::getAlgorithm().

const Throwable * Sct::AbstractThrowable::getCause   const throw () [virtual]
 

Get the cause.

Returns:
a pointer to the cause of 0 if no cause

Implements Sct::Throwable.

Definition at line 56 of file Exception.cpp.

string Sct::AbstractThrowable::getMessage   const throw () [protected, virtual]
 

Gets the detail message for this.

Reimplemented in Sct::IsException, Sct::FileException, Sct::NoSuchStreamerException, Sct::IpcException, and Sct::OutOfRangeError< T >.

Definition at line 52 of file Exception.cpp.

SEVERITY Sct::AbstractThrowable::getSeverity   const throw () [virtual]
 

Get the severity.

Implements Sct::Throwable.

Definition at line 32 of file Exception.cpp.

void Sct::AbstractThrowable::initialize const string &    id,
const string &    name,
const string &    msg,
Throwable   cause,
const string &    file,
int    line
throw () [protected]
 

Definition at line 64 of file Exception.cpp.

Referenced by Sct::ConfigurationException::ConfigurationException(), Sct::IpcObjectException::IpcObjectException(), Sct::MathsError::MathsError(), SctCalibrationController::Ipc::RequestException::RequestException(), SctCalibrationController::SctApiException::SctApiException(), Sct::StdExceptionWrapper::StdExceptionWrapper(), Sct::UnsupportedOperationError::UnsupportedOperationError(), and Sct::VersionNotSupportedException::VersionNotSupportedException().

long Sct::AbstractThrowable::sendToMrs   const throw () [virtual]
 

Send the message to the message reporting service.

Returns:
the MRS status information. (See mrs/message.h)

Implements Sct::Throwable.

Definition at line 21 of file Exception.cpp.

long Sct::AbstractThrowable::sendToMrs SEVERITY    s throw () [virtual]
 

Send the message to the message reporting service.

If you override this you should also override the clone method.

Parameters:
s the SEVERITY of the exception (see mrs/message.h)
Returns:
the MRS status information. (See mrs/message.h)

Implements Sct::Throwable.

Definition at line 16 of file Exception.cpp.

Referenced by Sct::Terminate(), and Sct::Unexpected().

void Sct::AbstractThrowable::setSeverity SEVERITY    s throw () [virtual]
 

Set the severity of this exception.

Parameters:
s the SEVERITY of the exception (see mrs/message.h)

Implements Sct::Throwable.

Definition at line 28 of file Exception.cpp.

Referenced by SctFitter::FitAlgorithmMap::getAlgorithm(), and SctAnalysis::AnalysisAlgorithmMap::getAlgorithm().

const char * Sct::AbstractThrowable::what   const throw () [virtual]
 

Override of std::exception::what().

Returns hasCause() ? msg + " by:
" + cause.msg : msg; If you override this you should also override the clone method.

Definition at line 36 of file Exception.cpp.

Referenced by SctCalibrationController::CalibrationControllerImpl::sctApiError().


Field Documentation

shared_ptr<Throwable> Sct::AbstractThrowable::cause [protected]
 

Definition at line 143 of file Exception.h.

string Sct::AbstractThrowable::file [protected]
 

Definition at line 140 of file Exception.h.

string Sct::AbstractThrowable::id [protected]
 

Definition at line 137 of file Exception.h.

int Sct::AbstractThrowable::line [protected]
 

Definition at line 141 of file Exception.h.

string Sct::AbstractThrowable::msg [protected]
 

Definition at line 139 of file Exception.h.

string Sct::AbstractThrowable::name [protected]
 

Definition at line 138 of file Exception.h.

SEVERITY Sct::AbstractThrowable::severity [protected]
 

Definition at line 142 of file Exception.h.

string Sct::AbstractThrowable::text [mutable, protected]
 

Definition at line 145 of file Exception.h.


The documentation for this class was generated from the following files:
Generated on Mon Dec 15 19:37:16 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3