Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

source/toolbox/base/Utilities.h File Reference

#include "SAMRAI_config.h"
#include "tbox/Complex.h"
#include <string>
#include "tbox/IOStream.h"
#include <sys/types.h>
#include <sys/stat.h>
#include "tbox/Utilities.I"

Namespaces

namespace  SAMRAI
namespace  SAMRAI::tbox

Defines

#define NULL_STATEMENT
#define NULL_USE(variable)
#define TBOX_ERROR(X)
#define TBOX_WARNING(X)
#define TBOX_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 {                                    \
      ostringstream tboxos;                                     \
      tboxos << X << ends;                                      \
      SAMRAI::tbox::Utilities::abort(tboxos.str().c_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 {                                    \
      ostringstream tboxos;                                     \
      tboxos << X << ends;                                      \
      SAMRAI::tbox::Utilities::printWarning(tboxos.str(), __FILE__, __LINE__);\
} while (0)
Print a warning without exit. Print file and line number of the warning.

#define TBOX_ASSERT EXP   ) 
 

Value:

do {                                   \
      if ( !(EXP) ) {                                           \
         ostringstream tboxos;                                  \
         tboxos << "Failed assertion: " << ends;\
         SAMRAI::tbox::Utilities::abort(tboxos.str().c_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 PETSC_SAMRAI_ERROR ierr   ) 
 

Value:

do {                                            \
      if (ierr) {                                                               \
         ostringstream tboxos;                                                  \
         SAMRAI::tbox::Utilities::abort(tboxos.str().c_str(), __FILE__, __LINE__);      \
      }                                                                         \
} while (0)
If using Insure++ then avoid using petsc error macro since it is a null statement. Use one that will not cause a warning.


Generated on Fri Dec 2 11:19:11 2005 for SAMRAI by  doxygen 1.4.2