source/toolbox/base/Utilities.h File Reference

#include "SAMRAI_config.h"
#include <string>
#include "tbox/IOStream.h"
#include <sys/types.h>
#include <sys/stat.h>
#include "Logger.h"

Namespaces

namespace  SAMRAI
namespace  SAMRAI::tbox

Classes

struct  SAMRAI::tbox::Utilities

Defines

#define NULL_STATEMENT
#define NULL_USE(variable)
#define TBOX_ERROR(X)
#define TBOX_WARNING(X)
#define TBOX_DEBUG(X)
#define TBOX_ASSERT(EXP)
#define TBOX_CHECK_ASSERT(EXP)
#define PETSC_SAMRAI_ERROR(ierr)

Define Documentation

#define NULL_STATEMENT

A statement that does nothing, for insure++ make it something more complex than a simple C null statement to avoid a warning.

#define NULL_USE ( variable   ) 

Value:

do { \
       if(0) {char *temp = (char *)&variable; temp++;} \
    } while (0)
A null use of a variable, use to avoid GNU compiler warnings about unused variables.

#define TBOX_ERROR (  ) 

Value:

do {                                    \
      std::ostringstream tboxos;                                        \
      tboxos << X << std::ends;                                 \
      SAMRAI::tbox::Utilities::abort(tboxos.str(), __FILE__, __LINE__);\
} while (0)
Throw an error exception from within any C++ source code. The macro argument may be any standard ostream expression. The file and line number of the abort are also printed.

#define TBOX_WARNING (  ) 

Value:

do {                                    \
      std::ostringstream tboxos;                                        \
      tboxos << X << std::ends;                                 \
      SAMRAI::tbox::Logger::getInstance() -> logWarning(tboxos.str(), __FILE__, __LINE__);\
} while (0)
Print a warning without exit. Print file and line number of the warning.

#define TBOX_DEBUG (  ) 

Value:

do {                                    \
      std::ostringstream tboxos;                                        \
      tboxos << X << std::ends;                                 \
      SAMRAI::tbox::Logger::getInstance() -> logDebug(tboxos.str(), __FILE__, __LINE__);\
} while (0)
Print a debug without exit. Print file and line number of the debug.

#define TBOX_ASSERT ( EXP   ) 

Value:

do {                                   \
      if ( !(EXP) ) {                                           \
         std::ostringstream tboxos;                             \
         tboxos << "Failed assertion: " << std::ends;                \
         SAMRAI::tbox::Utilities::abort(tboxos.str(), __FILE__, __LINE__);\
      }                                                         \
} while (0)
Throw an error exception from within any C++ source code if the given expression is not true. This is a parallel-friendly version of assert. The file and line number of the abort are also printed.

#define TBOX_CHECK_ASSERT ( EXP   ) 

Macro for use when assertions are to be included only when debugging.

#define PETSC_SAMRAI_ERROR ( ierr   ) 

Value:

do {                                            \
      if (ierr) {                                                               \
         std::ostringstream tboxos;                                                     \
         SAMRAI::tbox::Utilities::abort(tboxos.str(), __FILE__, __LINE__);      \
      }                                                                         \
} while (0)
Throw an error exception from within any C++ source code. This is is similar to TBOX_ERROR(), but is designed to be invoked after a call to a PETSc library function. In other words, it acts similarly to the PETSc CHKERRQ(ierr) macro.


Generated on Thu Jun 18 11:28:17 2009 for SAMRAI by  doxygen 1.5.1