OpenFOAM logo
Open Source CFD Toolkit

error Class Reference

Inheritance diagram for error:

Inheritance graph
[legend]
Collaboration diagram for error:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 error (const string &title)
 Construct from title string.
 error (const dictionary &errDict)
 Construct from dictionary.
string message () const
const string & functionName () const
const string & sourceFileName () const
label sourceFileLineNumber () const
void throwExceptions ()
void dontThrowExceptions ()
OSstream & operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber=0)
 Convert to Ostream.
OSstream & operator() (const string &functionName, const char *sourceFileName, const int sourceFileLineNumber=0)
 operator OSstream & ()
 Convert to Ostream.
 operator dictionary () const
 Create and return a dictionary.
void exit (const int errNo=1)
 Exit : can be called for any error to exit program. Prints stack.
void abort ()
 Abort : used to stop code for fatal errors. Prints stack before.

Static Public Member Functions

void printStack (Ostream &os)
 Helper function to print a stack.

Protected Attributes

string functionName_
string sourceFileName_
label sourceFileLineNumber_
bool abort_
bool throwExceptions_
OStringStream * messageStreamPtr_

Friends

Ostream & operator<< (Ostream &, const error &)

Constructor & Destructor Documentation

error (  const string &  title  ) 
 

Construct from title string.

error (  const dictionary &  errDict  ) 
 

Construct from dictionary.


Member Function Documentation

void abort (   ) 
 

Abort : used to stop code for fatal errors. Prints stack before.

exiting.

Reimplemented in IOerror.

void dontThrowExceptions (   )  [inline]
 

Definition at line 122 of file error.H.

void exit (  const int  errNo = 1  ) 
 

Exit : can be called for any error to exit program. Prints stack.

before exiting.

Reimplemented in IOerror.

const string& functionName (   )  const [inline]
 

Definition at line 102 of file error.H.

References Foam::label.

string message (   )  const
 

operator dictionary (   )  const
 

Create and return a dictionary.

Reimplemented in IOerror.

operator OSstream & (   ) 
 

Convert to Ostream.

Prints basic message and then returns Ostream for further info.

Reimplemented from messageStream.

OSstream& operator() (  const string &  functionName,
const char *  sourceFileName,
const int  sourceFileLineNumber = 0
) 
 

Reimplemented from messageStream.

OSstream& operator() (  const char *  functionName,
const char *  sourceFileName,
const int  sourceFileLineNumber = 0
) 
 

Convert to Ostream.

Prints basic message and then returns Ostream for further info.

Reimplemented from messageStream.

void printStack (  Ostream &  os  )  [static]
 

Helper function to print a stack.

label sourceFileLineNumber (   )  const [inline]
 

Definition at line 112 of file error.H.

const string& sourceFileName (   )  const [inline]
 

Definition at line 107 of file error.H.

void throwExceptions (   )  [inline]
 

Definition at line 117 of file error.H.


Friends And Related Function Documentation

Ostream& operator<< (  Ostream &  ,
const error & 
)  [friend]
 


Member Data Documentation

bool abort_ [protected]
 

Definition at line 82 of file error.H.

string functionName_ [protected]
 

Definition at line 78 of file error.H.

OStringStream* messageStreamPtr_ [protected]
 

Definition at line 85 of file error.H.

label sourceFileLineNumber_ [protected]
 

Definition at line 80 of file error.H.

string sourceFileName_ [protected]
 

Definition at line 79 of file error.H.

bool throwExceptions_ [protected]
 

Definition at line 84 of file error.H.


The documentation for this class was generated from the following file:
For further information go to www.openfoam.org