Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
assertions.h File Reference
#include <CGAL/config.h>
Include dependency graph for assertions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CGAL_assertion(EX)   ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))
 
#define CGAL_assertion_msg(EX, MSG)   ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
 
#define CGAL_assertion_code(CODE)   CODE
 
#define CGAL_exactness_assertion(EX)   ((void)0)
 
#define CGAL_exactness_assertion_msg(EX, MSG)   ((void)0)
 
#define CGAL_exactness_assertion_code(CODE)
 
#define CGAL_expensive_assertion(EX)   ((void)0)
 
#define CGAL_expensive_assertion_msg(EX, MSG)   ((void)0)
 
#define CGAL_expensive_assertion_code(CODE)
 
#define CGAL_expensive_exactness_assertion(EX)   ((void)0)
 
#define CGAL_expensive_exactness_assertion_msg(EX, MSG)   ((void)0)
 
#define CGAL_expensive_exactness_assertion_code(CODE)
 
#define CGAL_precondition(EX)   ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0))
 
#define CGAL_precondition_msg(EX, MSG)   ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
 
#define CGAL_precondition_code(CODE)   CODE
 
#define CGAL_exactness_precondition(EX)   ((void)0)
 
#define CGAL_exactness_precondition_msg(EX, MSG)   ((void)0)
 
#define CGAL_exactness_precondition_code(CODE)
 
#define CGAL_expensive_precondition(EX)   ((void)0)
 
#define CGAL_expensive_precondition_msg(EX, MSG)   ((void)0)
 
#define CGAL_expensive_precondition_code(CODE)
 
#define CGAL_expensive_exactness_precondition(EX)   ((void)0)
 
#define CGAL_expensive_exactness_precondition_msg(EX, MSG)   ((void)0)
 
#define CGAL_expensive_exactness_precondition_code(CODE)
 
#define CGAL_postcondition(EX)   ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
 
#define CGAL_postcondition_msg(EX, MSG)   ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
 
#define CGAL_postcondition_code(CODE)   CODE
 
#define CGAL_exactness_postcondition(EX)   ((void)0)
 
#define CGAL_exactness_postcondition_msg(EX, MSG)   ((void)0)
 
#define CGAL_exactness_postcondition_code(CODE)
 
#define CGAL_expensive_postcondition(EX)   ((void)0)
 
#define CGAL_expensive_postcondition_msg(EX, MSG)   ((void)0)
 
#define CGAL_expensive_postcondition_code(CODE)
 
#define CGAL_expensive_exactness_postcondition(EX)   ((void)0)
 
#define CGAL_expensive_exactness_postcondition_msg(EX, MSG)   ((void)0)
 
#define CGAL_expensive_exactness_postcondition_code(CODE)
 
#define CGAL_warning(EX)   ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))
 
#define CGAL_warning_msg(EX, MSG)   ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
 
#define CGAL_warning_code(CODE)   CODE
 
#define CGAL_exactness_warning(EX)   ((void)0)
 
#define CGAL_exactness_warning_msg(EX, MSG)   ((void)0)
 
#define CGAL_exactness_warning_code(CODE)
 
#define CGAL_expensive_warning(EX)   ((void)0)
 
#define CGAL_expensive_warning_msg(EX, MSG)   ((void)0)
 
#define CGAL_expensive_warning_code(CODE)
 
#define CGAL_expensive_exactness_warning(EX)   ((void)0)
 
#define CGAL_expensive_exactness_warning_msg(EX, MSG)   ((void)0)
 
#define CGAL_expensive_exactness_warning_code(CODE)
 

Typedefs

typedef void(* Failure_function )(const char *, const char *, const char *, int, const char *)
 

Enumerations

enum  Failure_behaviour {
  ABORT, EXIT, EXIT_WITH_SUCCESS, CONTINUE,
  ABORT, EXIT, EXIT_WITH_SUCCESS, CONTINUE
}
 

Functions

void assertion_fail (const char *, const char *, int, const char *)
 Default error handler. More...
 
