Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros
Teuchos_StandardCatchMacros.hpp File Reference
#include "Teuchos_GlobalMPISession.hpp"
#include "Teuchos_FancyOStream.hpp"
#include "Teuchos_TypeNameTraits.hpp"
#include "Teuchos_stacktrace.hpp"
#include "Teuchos_Assert.hpp"
Include dependency graph for Teuchos_StandardCatchMacros.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TEUCHOS_GET_STORED_STACKTRACE()   ""
 
#define TEUCHOS_STANDARD_CATCH_STATEMENTS_IMPL(VERBOSE, ERR_STREAM, SHOW_STACK_TRACE, SUCCESS_FLAG)
 Implementation of TEUCHOS_STANDARD_CATCH_STATEMENTS(...) that allows toggle of showing stack trace. More...
 
#define TEUCHOS_STANDARD_CATCH_STATEMENTS(VERBOSE, ERR_STREAM, SUCCESS_FLAG)   TEUCHOS_STANDARD_CATCH_STATEMENTS_IMPL(VERBOSE, ERR_STREAM, true, SUCCESS_FLAG)
 Simple macro that catches and reports standard exceptions and other exceptions. More...
 

Macro Definition Documentation

#define TEUCHOS_GET_STORED_STACKTRACE ( )    ""

Definition at line 58 of file Teuchos_StandardCatchMacros.hpp.

#define TEUCHOS_STANDARD_CATCH_STATEMENTS_IMPL (   VERBOSE,
  ERR_STREAM,
  SHOW_STACK_TRACE,
  SUCCESS_FLAG 
)

Implementation of TEUCHOS_STANDARD_CATCH_STATEMENTS(...) that allows toggle of showing stack trace.

Definition at line 65 of file Teuchos_StandardCatchMacros.hpp.

#define TEUCHOS_STANDARD_CATCH_STATEMENTS (   VERBOSE,
  ERR_STREAM,
  SUCCESS_FLAG 
)    TEUCHOS_STANDARD_CATCH_STATEMENTS_IMPL(VERBOSE, ERR_STREAM, true, SUCCESS_FLAG)

Simple macro that catches and reports standard exceptions and other exceptions.

This macro should be used to write simple main() program functions wrapped in a try statement as:

int main(...)
{
bool verbose = true;
bool success = true;
try {
...
}
TEUCHOS_STANDARD_CATCH_STATEMENTS(verbose, std::cerr, success);
return ( success ? EXIT_SUCCESS : EXIT_FAILURE );
}

NOTE: This macro will print out stacktraces generated by exceptions thrown with the TEUCHOS_TEST_FOR_EXCEPTION() family of macros (see the main doc page for details).

Definition at line 136 of file Teuchos_StandardCatchMacros.hpp.