Public Member Functions | Protected Types | Private Attributes | Static Private Attributes

esysUtils::EsysException Class Reference

#include <EsysException.h>

Inheritance diagram for esysUtils::EsysException:
dudley::DudleyAdapterException escript::DataException escript::DomainException escript::FunctionSpaceException escript::SystemMatrixException escript::TransportProblemException esysUtils::EsysAssertException finley::FinleyAdapterException

List of all members.

Public Member Functions

ESYSUTILS_DLL_API EsysException ()
 Default Constructor. Creates an exception with no message.
ESYSUTILS_DLL_API EsysException (const std::string &exceptionReason)
 Constructor which creates a EsysException with the given message.
ESYSUTILS_DLL_API EsysException (const char *cStr)
 Constructor which creates a EsysException with the given message.
ESYSUTILS_DLL_API EsysException (const EsysException &other)
 Copy constructor.
virtual ESYSUTILS_DLL_API ~EsysException () THROW(NO_ARG)
 Destructor.
ESYSUTILS_DLL_API EsysExceptionoperator= (const EsysException &other) THROW(NO_ARG)
 Assignment needed to override any automatic assignment of std::exception, which can potentially copy around char *'s, causeing trouble in some implementations of STL. It will only copy the reason string, and update the message.
const std::string & toString () const
 Return the exception message in the form <Exception Name>: <Exception Message>.
virtual ESYSUTILS_DLL_API
const std::string & 
exceptionName () const
 Return the name of the exception. This is expected to be overloaded in derived classes with the derived class name.
const std::string & reason () const
 Return a reference to the string that contains the exception reason.
void setReason (const std::string &new_reason)
 set the string for the reason for the exception. This allows ousiders to modify m_reason, but the practice is discouraged. If string insertions are required, use string methods.
virtual ESYSUTILS_DLL_API
const char * 
what () const THROW(NO_ARG)
 Return a description of the exception in the same format as the toString method.
void updateMessage ()
 update m_exceptionMessage after a reason update.

Protected Types

typedef std::exception Parent

Private Attributes

std::string m_reason
std::string m_exceptionMessage

Static Private Attributes

static const std::string exceptionNameValue

Member Typedef Documentation


Constructor & Destructor Documentation

EsysException::EsysException (  ) 

Default Constructor. Creates an exception with no message.

References updateMessage().

EsysException::EsysException ( const std::string &  exceptionReason  ) 

Constructor which creates a EsysException with the given message.

Parameters:
exceptionReason Input - Exception message.

References updateMessage().

EsysException::EsysException ( const char *  cStr  ) 

Constructor which creates a EsysException with the given message.

Parameters:
cStr - Exception message.

References updateMessage().

EsysException::EsysException ( const EsysException other  ) 

Copy constructor.

Parameters:
other Input - EsysException

References updateMessage().

EsysException::~EsysException (  )  [virtual]

Destructor.


Member Function Documentation

const std::string & EsysException::exceptionName (  )  const [virtual]

Return the name of the exception. This is expected to be overloaded in derived classes with the derived class name.

Returns:
the name of the exception.

Reimplemented in escript::DataException, escript::DomainException, escript::FunctionSpaceException, escript::SystemMatrixException, escript::TransportProblemException, esysUtils::EsysAssertException, dudley::DudleyAdapterException, and finley::FinleyAdapterException.

References exceptionNameValue.

Referenced by updateMessage().

EsysException & EsysException::operator= ( const EsysException other  ) 

Assignment needed to override any automatic assignment of std::exception, which can potentially copy around char *'s, causeing trouble in some implementations of STL. It will only copy the reason string, and update the message.

Returns:
re-assigned exception.

Referenced by esysUtils::EsysAssertException::operator=().

const std::string & esysUtils::EsysException::reason (  )  const [inline]

Return a reference to the string that contains the exception reason.

Returns:
the string for the exception reason.
void esysUtils::EsysException::setReason ( const std::string &  new_reason  )  [inline]

set the string for the reason for the exception. This allows ousiders to modify m_reason, but the practice is discouraged. If string insertions are required, use string methods.

References m_reason, and updateMessage().

const std::string & esysUtils::EsysException::toString (  )  const [inline]

Return the exception message in the form <Exception Name>: <Exception Message>.

Returns:
the exception message.

References m_exceptionMessage.

Referenced by esysUtils::operator<<().

const char * esysUtils::EsysException::what (  )  const [inline, virtual]

Return a description of the exception in the same format as the toString method.

Returns:
a description of the exception.

References m_exceptionMessage.


Member Data Documentation

std::string esysUtils::EsysException::m_reason [private]

Referenced by setReason(), and updateMessage().


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