Sierra Toolkit Version of the Day
sierra::ExParallel Class Reference

Class ExParallel implements the features of a parallel exception. It is a std::string which stores the exception description. It also provides "put to" (operator;lt&;lt&) functions for appending the description with information. More...

#include <Exception.hpp>

Inheritance diagram for sierra::ExParallel:

List of all members.

Public Member Functions

virtual ~ExParallel ()
virtual const char * what () const throw ()
 Member function what returns the exception's description.
ExParallelclear ()
 Member function clear clears the contents of the exception.
ExParallelsetDescription (const std::string &description)
 Member function setDescription sets the value of the exception's description.
std::string getDescription () const
 Member function getDescription returns the exception's description.
std::ostringstream & getDescriptionStream ()
 Member function getDescriptionStream returns the stream used to assemble the description.
const std::ostringstream & getDescriptionStream () const
 Member function getDescriptionStream returns the stream used to assemble the description.
ExParallelsetTraceback (const std::string &traceback)
 Member function setTraceback sets the exception's traceback to the caller generating the exception.
const std::string & getTraceback () const
 Member function getTraceback returns the exception's traceback string.
ExParallelsetParallel (int parallel)
 Member function setParallel sets the originating processor for an exception that is being thrown in parallel.
int getParallel () const
 Member function getParallel returns the originating processor for a parallel exception or -1 if the exception was not thrown in parallel.
bool isParallel () const
 Member function isParallel returns true if the exception is being thrown in parallel.
ExParalleloperator<< (std::ostream &(*f)(std::ostream &))
 Member function operator<< passes the std manipilator functions to the ExParallel object. This allows the manipulators to modify the description. (Currently in a limited fashion).
template<class U >
ExParalleloperator<< (const U &t)
virtual void throw_copy () const =0
 Member function throw_copy is a pure virtual function which is allows the copying and throwing of the parallel exception using a pointer to the base exception object. This function should never return, it should throw the copied exception.
virtual void parallel_handler ()
 Member function parallel_handler is called just before a parallel exception is thrown. It is guaranteed to be called in parallel on all processors, so collective communication is allowed inside Parallel_Handler. This function might be used to copy information to all processors. The default is to do nothing.

Protected Member Functions

 ExParallel ()
 ExParallel (const std::string &message, int parallel=-1)
 ExParallel (const ExParallel &x)

Detailed Description

Class ExParallel implements the features of a parallel exception. It is a std::string which stores the exception description. It also provides "put to" (operator;lt&;lt&) functions for appending the description with information.

Definition at line 271 of file Exception.hpp.


Constructor & Destructor Documentation

sierra::ExParallel::ExParallel ( ) [inline, protected]

Creates a new ExParallel instance which is not about to be thrown in parallel and has no description.

Definition at line 279 of file Exception.hpp.

sierra::ExParallel::ExParallel ( const std::string &  message,
int  parallel = -1 
) [inline, explicit, protected]

Creates a new ExParallel instance with an initial description and may be about to be thrown in parallel.

Parameters:
messagean std::string const reference to the initial description.
parallelan bool value of true if this exception is about to be thrown in parallel.

Definition at line 299 of file Exception.hpp.

sierra::ExParallel::ExParallel ( const ExParallel x) [inline, protected]

Creates a new ExParallel copy.

Parameters:
xan ExParallel const reference to the exception to copy.

Definition at line 316 of file Exception.hpp.

virtual sierra::ExParallel::~ExParallel ( ) [inline, virtual]

Destroys a ExBase instance.

Definition at line 330 of file Exception.hpp.


Member Function Documentation

virtual const char* sierra::ExParallel::what ( ) const throw () [inline, virtual]

Member function what returns the exception's description.

Returns:
a char const pointer to the exception's description.

Reimplemented in sierra::ExTemp< T >.

Definition at line 339 of file Exception.hpp.

ExParallel& sierra::ExParallel::clear ( ) [inline]

Member function clear clears the contents of the exception.

Returns:
an ExParallel reference to the exception.

Definition at line 354 of file Exception.hpp.

ExParallel& sierra::ExParallel::setDescription ( const std::string &  description) [inline]

Member function setDescription sets the value of the exception's description.

Parameters:
descriptiona std::string const reference to the description.
Returns:
an ExParallel reference to the exception.

Definition at line 370 of file Exception.hpp.

std::string sierra::ExParallel::getDescription ( ) const [inline]

Member function getDescription returns the exception's description.

Returns:
a std::string value of the exception's description.

Definition at line 383 of file Exception.hpp.

std::ostringstream& sierra::ExParallel::getDescriptionStream ( ) [inline]

Member function getDescriptionStream returns the stream used to assemble the description.

Returns:
a std::ostringstream reference to the exception's description stream.

Definition at line 394 of file Exception.hpp.

const std::ostringstream& sierra::ExParallel::getDescriptionStream ( ) const [inline]

Member function getDescriptionStream returns the stream used to assemble the description.

Returns:
a std::ostringstream const reference to the exception's description stream.

Definition at line 405 of file Exception.hpp.

ExParallel& sierra::ExParallel::setTraceback ( const std::string &  traceback) [inline]

Member function setTraceback sets the exception's traceback to the caller generating the exception.

Parameters:
tracebacka std::string const reference to the traceback.
Returns:
an ExParallel reference to the exception.

Definition at line 418 of file Exception.hpp.

const std::string& sierra::ExParallel::getTraceback ( ) const [inline]

Member function getTraceback returns the exception's traceback string.

Returns:
a std::string const reference to the exception's traceback string.

Definition at line 429 of file Exception.hpp.

ExParallel& sierra::ExParallel::setParallel ( int  parallel) [inline]

Member function setParallel sets the originating processor for an exception that is being thrown in parallel.

Parameters:
parallela int value to set the originating processor for this parallel exception.
Returns:
an ExParallel reference to this parallel exception.

Definition at line 443 of file Exception.hpp.

int sierra::ExParallel::getParallel ( ) const [inline]

Member function getParallel returns the originating processor for a parallel exception or -1 if the exception was not thrown in parallel.

Returns:
a int value of the originating processor for the parallel exception or -1.

Definition at line 455 of file Exception.hpp.

bool sierra::ExParallel::isParallel ( ) const [inline]

Member function isParallel returns true if the exception is being thrown in parallel.

Returns:
a bool value of true if the exception is being thrown in parallel.

Definition at line 467 of file Exception.hpp.

ExParallel& sierra::ExParallel::operator<< ( std::ostream &(*)(std::ostream &)  f) [inline]

Member function operator<< passes the std manipilator functions to the ExParallel object. This allows the manipulators to modify the description. (Currently in a limited fashion).

Returns:
an ExParallel reference to this parallel exception.

Reimplemented in sierra::ExTemp< T >.

Definition at line 479 of file Exception.hpp.

template<class U >
ExParallel& sierra::ExParallel::operator<< ( const U &  t) [inline]

Member function operator<< passes any data type to the exception string class for conversion to a string.

Parameters:
ta T const reference that is to be converted to a string.
Returns:
a ExParallel reference to this object;

Reimplemented in sierra::ExTemp< T >.

Definition at line 494 of file Exception.hpp.

virtual void sierra::ExParallel::throw_copy ( ) const [pure virtual]

Member function throw_copy is a pure virtual function which is allows the copying and throwing of the parallel exception using a pointer to the base exception object. This function should never return, it should throw the copied exception.

The exception is being throw in parallel so be sure to set the parallel thrown processor via setParallel(int) before throwing the copy.

Implemented in sierra::ExTemp< T >.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines