Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
roccom_assertion.h
Go to the documentation of this file.
1 /* *******************************************************************
2  * Rocstar Simulation Suite *
3  * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4  * *
5  * Illinois Rocstar LLC *
6  * Champaign, IL *
7  * www.illinoisrocstar.com *
8  * sales@illinoisrocstar.com *
9  * *
10  * License: See LICENSE file in top level of distribution package or *
11  * http://opensource.org/licenses/NCSA *
12  *********************************************************************/
13 /* *******************************************************************
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21  * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22  *********************************************************************/
23 // $Id: roccom_assertion.h,v 1.6 2008/12/06 08:43:24 mtcampbe Exp $
24 
30 #ifndef __ROCCOM_ASSERTION_H
31 #define __ROCCOM_ASSERTION_H
32 
33 #include "roccom_basic.h"
34 
35 COM_BEGIN_NAME_SPACE
36 
39 
41 typedef void(*Failure_function)
42  (const char*, const char*, const char*, int, const char*);
44 void assertion_fail( const char*, const char*, int, const char*);
45 
52 
61 #ifndef NDEBUG
62 #define COM_assertion(EX) \
63  ((EX)?((void)0): ::COM::assertion_fail( # EX , __FILE__, __LINE__, 0))
64 #define COM_assertion_msg(EX,msg) \
65  ((EX)?((void)0): ::COM::assertion_fail( # EX , __FILE__, __LINE__, msg))
66 #else
67 #define COM_assertion(EX) ((void)0)
68 #define COM_assertion_msg(EX,msg) ((void)0)
69 #endif
70 
71 COM_END_NAME_SPACE
72 
73 #endif // __ROCCOM_ASSERTION_H
74 
75 
76 
77 
78 
79 
Failure_function set_error_handler(Failure_function handler)
Sets the handler for assertion-failures.
Definition: assertion.C:104
Failure_behaviour set_error_behaviour(Failure_behaviour eb)
Controls the behavior when an assertion fails.
Definition: assertion.C:93
void(* Failure_function)(const char *, const char *, const char *, int, const char *)
Function type for error handlers.
This file contains some definitions of macros and constants for Roccoms.
Failure_behaviour
Behavior of failures.
void assertion_fail(const char *, const char *, int, const char *)
Default error handler.
Definition: assertion.C:71