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

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:

Public Member Functions

virtual ~ExParallel ()
 
virtual const char * what () const throw ()
 Member function what returns the exception's description. More...
 
ExParallelclear ()
 Member function clear clears the contents of the exception. More...
 
ExParallelsetDescription (const std::string &description)
 Member function setDescription sets the value of the exception's description. More...
 
std::string getDescription () const
 Member function getDescription returns the exception's description. More...
 
std::ostringstream & getDescriptionStream ()
 Member function getDescriptionStream returns the stream used to assemble the description. More...
 
const std::ostringstream & getDescriptionStream () const
 Member function getDescriptionStream returns the stream used to assemble the description. More...
 
ExParallelsetTraceback (const std::string &traceback)
 Member function setTraceback sets the exception's traceback to the caller generating the exception. More...
 
const std::string & getTraceback () const
 Member function getTraceback returns the exception's traceback string. More...
 
ExParallelsetParallel (int parallel)
 Member function setParallel sets the originating processor for an exception that is being thrown in parallel. More...
 
int getParallel () const
 Member function getParallel returns the originating processor for a parallel exception or -1 if the exception was not thrown in parallel. More...
 
bool isParallel () const
 Member function isParallel returns true if the exception is being thrown in parallel. More...
 
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). More...
 
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. More...
 
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

◆ ExParallel() [1/3]

sierra::ExParallel::ExParallel ( )
inlineprotected

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.

◆ ExParallel() [2/3]

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

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.

◆ ExParallel() [3/3]

sierra::ExParallel::ExParallel ( const ExParallel x)
inlineprotected

Creates a new ExParallel copy.

Parameters
xan ExParallel const reference to the exception to copy.

Definition at line 316 of file Exception.hpp.

◆ ~ExParallel()

virtual sierra::ExParallel::~ExParallel ( )
inlinevirtual

Destroys a ExBase instance.

Definition at line 330 of file Exception.hpp.

Member Function Documentation

◆ what()

virtual const char* sierra::ExParallel::what ( ) const
throw (
)
inlinevirtual

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.

◆ clear()

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.

◆ setDescription()

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.

◆ getDescription()

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.

◆ getDescriptionStream() [1/2]

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.

◆ getDescriptionStream() [2/2]

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.

◆ setTraceback()

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.

◆ getTraceback()

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.

◆ setParallel()

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.

◆ getParallel()

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.

◆ isParallel()

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.

◆ operator<<() [1/2]

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.

Definition at line 479 of file Exception.hpp.

◆ operator<<() [2/2]

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;

Definition at line 494 of file Exception.hpp.

◆ throw_copy()

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: