#include <freExceptions.h>

Public Member Functions | |
| virtual const char * | GetNameOfClass () const |
| virtual std::string | GetFullLocation () const |
| const char * | GetErrorCode () const |
| const std::string | GetExceptionTrack () const |
| void | AddTrack (const std::string &sLocation) |
| virtual void | Print (std::ostream &os, bool brief=false) const |
| ExceptionBase (const ExceptionBase &rExcBase) | |
| ExceptionBase (const std::string &sOriginCode, const std::string &sError="unspecified error reason", const std::string &sLocation="unknown location", const std::string &sFile="unspecified file", const unsigned int iLine=-1) | |
| virtual | ~ExceptionBase () throw () |
Protected Attributes | |
| STLStringVector | m_TrackedLocations |
| std::string | m_ErrorCode |
ExceptionBase is the generic exception object within f.r.e.e. and used for every Exception throwed by the engine. All exceptions derived from this class can give information about the location of the throwing in 2 ways:
Also it is possible to get a short or expanded information about the error, when specified.
Definition at line 63 of file freExceptions.h.
| FREE::ExceptionBase::ExceptionBase | ( | const ExceptionBase & | rExcBase | ) |
Copyconstructor of the class
Definition at line 132 of file freExceptions.cxx.
References m_ErrorCode, and m_TrackedLocations.
| FREE::ExceptionBase::ExceptionBase | ( | const std::string & | sOriginCode, | |
| const std::string & | sError = "unspecified error reason", |
|||
| const std::string & | sLocation = "unknown location", |
|||
| const std::string & | sFile = "unspecified file", |
|||
| const unsigned int | iLine = -1 | |||
| ) |
Constructor for the exception base class. Passing all needed Information. The origin code must always be specified, the others can be left undefined, but this isn't recommended.
| [in] | sOriginCode | The OriginCode of this exception. |
| [in] | sError | Error reason/message of the exception. |
| [in] | iLine | Line in the code, where the Exception has been thrown. |
| [in] | sFile | Name of the file, where the Exception has been thrown. |
Definition at line 123 of file freExceptions.cxx.
References m_ErrorCode, and m_TrackedLocations.
| FREE::ExceptionBase::~ExceptionBase | ( | ) | throw () [virtual] |
| virtual const char* FREE::ExceptionBase::GetNameOfClass | ( | ) | const [inline, virtual] |
Reimplemented in FREE::ControllerException, and FREE::ItkException.
Definition at line 67 of file freExceptions.h.
Referenced by Print().
| std::string FREE::ExceptionBase::GetFullLocation | ( | ) | const [virtual] |
Function returning the full location of the exception origin (file name, Location and line number). It is a string formatted this way: [File]([Line]):[Location].
Definition at line 38 of file freExceptions.cxx.
| const char* FREE::ExceptionBase::GetErrorCode | ( | ) | const [inline] |
Function to access the member variable m_ErrorCode. m_ErrorCode represents a alphanumeric code, which determines the function, where the exception has been thrown. The code is unique for every function and are listed in the documentation.
Definition at line 79 of file freExceptions.h.
| const std::string FREE::ExceptionBase::GetExceptionTrack | ( | ) | const |
Returns the track of the exception through the application by the location where they thrown or chatched. The first code is the real origin, the last is the place where it finally gets to the application/user. The track will be made, when catched by one of the chatch macros in this header (e.g. catchFreeNPassMacro) or by using the function AddTrack directly.
Definition at line 47 of file freExceptions.cxx.
References m_TrackedLocations.
| void FREE::ExceptionBase::AddTrack | ( | const std::string & | sLocation | ) |
Adds a location to the track of the exception.
| [in] | sLocation | Location, where the exception passed. |
Definition at line 62 of file freExceptions.cxx.
References m_TrackedLocations.
Referenced by FREE::ItkException::ItkException().
| void FREE::ExceptionBase::Print | ( | std::ostream & | os, | |
| bool | brief = false | |||
| ) | const [virtual] |
Print exception information. This method can be overridden by specific exception subtypes. The default is to print out the location where the exception was first thrown and any description provided by the "thrower".
Reimplemented in FREE::ControllerException.
Definition at line 69 of file freExceptions.cxx.
References GetNameOfClass(), m_ErrorCode, and m_TrackedLocations.

The array of tracked locations. The element 0 is always the real location. The others are the locations where the exception was catched and rethrown. This is helpful to track the way of the exception through the application.
Definition at line 125 of file freExceptions.h.
Referenced by AddTrack(), ExceptionBase(), GetExceptionTrack(), FREE::ControllerException::Print(), Print(), and ~ExceptionBase().
std::string FREE::ExceptionBase::m_ErrorCode [protected] |
Definition at line 127 of file freExceptions.h.
Referenced by ExceptionBase(), FREE::ControllerException::Print(), and Print().
1.5.3 written by Dimitri van Heesch,
© 1997-2000