void precondition_fail (const char *, const char *, int, const char *)
 
void postcondition_fail (const char *, const char *, int, const char *)
 
void warning_fail (const char *, const char *, int, const char *)
 
Failure_function set_error_handler (Failure_function handler)
 Sets the handler for assertion-failures. More...
 
Failure_function set_warning_handler (Failure_function handler)
 
Failure_behaviour set_error_behaviour (Failure_behaviour eb)
 Controls the behavior when an assertion fails. More...
 
Failure_behaviour set_warning_behaviour (Failure_behaviour eb)
 

Macro Definition Documentation

#define CGAL_assertion (   EX)    ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))

Definition at line 87 of file assertions.h.

Referenced by Polyhedron_incremental_builder_3< HDS >::add_vertex(), Polyhedron_incremental_builder_3< HDS >::add_vertex_to_facet(), Polyhedron_incremental_builder_3< HDS >::begin_facet(), Polyhedron_incremental_builder_3< HDS >::begin_surface(), Polyhedron_incremental_builder_3< HDS >::end_facet(), Polyhedron_incremental_builder_3< HDS >::end_surface(), Halfedge_data_structure_decorator< _HDS >::erase_connected_component(), Halfedge_data_structure_decorator< _HDS >::erase_facet(), Random_access_adaptor< Vertex_iterator >::find(), Polyhedron_incremental_builder_3< HDS >::find_facet(), Polyhedron_incremental_builder_3< HDS >::find_vertex(), I_min_circulator_size(), Halfedge_data_structure_decorator< _HDS >::inside_out(), Halfedge_data_structure_decorator< _HDS >::join_facet(), Halfedge_data_structure_decorator< _HDS >::join_loop(), Halfedge_data_structure_decorator< _HDS >::join_vertex(), Polyhedron_incremental_builder_3< HDS >::lookup_halfedge(), Polyhedron_incremental_builder_3< HDS >::lookup_hole(), Halfedge_data_structure_using_vector< V, H, F >::new_edge(), Halfedge_data_structure_using_vector< V, H, F >::new_facet(), Halfedge_data_structure_using_vector< V, H, F >::new_vertex(), Halfedge_data_structure_using_vector< V, H, F >::normalize_border(), Iterator_from_circulator< C, Ref, Ptr >::operator*(), Circulator_from_container< Ctnr >::operator*(), Const_circulator_from_container< Ctnr >::operator*(), Circulator_from_iterator< I, TT, SS, DD >::operator*(), Iterator_from_circulator< C, Ref, Ptr >::operator++(), Circulator_from_container< Ctnr >::operator++(), Const_circulator_from_container< Ctnr >::operator++(), Circulator_from_iterator< I, TT, SS, DD >::operator++(), Iterator_from_circulator< C, Ref, Ptr >::operator+=(), Circulator_from_container< Ctnr >::operator+=(), Const_circulator_from_container< Ctnr >::operator+=(), Circulator_from_iterator< I, TT, SS, DD >::operator+=(), Iterator_from_circulator< C, Ref, Ptr >::operator-(), Circulator_from_container< Ctnr >::operator-(), Const_circulator_from_container< Ctnr >::operator-(), Circulator_from_iterator< I, TT, SS, DD >::operator-(), Iterator_from_circulator< C, Ref, Ptr >::operator--(), Circulator_from_container< Ctnr >::operator--(), Const_circulator_from_container< Ctnr >::operator--(), Circulator_from_iterator< I, TT, SS, DD >::operator--(), Iterator_from_circulator< C, Ref, Ptr >::operator->(), Circulator_from_container< Ctnr >::operator->(), Const_circulator_from_container< Ctnr >::operator->(), Circulator_from_iterator< I, TT, SS, DD >::operator->(), Iterator_from_circulator< C, Ref, Ptr >::operator<(), N_step_adaptor< I, N, Ref, Ptr, Val, Dist, Ctg >::operator==(), Iterator_from_circulator< C, Ref, Ptr >::operator==(), Circulator_from_container< Ctnr >::operator==(), Const_circulator_from_container< Ctnr >::operator==(), Circulator_from_iterator< I, TT, SS, DD >::operator==(), Polyhedron_incremental_builder_3< HDS >::rollback(), Halfedge_data_structure_decorator< _HDS >::set_facet_in_facet_loop(), Halfedge_data_structure_decorator< _HDS >::set_vertex_in_vertex_loop(), Halfedge_data_structure_decorator< _HDS >::split_loop(), and Polyhedron_incremental_builder_3< HDS >::~Polyhedron_incremental_builder_3().

