Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
assertions.h
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // Copyright (c) 1999 The CGAL Consortium
4 
5 // This software and related documentation is part of the Computational
6 // Geometry Algorithms Library (CGAL).
7 // This software and documentation is provided "as-is" and without warranty
8 // of any kind. In no event shall the CGAL Consortium be liable for any
9 // damage of any kind.
10 //
11 // Every use of CGAL requires a license.
12 //
13 // Academic research and teaching license
14 // - For academic research and teaching purposes, permission to use and copy
15 // the software and its documentation is hereby granted free of charge,
16 // provided that it is not a component of a commercial product, and this
17 // notice appears in all copies of the software and related documentation.
18 //
19 // Commercial licenses
20 // - A commercial license is available through Algorithmic Solutions, who also
21 // markets LEDA (http://www.algorithmic-solutions.de).
22 // - Commercial users may apply for an evaluation license by writing to
23 // Algorithmic Solutions (contact@algorithmic-solutions.com).
24 //
25 // The CGAL Consortium consists of Utrecht University (The Netherlands),
26 // ETH Zurich (Switzerland), Free University of Berlin (Germany),
27 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
28 // (Germany), Max-Planck-Institute Saarbrucken (Germany), RISC Linz (Austria),
29 // and Tel-Aviv University (Israel).
30 //
31 // ----------------------------------------------------------------------
32 //
33 // release : CGAL-2.2
34 // release_date : 2000, September 30
35 //
36 // file : include/CGAL/assertions.h
37 // package : Kernel_basic (3.14)
38 // source :
39 // author(s) : Geert-Jan Giezeman and Sven Schönherr
40 //
41 // coordinator : MPI, Saarbruecken
42 //
43 // email : contact@cgal.org
44 // www : http://www.cgal.org
45 //
46 // ======================================================================
47 
48 #ifndef CGAL_CONFIG_H
49 #include <CGAL/config.h>
50 #endif // CGAL_CONFIG_H
51 
52 #ifndef CGAL_ASSERTIONS_H
53 #define CGAL_ASSERTIONS_H
54 
56 
57 // types
58 // =====
59 
61 
62 // function declarations
63 // =====================
64 // failure functions
65 // -----------------
66 void assertion_fail ( const char*, const char*, int, const char*);
67 void precondition_fail ( const char*, const char*, int, const char*);
68 void postcondition_fail ( const char*, const char*, int, const char*);
69 
70 // warning function
71 // ----------------
72 void warning_fail( const char*, const char*, int, const char*);
73 
74 
75 // macro definitions
76 // =================
77 // assertions
78 // ----------
79 
80 
81 #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
82  || defined(NDEBUG)
83 # define CGAL_assertion(EX) ((void)0)
84 # define CGAL_assertion_msg(EX,MSG) ((void)0)
85 # define CGAL_assertion_code(CODE)
86 #else
87 # define CGAL_assertion(EX) \
88  ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))
89 # define CGAL_assertion_msg(EX,MSG) \
90  ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
91 # define CGAL_assertion_code(CODE) CODE
92 #endif // CGAL_KERNEL_NO_ASSERTIONS
93 
94 #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
95  || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
96  || defined(NDEBUG)
97 # define CGAL_exactness_assertion(EX) ((void)0)
98 # define CGAL_exactness_assertion_msg(EX,MSG) ((void)0)
99 # define CGAL_exactness_assertion_code(CODE)
100 #else
101 # define CGAL_exactness_assertion(EX) \
102  ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))
103 # define CGAL_exactness_assertion_msg(EX,MSG) \
104  ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
105 # define CGAL_exactness_assertion_code(CODE) CODE
106 #endif // CGAL_KERNEL_NO_ASSERTIONS
107 
108 #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
109  || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
110  || defined(NDEBUG)
111 # define CGAL_expensive_assertion(EX) ((void)0)
112 # define CGAL_expensive_assertion_msg(EX,MSG) ((void)0)
113 # define CGAL_expensive_assertion_code(CODE)
114 #else
115 # define CGAL_expensive_assertion(EX) \
116  ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))
117 # define CGAL_expensive_assertion_msg(EX,MSG) \
118  ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
119 # define CGAL_expensive_assertion_code(CODE) CODE
120 #endif // CGAL_KERNEL_NO_ASSERTIONS
121 
122 #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
123  || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
124  || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
125  || defined(NDEBUG)
126 # define CGAL_expensive_exactness_assertion(EX) ((void)0)
127 # define CGAL_expensive_exactness_assertion_msg(EX,MSG) ((void)0)
128 # define CGAL_expensive_exactness_assertion_code(CODE)
129 #else
130 # define CGAL_expensive_exactness_assertion(EX) \
131  ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))
132 # define CGAL_expensive_exactness_assertion_msg(EX,MSG) \
133  ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
134 # define CGAL_expensive_exactness_assertion_code(CODE) CODE
135 #endif // CGAL_KERNEL_NO_ASSERTIONS
136 
137 
138 // preconditions
139 // -------------
140 
141 #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
142  || defined(NDEBUG)
143 # define CGAL_precondition(EX) ((void)0)
144 # define CGAL_precondition_msg(EX,MSG) ((void)0)
145 # define CGAL_precondition_code(CODE)
146 #else
147 # define CGAL_precondition(EX) \
148  ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0))
149 # define CGAL_precondition_msg(EX,MSG) \
150  ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
151 # define CGAL_precondition_code(CODE) CODE
152 #endif // CGAL_KERNEL_NO_PRECONDITIONS
153 
154 #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
155  || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
156  || defined(NDEBUG)
157 # define CGAL_exactness_precondition(EX) ((void)0)
158 # define CGAL_exactness_precondition_msg(EX,MSG) ((void)0)
159 # define CGAL_exactness_precondition_code(CODE)
160 #else
161 # define CGAL_exactness_precondition(EX) \
162  ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0))
163 # define CGAL_exactness_precondition_msg(EX,MSG) \
164  ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
165 # define CGAL_exactness_precondition_code(CODE) CODE
166 #endif // CGAL_KERNEL_NO_PRECONDITIONS
167 
168 #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
169  || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
170  || defined(NDEBUG)
171 # define CGAL_expensive_precondition(EX) ((void)0)
172 # define CGAL_expensive_precondition_msg(EX,MSG) ((void)0)
173 # define CGAL_expensive_precondition_code(CODE)
174 #else
175 # define CGAL_expensive_precondition(EX) \
176  ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0))
177 # define CGAL_expensive_precondition_msg(EX,MSG) \
178  ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
179 # define CGAL_expensive_precondition_code(CODE) CODE
180 #endif // CGAL_KERNEL_NO_PRECONDITIONS
181 
182 #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
183  || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
184  || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
185  || defined(NDEBUG)
186 # define CGAL_expensive_exactness_precondition(EX) ((void)0)
187 # define CGAL_expensive_exactness_precondition_msg(EX,MSG) ((void)0)
188 # define CGAL_expensive_exactness_precondition_code(CODE)
189 #else
190 # define CGAL_expensive_exactness_precondition(EX) \
191  ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0))
192 # define CGAL_expensive_exactness_precondition_msg(EX,MSG) \
193  ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
194 # define CGAL_expensive_exactness_precondition_code(CODE) CODE
195 #endif // CGAL_KERNEL_NO_PRECONDITIONS
196 
197 
198 // postconditions
199 // --------------
200 
201 #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
202  || defined(NDEBUG)
203 # define CGAL_postcondition(EX) ((void)0)
204 # define CGAL_postcondition_msg(EX,MSG) ((void)0)
205 # define CGAL_postcondition_code(CODE)
206 #else
207 # define CGAL_postcondition(EX) \
208  ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
209 # define CGAL_postcondition_msg(EX,MSG) \
210  ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
211 # define CGAL_postcondition_code(CODE) CODE
212 #endif // CGAL_KERNEL_NO_POSTCONDITIONS
213 
214 #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
215  || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
216  || defined(NDEBUG)
217 # define CGAL_exactness_postcondition(EX) ((void)0)
218 # define CGAL_exactness_postcondition_msg(EX,MSG) ((void)0)
219 # define CGAL_exactness_postcondition_code(CODE)
220 #else
221 # define CGAL_exactness_postcondition(EX) \
222  ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
223 # define CGAL_exactness_postcondition_msg(EX,MSG) \
224  ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
225 # define CGAL_exactness_postcondition_code(CODE) CODE
226 #endif // CGAL_KERNEL_NO_POSTCONDITIONS
227 
228 #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
229  || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
230  || defined(NDEBUG)
231 # define CGAL_expensive_postcondition(EX) ((void)0)
232 # define CGAL_expensive_postcondition_msg(EX,MSG) ((void)0)
233 # define CGAL_expensive_postcondition_code(CODE)
234 #else
235 # define CGAL_expensive_postcondition(EX) \
236  ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
237 # define CGAL_expensive_postcondition_msg(EX,MSG) \
238  ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
239 # define CGAL_expensive_postcondition_code(CODE) CODE
240 #endif // CGAL_KERNEL_NO_POSTCONDITIONS
241 
242 #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
243  || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
244  || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
245  || defined(NDEBUG)
246 # define CGAL_expensive_exactness_postcondition(EX) ((void)0)
247 # define CGAL_expensive_exactness_postcondition_msg(EX,MSG) ((void)0)
248 # define CGAL_expensive_exactness_postcondition_code(CODE)
249 #else
250 # define CGAL_expensive_exactness_postcondition(EX) \
251  ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
252 # define CGAL_expensive_exactness_postcondition_msg(EX,MSG) \
253  ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
254 # define CGAL_expensive_exactness_postcondition_code(CODE) CODE
255 #endif // CGAL_KERNEL_NO_POSTCONDITIONS
256 
257 
258 // warnings
259 // --------
260 
261 #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
262  || defined(NDEBUG)
263 # define CGAL_warning(EX) ((void)0)
264 # define CGAL_warning_msg(EX,MSG) ((void)0)
265 # define CGAL_warning_code(CODE)
266 #else
267 # define CGAL_warning(EX) \
268  ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))
269 # define CGAL_warning_msg(EX,MSG) \
270  ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
271 # define CGAL_warning_code(CODE) CODE
272 #endif // CGAL_KERNEL_NO_WARNINGS
273 
274 #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
275  || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
276  || defined(NDEBUG)
277 # define CGAL_exactness_warning(EX) ((void)0)
278 # define CGAL_exactness_warning_msg(EX,MSG) ((void)0)
279 # define CGAL_exactness_warning_code(CODE)
280 #else
281 # define CGAL_exactness_warning(EX) \
282  ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))
283 # define CGAL_exactness_warning_msg(EX,MSG) \
284  ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
285 # define CGAL_exactness_warning_code(CODE) CODE
286 #endif // CGAL_KERNEL_NO_WARNINGS
287 
288 #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
289  || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
290  || defined(NDEBUG)
291 # define CGAL_expensive_warning(EX) ((void)0)
292 # define CGAL_expensive_warning_msg(EX,MSG) ((void)0)
293 # define CGAL_expensive_warning_code(CODE)
294 #else
295 # define CGAL_expensive_warning(EX) \
296  ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))
297 # define CGAL_expensive_warning_msg(EX,MSG) \
298  ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
299 # define CGAL_expensive_warning_code(CODE) CODE
300 #endif // CGAL_KERNEL_NO_WARNINGS
301 
302 #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
303  || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
304  || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
305  || defined(NDEBUG)
306 # define CGAL_expensive_exactness_warning(EX) ((void)0)
307 # define CGAL_expensive_exactness_warning_msg(EX,MSG) ((void)0)
308 # define CGAL_expensive_exactness_warning_code(CODE)
309 #else
310 # define CGAL_expensive_exactness_warning(EX) \
311  ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))
312 # define CGAL_expensive_exactness_warning_msg(EX,MSG) \
313  ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
314 # define CGAL_expensive_exactness_warning_code(CODE) CODE
315 #endif // CGAL_KERNEL_NO_WARNINGS
316 
317 
318 // failure handler declarations
319 // ==========================
320 // failure handler
321 // ---------------
322 typedef
323  void
325  const char*, const char*, const char*, int, const char*);
326 
329 
332 
333 // failure behaviour handler
334 // -------------------------
337 
340 
342 
343 #endif // CGAL_ASSERTIONS_H
344 
void warning_fail(const char *, const char *, int, const char *)
Definition: assertions.C:205
Failure_function set_error_handler(Failure_function handler)
Sets the handler for assertion-failures.
Definition: assertion.C:104
Failure_function set_warning_handler(Failure_function handler)
Definition: assertions.C:236
Failure_behaviour set_error_behaviour(Failure_behaviour eb)
Controls the behavior when an assertion fails.
Definition: assertion.C:93
void postcondition_fail(const char *, const char *, int, const char *)
Definition: assertions.C:182
void(* Failure_function)(const char *, const char *, const char *, int, const char *)
Function type for error handlers.
void precondition_fail(const char *, const char *, int, const char *)
Definition: assertions.C:162
Failure_behaviour set_warning_behaviour(Failure_behaviour eb)
Definition: assertions.C:252
Failure_behaviour
Behavior of failures.
void assertion_fail(const char *, const char *, int, const char *)
Default error handler.
Definition: assertion.C:71
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87