COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Exception Class Reference

Base class for all Exceptions in CF. More...

#include <Exception.hpp>

Inherits exception.

Inherited by BadPointer, BadValue, CastingFailed, FailedAssertion, FailedToConverge, FileFormatError, FileSystemError, FloatingPointError, IllegalCall, InvalidStructure, InvalidURI, NotEnoughMemory, NotImplemented, NotSupported, OSystemError, ParallelError, ParsingFailed, ProtocolError, SegmentationFault, SetupError, ShouldNotBeHere, SignalError, URLError, ValueExists, ValueNotFound, XmlError, OutOfBounds, ZeroDeterminant, CGNSException, NetworkError, and UnknownClientId.

Public Member Functions

virtual ~Exception () throw ()
 Default copy constructor. More...
 
std::string full_description () const throw ()
 Returns a verbose message with all information about this exception. More...
 
const std::string & str () const throw ()
 Gets the what description string which does not contain EOL's. More...
 
const char * what () const throw ()
 
void append (const std::string &add) throw ()
 
std::string type_name () const throw ()
 
std::string msg () const throw ()
 

Protected Member Functions

 Exception (CodeLocation where, std::string msg, std::string className) throw ()
 

Protected Attributes

CodeLocation m_where
 
std::string m_msg
 Stores the message with explanation of what happened. More...
 
std::string m_class_name
 The subclass name. More...
 
std::string m_what
 

Detailed Description

Base class for all Exceptions in CF.

This type extends std::exception by providing an implementation for what(). It should optionally describe the situation of the exception in more detail. Information about the exception occurence may be added on the what() string or passed in separate data members defined in the derived subtypes of this class. This class is abstract. Only subclasses can be instantiated.

Author
Tiago Quintino
Andrea Lani

Definition at line 52 of file Exception.hpp.

Constructor & Destructor Documentation

~Exception ( )
throw (
)
virtual

Default copy constructor.

Definition at line 70 of file Exception.cpp.

Exception ( CodeLocation  where,
std::string  msg,
std::string  className 
)
throw (
)
protected

The constructor is protected to force the developers to create subclasses.

Parameters
whereThe location in the code from where the exception is raised. Typically received using FromHere()
msgA message describing the circumstances of this exception occurence which might be the empty string.
classNameclassname of derived Exception type, giving first indication of the kind of exception.
Precondition
msg should not contain EOL's
Postcondition
new.what() == what;

Definition at line 42 of file Exception.cpp.

Member Function Documentation

void append ( const std::string &  add)
throw (
)

Append the message to the what() description

Parameters
addthe std::string to be appended

Definition at line 76 of file Exception.cpp.

std::string full_description ( ) const
throw (
)

Returns a verbose message with all information about this exception.

Definition at line 97 of file Exception.cpp.

std::string msg ( ) const
throw (
)
inline

Definition at line 74 of file Exception.hpp.

const std::string & str ( ) const
throw (
)

Gets the what description string which does not contain EOL's.

Definition at line 83 of file Exception.cpp.

std::string type_name ( ) const
throw (
)
inline
Returns
the Exception name

Definition at line 72 of file Exception.hpp.

const char * what ( ) const
throw (
)
Returns
str().c_str();

Definition at line 90 of file Exception.cpp.

Member Data Documentation

std::string m_class_name
protected

The subclass name.

Definition at line 99 of file Exception.hpp.

std::string m_msg
protected

Stores the message with explanation of what happened.

Definition at line 96 of file Exception.hpp.

std::string m_what
protected

Stores the full description message with explanation of what happened

Postcondition
same as full_description()

Definition at line 103 of file Exception.hpp.

CodeLocation m_where
protected

Similar to m_msg but stores from where the exception was thrown indicating the file, line and function if possible. This is an encapsulated data member, which uses value semantics, and not a reference or a pointer. A reference or a pointer in an exception leads immediately to a memory leak, so cannot be used.

Definition at line 93 of file Exception.hpp.


The documentation for this class was generated from the following files:
Send comments to:
COOLFluiD Web Admin