#define CGAL_assertion_msg (   EX,
  MSG 
)    ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))

Definition at line 89 of file assertions.h.

#define CGAL_exactness_assertion (   EX)    ((void)0)

Definition at line 97 of file assertions.h.

#define CGAL_exactness_assertion_code (   CODE)

Definition at line 99 of file assertions.h.

#define CGAL_exactness_assertion_msg (   EX,
  MSG 
)    ((void)0)

Definition at line 98 of file assertions.h.

#define CGAL_exactness_postcondition (   EX)    ((void)0)

Definition at line 217 of file assertions.h.

#define CGAL_exactness_postcondition_code (   CODE)

Definition at line 219 of file assertions.h.

#define CGAL_exactness_postcondition_msg (   EX,
  MSG 
)    ((void)0)

Definition at line 218 of file assertions.h.

#define CGAL_exactness_precondition (   EX)    ((void)0)

Definition at line 157 of file assertions.h.

#define CGAL_exactness_precondition_code (   CODE)

Definition at line 159 of file assertions.h.

#define CGAL_exactness_precondition_msg (   EX,
  MSG 
)    ((void)0)

Definition at line 158 of file assertions.h.

#define CGAL_exactness_warning (   EX)    ((void)0)

Definition at line 277 of file assertions.h.

#define CGAL_exactness_warning_code (   CODE)

Definition at line 279 of file assertions.h.

#define CGAL_exactness_warning_msg (   EX,
  MSG 
)    ((void)0)

Definition at line 278 of file assertions.h.

#define CGAL_expensive_assertion (   EX)    ((void)0)

Definition at line 111 of file assertions.h.

#define CGAL_expensive_assertion_code (   CODE)

Definition at line 113 of file assertions.h.

#define CGAL_expensive_assertion_msg (   EX,
  MSG 
)    ((void)0)

Definition at line 112 of file assertions.h.

#define CGAL_expensive_exactness_assertion (   EX)    ((void)0)

Definition at line 126 of file assertions.h.

#define CGAL_expensive_exactness_assertion_code (   CODE)

Definition at line 128 of file assertions.h.

#define CGAL_expensive_exactness_assertion_msg (   EX,
  MSG 
)    ((void)0)

Definition at line 127 of file assertions.h.

#define CGAL_expensive_exactness_postcondition (   EX)    ((void)0)

Definition at line 246 of file assertions.h.

#define CGAL_expensive_exactness_postcondition_code (   CODE)

Definition at line 248 of file assertions.h.

#define CGAL_expensive_exactness_postcondition_msg (   EX,
  MSG 
)    ((void)0)

Definition at line 247 of file assertions.h.

#define CGAL_expensive_exactness_precondition (   EX)    ((void)0)

Definition at line 186 of file assertions.h.

#define CGAL_expensive_exactness_precondition_code (   CODE)

Definition at line 188 of file assertions.h.

#define CGAL_expensive_exactness_precondition_msg (   EX,
  MSG 
)    ((void)0)

Definition at line 187 of file assertions.h.

#define CGAL_expensive_exactness_warning (   EX)    ((void)0)

Definition at line 306 of file assertions.h.

#define CGAL_expensive_exactness_warning_code (   CODE)

Definition at line 308 of file assertions.h.

#define CGAL_expensive_exactness_warning_msg (   EX,
  MSG 
)    ((void)0)

