Sierra Toolkit  Version of the Day
sierra::ExTemp< T > Class Template Reference

Template ExTemp takes a zero argument exception and makes it into a parallel throwable and put-to-able (<<) exception. This exception may be caught with either the base class T type or the template ExTemp<T> type. More...

#include <Exception.hpp>

Inheritance diagram for sierra::ExTemp< T >:
Collaboration diagram for sierra::ExTemp< T >:

Public Types

typedef ExTemp< T > ParallelExceptionType
 Parallel exception type.
 
typedef T BaseExceptionType
 Base exception type.
 

Public Member Functions

 ExTemp ()
 
 ExTemp (const std::string &message)
 
 ExTemp (const ExTemp &x)
 
virtual ~ExTemp () throw ()
 
virtual const char * what () const throw ()
 Member function what returns the exception's description. More...
 
ExTempoperator<< (std::ostream &(*f)(std::ostream &))
 Member function operator<< passes the std manipilator functions to the ExTemp object. This allows the manipulators to modify the description. (Currently in a limited fashion). More...
 
template<class U >
ExTempoperator<< (const U &t)
 
virtual void throw_copy () const
 Member function copy throws a copy of the original exception. It copies the original message, sets the parallel thrown flag and throws the new exception.
 
- Public Member Functions inherited from sierra::ExParallel
virtual ~ExParallel ()
 
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 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.
 

Static Public Member Functions

static void registerException ()
 Member function registerException registers the exception with the parallel exception registry. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sierra::ExParallel
 ExParallel ()
 
 ExParallel (const std::string &message, int parallel=-1)
 
 ExParallel (const ExParallel &x)
 

Detailed Description

template<class T>
class sierra::ExTemp< T >

Template ExTemp takes a zero argument exception and makes it into a parallel throwable and put-to-able (<<) exception. This exception may be caught with either the base class T type or the template ExTemp<T> type.

Definition at line 536 of file Exception.hpp.

Constructor & Destructor Documentation

◆ ExTemp() [1/3]

template<class T >
sierra::ExTemp< T >::ExTemp ( )
inline

Creates a new ExTemp instance.

Definition at line 546 of file Exception.hpp.

◆ ExTemp() [2/3]

template<class T >
sierra::ExTemp< T >::ExTemp ( const std::string &  message)
inlineexplicit

Creates a new ExTemp instance with an initial description.

Parameters
messagea std::string const reference to the initial exception description.

Definition at line 557 of file Exception.hpp.

◆ ExTemp() [3/3]

template<class T >
sierra::ExTemp< T >::ExTemp ( const ExTemp< T > &  x)
inline

Creates a new ExTemp copy.

Parameters
xan ExTemp variable ...

Definition at line 567 of file Exception.hpp.

◆ ~ExTemp()

template<class T >
virtual sierra::ExTemp< T >::~ExTemp ( )
throw (
)
inlinevirtual

Destroys a ExTemp instance.

Definition at line 576 of file Exception.hpp.

Member Function Documentation

◆ what()

template<class T >
virtual const char* sierra::ExTemp< T >::what ( ) const
throw (
)
inlinevirtual

Member function what returns the exception's description.

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

Reimplemented from sierra::ExParallel.

Definition at line 585 of file Exception.hpp.

◆ operator<<() [1/2]

template<class T >
ExTemp& sierra::ExTemp< T >::operator<< ( std::ostream &(*)(std::ostream &)  f)
inline

Member function operator<< passes the std manipilator functions to the ExTemp 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 597 of file Exception.hpp.

◆ operator<<() [2/2]

template<class T >
template<class U >
ExTemp& sierra::ExTemp< T >::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 ExTemp reference to this object;

Definition at line 612 of file Exception.hpp.

◆ registerException()

template<class T >
static void sierra::ExTemp< T >::registerException ( )
inlinestatic

Member function registerException registers the exception with the parallel exception registry.

Returns
an ExParallel reference to the exception to be cloned when thrown.

Definition at line 638 of file Exception.hpp.


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