gatelib  2.1
Macros
g_exception_macros.h File Reference

Go to the source code of this file.

Macros

#define G_EXC_DEFINE_TAG(aexctypename, abaseexctypename, atag)
 Auxiliary macro not use! G_EXC_DEFINE_MSG or G_EXC_DEFINE instead. More...
 
#define G_EXC_DEFINE_TAG_MSG(aexctypename, abaseexctypename, atag, amsg)
 Auxiliary macro not use! G_EXC_DEFINE_MSG or G_EXC_DEFINE instead. More...
 
#define G_EXC_DEFINE(aexctypename, abaseexctypename)   G_EXC_DEFINE_TAG ( aexctypename , abaseexctypename , G_STR (aexctypename) )
 
#define G_EXC_DEFINE_MSG(aexctypename, abaseexctypename, amsg)   G_EXC_DEFINE_TAG_MSG ( aexctypename , abaseexctypename , G_STR (aexctypename) , amsg )
 
#define G_ASSERT(acondition)   if(!(acondition)){ g::AssertException::do_FatalAction<g::Exception> ( "ASSERTION FAILED:\r\n" G_STR(acondition) , G_EXC_SIGNATURE() ); }
 When boolean 'acondition' fails fatal action is performed. ( Message contains info about the action)
 
#define G_EXC_SET_CONTEXT(acontextstr)   static const char* _g_method_context = acontextstr;
 Sets the method context. More...
 
#define G_EXC_SIGNATURE()   _g_method_context , __FILE__ , __LINE__
 Exception signature (method_context, source file, source line )
 
#define G_EXC_RAISE_MSG(aexctype, amessage)   g::Exception::do_RaiseMsg<aexctype> ( amessage , G_EXC_SIGNATURE() )
 Raises an exception specifying the message.
 
#define G_EXC_RAISE(aexctype)   g::Exception::do_Raise<aexctype> ( G_EXC_SIGNATURE() )
 Raises an exception using the the default message.
 
#define G_EXC_FATAL_ACTION(amessage)   g::Exception::do_FatalAction<g::Exception> ( amessage , G_EXC_SIGNATURE() );
 Executes the fatal action ( showing an exception box, then quitting application ) specifying a fatal error messsage.
 
#define G_SYS_CALL_ONLY(acall)   GInt64_t _g_sys_result = (GInt64_t)( acall );static const char* _g_sys_call = G_STR(acall)
 Calls a sys(POSIX/WINAPI) operation. More...
 
#define G_WIN_CALL_ASSERT(awincall, acondition)   G_SYS_CALL_ONLY(awincall); if( !(acondition) ){ G_EXC_RAISE_WIN(); }
 Calls G_SYS_CALL_ONLY then G_EXC_RAISE_WIN, if call acondition is not satisfied.
 
#define G_WIN_CALL(awincall)   G_WIN_CALL_ASSERT( awincall , (_g_sys_result) )
 Equal to G_WIN_CALL_ASSERT, condition is that result of call not null.
 
#define G_EXC_RAISE_POSIX()   g::PosixException::do_Raise ( _g_sys_result , _g_sys_call , G_EXC_SIGNATURE() )
 Raises a PosixException exception.
 
#define G_POSIX_CALL_ASSERT(aposixcall, acondition)   G_SYS_CALL_ONLY(aposixcall);if ( !(acondition) ) { G_EXC_RAISE_POSIX(); }
 Calls G_SYS_CALL_ONLY then G_EXC_RAISE_POSIX, if call acondition is not satisfied.
 
#define G_POSIX_CALL(aposixcall)   G_POSIX_CALL_ASSERT(aposixcall,(_g_sys_result==0))
 Equal to G_POSIX_CALL_ASSERT, condition is that result of call is not null.
 
#define G_POSIX_CALL_VALUE(aposixcall)   G_POSIX_CALL_ASSERT(aposixcall,(_g_sys_result!=-1))
 Equal to G_POSIX_CALL_ASSERT, condition is that result of call is not equal to -1(Use in case POSIX call returns a value to be used).
 
#define G_EXC_FRAME_BEGIN()   try{
 Equivalent to 'try{' (used for source code layout).
 
#define G_EXC_FRAME_END_THREAD(athreadname)
 Standard thread exception frame end. More...
 
#define G_EXC_FRAME_END_MAIN()   G_EXC_FRAME_END_THREAD ( "MainThread" )
 Equal to G_EXC_FRAME_END_THREAD but athreadname is "MainThread".
 
#define G_EXC_UNIMPLEMENTED(acontextstr)   G_EXC_SET_CONTEXT(acontextstr); G_EXC_RAISE ( g::UnimplemetedException )
 Sets a function as unimplemented ( raises UnimplemetedException ).
 
#define G_EXC_FRAME_FILTER_RETHROW(afilterexc)   } catch ( afilterexc& exc ) { g::Exception::do_Rethrow<afilterexc> ( exc , G_EXC_SIGNATURE() ); }
 Sets a function as unimplemented ( raises UnimplemetedException ).