Definition at line 307 of file assertions.h.

#define CGAL_expensive_postcondition (   EX)    ((void)0)

Definition at line 231 of file assertions.h.

#define CGAL_expensive_postcondition_code (   CODE)

Definition at line 233 of file assertions.h.

#define CGAL_expensive_postcondition_msg (   EX,
  MSG 
)    ((void)0)

Definition at line 232 of file assertions.h.

#define CGAL_expensive_precondition (   EX)    ((void)0)

Definition at line 171 of file assertions.h.

#define CGAL_expensive_precondition_code (   CODE)

Definition at line 173 of file assertions.h.

#define CGAL_expensive_precondition_msg (   EX,
  MSG 
)    ((void)0)

Definition at line 172 of file assertions.h.

#define CGAL_expensive_warning (   EX)    ((void)0)

Definition at line 291 of file assertions.h.

#define CGAL_expensive_warning_code (   CODE)

Definition at line 293 of file assertions.h.

#define CGAL_expensive_warning_msg (   EX,
  MSG 
)    ((void)0)

Definition at line 292 of file assertions.h.

#define CGAL_postcondition (   EX)    ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
#define CGAL_postcondition_code (   CODE)    CODE

Definition at line 211 of file assertions.h.

#define CGAL_postcondition_msg (   EX,
  MSG 
)    ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))

Definition at line 209 of file assertions.h.

#define CGAL_precondition_code (   CODE)    CODE

Definition at line 151 of file assertions.h.

#define CGAL_precondition_msg (   EX,
  MSG 
)    ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))

Definition at line 149 of file assertions.h.

#define CGAL_warning (   EX)    ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))

Definition at line 267 of file assertions.h.

#define CGAL_warning_code (   CODE)    CODE

Definition at line 271 of file assertions.h.

#define CGAL_warning_msg (   EX,
  MSG 
)    ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))

Definition at line 269 of file assertions.h.

Typedef Documentation

typedef void(* Failure_function)(const char *, const char *, const char *, int, const char *)

Definition at line 324 of file assertions.h.

Enumeration Type Documentation

Enumerator
ABORT 
EXIT 
EXIT_WITH_SUCCESS 
CONTINUE 
ABORT 
EXIT 
EXIT_WITH_SUCCESS 
CONTINUE 

Definition at line 60 of file assertions.h.

Function Documentation

void assertion_fail ( const char *  ,
const char *  ,
int  ,
const char *   
)

Default error handler.

Definition at line 71 of file assertion.C.

References _error_behaviour, ABORT, COMMPI_Initialized(), CONTINUE, EXIT, EXIT_WITH_SUCCESS, MPI_COMM_WORLD, and printStackBacktrace().

75 {
76  extern void printStackBacktrace();
77 
78  (*_error_handler)("assertion", expr, file, line, msg);
79  printStackBacktrace(); // Print stack backtrace
80  switch (_error_behaviour) {
81  case ABORT:
82  abort();
83  case EXIT:
84  exit(1); // EXIT_FAILURE
85  case EXIT_WITH_SUCCESS:
86  exit(0); // EXIT_SUCCESS
87  case CONTINUE:
88  ;
89  }
90 }
COM_BEGIN_NAME_SPACE void printStackBacktrace()
Print the stack backtrace.
static Failure_behaviour _error_behaviour
Definition: assertion.C:66

Here is the call graph for this function:

void postcondition_fail ( const char *  ,
const char *  ,
int  ,
const char *   
)

Definition at line 182 of file assertions.C.

References _error_behaviour, ABORT, COMMPI_Initialized(), CONTINUE, EXIT, EXIT_WITH_SUCCESS, MPI_COMM_WORLD, and printStackBacktrace().

