26 #ifndef INCLUDED_utility_exit_hh
27 #define INCLUDED_utility_exit_hh
41 #define utility_exit() utility::exit( __FILE__, __LINE__ )
47 #define utility_exit_with_message(m) utility::exit( __FILE__, __LINE__, m )
53 #define utility_exit_with_status(s) utility::exit( __FILE__, __LINE__, s )
60 #define utility_exit_with_message_status(m,s) utility::exit( __FILE__, __LINE__, m, s )
63 #define runtime_assert(_Expression) if ( !(_Expression) ) utility::exit(__FILE__, __LINE__, #_Expression)
66 #define runtime_assert_msg(_Expression, msg) \
67 if ( !(_Expression) ) utility::exit(__FILE__, __LINE__, #_Expression " MSG:" msg )
71 #define runtime_assert_string_msg(_Expression, msg) \
72 if ( !(_Expression) ) utility::exit(__FILE__, __LINE__, msg )
78 # define NORETURN __attribute__ ((noreturn))
80 # define NORETURN __attribute__ ((noreturn))
88 std::string
const & file,
90 std::string
const & message,
98 std::
string const & file,
100 std::
string const & message,
109 std::
string const & file,
119 std::
string const & file,
135 std::string
const & file,
159 #endif // INCLUDED_utility_exit_HH
int cond_exit(bool condition, std::string const &file, int const line, std::string const &message, int const status)
Conditional Exit with file + line + message + optional status.
void exit(std::string const &file, int const line, std::string const &message, int const status)
Exit with file + line + message + optional status.
void set_main_exit_callback(UtilityExitCallBack my_callback)
Set call back funtion that will be called on utility::exit. Use this function to overload default beh...
void(* UtilityExitCallBack)(void)
void remove_exit_callback(UtilityExitCallBack cb)
Remove additional callback function that was previously added by using add_exit_callback.
void add_exit_callback(UtilityExitCallBack cb)
Add additional callback function that will be called before standard exit(…) is executed. [Note: do not confuse this function with 'set_main_exit_callback' which is replacing the end behavior of exit(…)].