grapewrapper.hh

00001 #ifndef __GRAPEWRAPPER__
00002 #define __GRAPEWRAPPER__
00003 
00004 #include <string>
00005 
00006 #ifdef __cplusplus
00007 extern "C" {
00008 #endif
00009 
00010 #define class GrapeClass
00011 #define private GrapePrivate 
00012 #define friend GrapeFriend 
00013 #define explicit GrapeExplicit
00014   
00015 #define G_CPP
00016 #include <grape.h>  
00017 #undef G_CPP  
00018 
00019 #undef class 
00020 #undef private
00021 #undef friend
00022 #undef explicit
00023 
00024 // make cast from const char * to char * 
00025 // otherwise wont work with gcc 4.2.x
00026 #define GRAPE_CALL(obj,meth) GRAPE(obj,((char *)meth))
00027   
00028 // make cast from const char * to char * 
00029 // otherwise wont work with gcc 4.2.x
00030 inline void g_newerrorbox (const char * a, const char * b, int c, const char * d)
00031 {
00032   g_errorbox(((char *)a),((char *)b),c,((char *)d));
00033 }
00034 
00035 // define new allert macro that uses g_newerrorbox
00036 #define GRAPE_ALERT(condition,message,error_exit) \
00037 do{if(!(condition)){ \
00038   g_newerrorbox(message,__FILE__,__LINE__,#condition); \
00039   error_exit; \
00040 }}while(0)
00041 
00042 #ifdef __cplusplus
00043 }
00044 #endif
00045   
00046 #endif

Generated on Tue Jul 28 22:28:17 2009 for dune-grid by  doxygen 1.5.6