186 {
187  (*_error_handler)("postcondition", expr, file, line, msg);
189  switch (_error_behaviour) {
190  case ABORT:
191  if (COMMPI_Initialized()) MPI_Abort(MPI_COMM_WORLD,-1); abort();
192  case EXIT:
193  exit(1); // EXIT_FAILURE
194  case EXIT_WITH_SUCCESS:
195  exit(0); // EXIT_SUCCESS
196  case CONTINUE:
197  ;
198  }
199 }
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
static Failure_behaviour _error_behaviour
Definition: assertions.C:73
COM_BEGIN_NAME_SPACE void printStackBacktrace()
Print the stack backtrace.
int COMMPI_Initialized()
Definition: commpi.h:168

Here is the call graph for this function:

void precondition_fail ( const char *  ,
const char *  ,
int  ,
const char *   
)

Definition at line 162 of file assertions.C.

References _error_behaviour, ABORT, COMMPI_Initialized(), CONTINUE, EXIT, EXIT_WITH_SUCCESS, MPI_COMM_WORLD, and printStackBacktrace().

166 {
167  (*_error_handler)("precondition", expr, file, line, msg);
169  switch (_error_behaviour) {
170  case ABORT:
171  if (COMMPI_Initialized()) MPI_Abort(MPI_COMM_WORLD,-1); abort();
172  case EXIT:
173  exit(1); // EXIT_FAILURE
174  case EXIT_WITH_SUCCESS:
175  exit(0); // EXIT_SUCCESS
176  case CONTINUE:
177  ;
178  }
179 }
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
static Failure_behaviour _error_behaviour
Definition: assertions.C:73
COM_BEGIN_NAME_SPACE void printStackBacktrace()
Print the stack backtrace.
int COMMPI_Initialized()
Definition: commpi.h:168

Here is the call graph for this function:

Failure_behaviour set_error_behaviour ( Failure_behaviour  eb)

Controls the behavior when an assertion fails.

Definition at line 93 of file assertion.C.

References _error_behaviour.

94 {
96  _error_behaviour = eb;
97  return result;
98 }
Failure_behaviour
Behavior of failures.
static Failure_behaviour _error_behaviour
Definition: assertion.C:66
Failure_function set_error_handler ( Failure_function  handler)

Sets the handler for assertion-failures.

Definition at line 104 of file assertion.C.

References _error_handler.

105 {
107  _error_handler = handler;
108  return( result);
109 }
void(* Failure_function)(const char *, const char *, const char *, int, const char *)
Function type for error handlers.
static Failure_function _error_handler
Definition: assertion.C:65
Failure_behaviour set_warning_behaviour ( Failure_behaviour  eb)

Definition at line 252 of file assertions.C.

References _warning_behaviour.

253 {
255  _warning_behaviour = eb;
256  return result;
257 }
Failure_behaviour
Behavior of failures.
static Failure_behaviour _warning_behaviour
Definition: assertions.C:74
Failure_function set_warning_handler ( Failure_function  handler)

Definition at line 236 of file assertions.C.

References _warning_handler.

237 {
239  _warning_handler = handler;
240  return( result);
241 }
void(* Failure_function)(const char *, const char *, const char *, int, const char *)
Function type for error handlers.
static Failure_function _warning_handler
Definition: assertions.C:137
void warning_fail ( const char *  ,
const char *  ,
int  ,
const char *   
)

Definition at line 205 of file assertions.C.

References _warning_behaviour, ABORT, CONTINUE, EXIT, EXIT_WITH_SUCCESS, MPI_COMM_WORLD, and printStackBacktrace().

209 {
210  (*_warning_handler)("warning", expr, file, line, msg);
212  switch (_warning_behaviour) {
213  case ABORT:
214  MPI_Abort(MPI_COMM_WORLD,-1); abort();
215  case EXIT:
216  exit(1); // EXIT_FAILURE
217  case EXIT_WITH_SUCCESS:
218  exit(0); // EXIT_SUCCESS
219  case CONTINUE:
220  ;
221  }
222 }
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
COM_BEGIN_NAME_SPACE void printStackBacktrace()
Print the stack backtrace.
static Failure_behaviour _warning_behaviour
Definition: assertions.C:74

Here is the call graph for this function: