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:

Inheritance graph
[legend]
Collaboration diagram for Sct::AbstractThrowable:

Collaboration graph
[legend]

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

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 14 of file Exception.cpp.

Referenced by clone().


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::CorbaExceptionWrapper, Sct::IsException, Sct::FileException, Sct::NoSuchStreamerException, and Sct::OutOfRangeError< T >.

Definition at line 65 of file Exception.cpp.

References AbstractThrowable().

Here is the call graph for this function:

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 61 of file Exception.cpp.

References cause.

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

Gets the detail message for this.

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

Definition at line 57 of file Exception.cpp.

References msg.

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

Get the severity.

Implements Sct::Throwable.

Definition at line 33 of file Exception.cpp.

References severity.

Referenced by sendToMrs().

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 22 of file Exception.cpp.

References getSeverity(), Sct::SctNames::Mrs(), msg, and what().

Here is the call graph for this function:

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 17 of file Exception.cpp.

Referenced by SctTest::Configuration::Configuration(), SctCalibrationController::RunControl::configureAction(), SctCalibrationController::CalibrationControllerImpl::executeSequence(), SctTest::HighLevelApi::HighLevelApi(), SctFitter::NagFitStrategy::nagFit(), SctTest::HighLevelApi::noiseOccupancy(), SctTest::HighLevelApi::pipeline(), SctCalibrationController::RunControl::prepareAction(), SctApi::readHistogramToIS(), SctTest::HighLevelApi::responseCurve(), SctCalibrationController::CalibrationControllerImpl::setUpdateOption(), SctTest::HighLevelApi::strobeDelay(), SctTest::HighLevelApi::threePointGain(), SctTest::HighLevelApi::timeWalk(), Sct::Unexpected(), SctCalibrationController::RunControl::unloadAction(), SctCalibrationController::Test::withdraw(), SctCalibrationController::Sequence::withdraw(), and SctArchiving::ArchivingWorkerGroup::work().

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 29 of file Exception.cpp.

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

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

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

Definition at line 37 of file Exception.cpp.

References file, line, name, and text.

Referenced by SctApi::doRawScanThread(), SctApi::readHistogramToIS(), SctCalibrationController::CalibrationControllerImpl::sctApiError(), and sendToMrs().


The documentation for this class was generated from the following files:
Generated on Mon Feb 6 14:02:45 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6