Utility code for replacing calls to exit() with macros that result in thrown exceptions.
[Teuchos Language Support Utilities]


Defines

#define TEUCHOS_EXIT(ERROR_CODE)   Teuchos_exit_helper( (char*)__FILE__, __LINE__, 0, ERROR_CODE )
 Macro to replace call to exit(...).
#define TEUCHOS_MSG_EXIT(MSG, ERROR_CODE)   Teuchos_exit_helper( (char*)__FILE__, __LINE__, MSG, ERROR_CODE )
 Macro to replace call to exit(...) and add a message string.

Functions

void Teuchos_exit_helper (char file[], int line, char msg[], int error_code)
 Function with C linkage that rases a C++ exception.

Define Documentation

#define TEUCHOS_EXIT ( ERROR_CODE   )     Teuchos_exit_helper( (char*)__FILE__, __LINE__, 0, ERROR_CODE )

Macro to replace call to exit(...).

This macro calls the function Teuchos_exit_helper() which the file name and line number where this macro is used and results in a C++ exception to be thrown with a good error message.

Definition at line 83 of file Teuchos_exit.h.

#define TEUCHOS_MSG_EXIT ( MSG,
ERROR_CODE   )     Teuchos_exit_helper( (char*)__FILE__, __LINE__, MSG, ERROR_CODE )

Macro to replace call to exit(...) and add a message string.

This macro calls the function Teuchos_exit_helper() which the file name and line number where this macro is used and results in a C++ exception to be thrown with a good error message.

Definition at line 92 of file Teuchos_exit.h.


Function Documentation

void Teuchos_exit_helper ( char  file[],
int  line,
char  msg[],
int  error_code 
)

Function with C linkage that rases a C++ exception.

Parameters:
file_and_line [in] Null-terminated string that gives the file name and line number where the error occured.
msg [in] Null-terminated string that gives some extra message that will be embedded in the thrown exception.
error_code The error code that would have been passed to 'exit(...)'
Note: This function should not be called directly but instead by using the macro TEUCHOS_EXIT() or TEUCHOS_MSG_EXIT()

Definition at line 33 of file Teuchos_exit.cpp.


Generated on Wed May 12 21:24:42 2010 for Teuchos - Trilinos Tools Package by  doxygen 1.4.7