OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

error Class Reference

Inheritance diagram for error:

Inheritance graph
[legend]
Collaboration diagram for error:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 69 of file error.H.


Public Member Functions

 error (const string &title)
 Construct from title string.
 error (const dictionary &errDict)
 Construct from dictionary.
 ~error ()
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

static 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.

~error (  ) 


Member Function Documentation

string message (  )  const

const string& functionName (  )  const [inline]

Definition at line 107 of file error.H.

References error::sourceFileLineNumber_.

const string& sourceFileName (  )  const [inline]

Definition at line 112 of file error.H.

References error::throwExceptions_.

label sourceFileLineNumber (  )  const [inline]

Definition at line 117 of file error.H.

References error::throwExceptions_.

void throwExceptions (  )  [inline]

Definition at line 122 of file error.H.

void dontThrowExceptions (  )  [inline]

Definition at line 127 of file error.H.

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.

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

Reimplemented from messageStream.

operator OSstream & (  ) 

Convert to Ostream.

Prints basic message and then returns Ostream for further info.

Reimplemented from messageStream.

operator dictionary (  )  const

Create and return a dictionary.

Reimplemented in IOerror.

static void printStack ( Ostream &  os  )  [static]

Helper function to print a stack.

void exit ( const int  errNo = 1  ) 

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

before exiting.

Reimplemented in IOerror.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

void abort (  ) 

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

exiting.

Reimplemented in IOerror.


Friends And Related Function Documentation

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


Member Data Documentation

string functionName_ [protected]

Definition at line 78 of file error.H.

string sourceFileName_ [protected]

Definition at line 79 of file error.H.

Definition at line 80 of file error.H.

Referenced by error::functionName().

bool abort_ [protected]

Definition at line 82 of file error.H.

bool throwExceptions_ [protected]

Definition at line 84 of file error.H.

Referenced by error::sourceFileLineNumber(), and error::sourceFileName().

Definition at line 85 of file error.H.


The documentation for this class was generated from the following file: Copyright © 2000-2007 OpenCFD Ltd