/home/oan/prosjekt/gotools/segmentation/gpl_distro/lsseg_1.0_gpl/include/errormacros.h File Reference

File imported from the GoTools library (utils module). Contains macros for error reporting. More...

#include <iostream>

Go to the source code of this file.

Defines

#define REPORT   std::cerr << "\nIn file " << __FILE__ << ", line " << __LINE__ << std::endl
#define MESSAGE(x)   std::cerr << "\nIn file " << __FILE__ << ", line " << __LINE__ << ": " << x << std::endl
#define MESSAGE_IF(cond, m)   do {if(cond) MESSAGE(m);} while(0)
#define THROW(x)   MESSAGE(x), throw std::exception()
 Usage: THROW("Error message string.");.
#define ALWAYS_ERROR_IF(condition, message)   do {if(condition){ THROW(message);}} while(0)
#define ASSERT(cond)   if (!(cond)) THROW("Assertation \'" #cond "\' failed.")
#define ASSERT2(cond, x)   do { if (!(cond)) THROW(x);} while(0)
#define DEBUG_ERROR_IF(cond, x)   do { if (cond) THROW(x); } while(0)


Detailed Description

File imported from the GoTools library (utils module). Contains macros for error reporting.

Definition in file errormacros.h.


Define Documentation

#define ALWAYS_ERROR_IF ( condition,
message   )     do {if(condition){ THROW(message);}} while(0)

Definition at line 87 of file errormacros.h.

#define ASSERT ( cond   )     if (!(cond)) THROW("Assertation \'" #cond "\' failed.")

Usage: ASSERT(condition) Usage: ASSERT2(condition, "Error message string.") Usage: DEBUG_ERROR_IF(condition, "Error message string.");

Definition at line 104 of file errormacros.h.

#define ASSERT2 ( cond,
 )     do { if (!(cond)) THROW(x);} while(0)

Definition at line 107 of file errormacros.h.

#define DEBUG_ERROR_IF ( cond,
 )     do { if (cond) THROW(x); } while(0)

Definition at line 111 of file errormacros.h.

#define MESSAGE (  )     std::cerr << "\nIn file " << __FILE__ << ", line " << __LINE__ << ": " << x << std::endl

Definition at line 75 of file errormacros.h.

#define MESSAGE_IF ( cond,
 )     do {if(cond) MESSAGE(m);} while(0)

Definition at line 78 of file errormacros.h.

#define REPORT   std::cerr << "\nIn file " << __FILE__ << ", line " << __LINE__ << std::endl

Usage: REPORT; Usage: MESSAGE("Message string.");

Definition at line 72 of file errormacros.h.

#define THROW (  )     MESSAGE(x), throw std::exception()

Usage: THROW("Error message string.");.

Definition at line 84 of file errormacros.h.


Generated on Tue Nov 28 18:35:47 2006 for lsseg by  doxygen 1.4.7