SFrame 3.6
SError Class Reference

SFrame exception class. More...

#include <core/include/SError.h>

Inheritance diagram for SError:
Collaboration diagram for SError:

List of all members.

Public Types

enum  Severity {
  SkipEvent = 1, SkipFile = 2, SkipInputData = 3, SkipCycle = 4,
  StopExecution = 5
}
 Severity enumeration. More...

Public Member Functions

 SError (Severity severity=SkipEvent) throw ()
 Constructor specifying only a severity.
 SError (const char *description, Severity severity=SkipEvent) throw ()
 Constructor with description and severity.
 SError (const SError &parent) throw ()
 Copy constructor.
virtual ~SError () throw ()
 Destructor.
void SetDescription (const char *description) throw ()
 Set the description of the exception.
void SetSeverity (Severity severity) throw ()
 Set the severity of the exception.
virtual const char * what () const throw ()
 Get the description of the exception.
virtual Severity request () const throw ()
 Get the severity of the exception.
template<class T >
SErroroperator<< (T arg)
 Function to get the std::ostream functionality.

Detailed Description

SFrame exception class.

Class for all exceptions used in SFrame. All the exceptions should provide a description of the occurence and an "action request" to the framework.

Version:
Revision:
120
Examples:

FirstCycle.cxx, FirstCycle.h, SecondCycle.cxx, and SecondCycle.h.

Definition at line 30 of file SError.h.


Member Enumeration Documentation

Severity enumeration.

The exception can request an action from the framework. This can be one of the actions described by the enumeration values.

Enumerator:
SkipEvent 

The current event should be skipped from being written

SkipFile 

Processing of the current file should stop

SkipInputData 

Processing of the current input data type should stop

SkipCycle 

Running of the current cycle should stop

StopExecution 

SFrame should stop completely

Definition at line 39 of file SError.h.


Constructor & Destructor Documentation

SError::SError ( Severity  severity = SkipEvent) throw ()

Constructor specifying only a severity.

This constructor is used most often in the code. You just specify a severity to the event, then fill the description using the std::ostream functionality of the object, finally throw the exception object.

Parameters:
severityThe action request of the exception

Definition at line 26 of file SError.cxx.

SError::SError ( const char *  description,
Severity  severity = SkipEvent 
) throw ()

Constructor with description and severity.

This constructor is useful for throwing exceptions with a simple explanation. For such exceptions you don't have to create an exception object, but can throw the exception like this:

throw SError( "Skip this event", SError::SkipEvent );

Parameters:
descriptionExplanation for the occurance
severityThe action request of the exception

Definition at line 43 of file SError.cxx.

SError::SError ( const SError parent) throw ()

Copy constructor.

I think this copy constructor is necessary for the correct handling of the exception objects. It clones the original object completely.

Parameters:
parentThe object to clone

Definition at line 57 of file SError.cxx.

SError::~SError ( ) throw () [virtual]

Destructor.

Another "I don't do anything" destructor.

Definition at line 69 of file SError.cxx.


Member Function Documentation

template<class T >
SError& SError::operator<< ( arg) [inline]

Function to get the std::ostream functionality.

A little template magic is needed to provide all the << operator functionalities of std::ostream to SError. This function takes care of that. So in principle you should be able to use an SError object as any other kind of std::ostream object.

Definition at line 74 of file SError.h.

SError::Severity SError::request ( ) const throw () [virtual]

Get the severity of the exception.

Definition at line 93 of file SError.cxx.

Referenced by SCycleBaseNTuple::DeclareVariable(), SCycleBaseNTuple::GetMetadataTree(), SCycleController::Initialize(), and SCycleBaseExec::Process().

void SError::SetDescription ( const char *  description) throw ()

Set the description of the exception.

Definition at line 73 of file SError.cxx.

void SError::SetSeverity ( Severity  severity) throw ()

Set the severity of the exception.

Definition at line 80 of file SError.cxx.


The documentation for this class was generated from the following files: