Rosetta Utilities  2014.35
Classes | Namespaces | Functions | Variables
exit.cc File Reference

Program exit functions and macros. More...

#include <utility/exit.hh>
#include <utility/excn/EXCN_Base.hh>
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <unistd.h>
#include <cstdio>

Classes

class  utility::EXCN_utility_exit
 

Namespaces

 utility
 unresizable vector whose size is known at compile time, which may be allocated on the stack, and which indexes from 1.
 

Functions

void utility::set_main_exit_callback (UtilityExitCallBack=0)
 Set call back funtion that will be called on utility::exit. Use this function to overload default behavior of sys.exit to more appropriate to your application Defaut value for callback function is 0, whicth mean no sys exit is called. More...
 
std::vector
< UtilityExitCallBack > & 
utility::get_all_exit_callbacks ()
 Array to hold all additional exit-callbacks. More...
 
void utility::add_exit_callback (UtilityExitCallBack)
 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(…)]. More...
 
void utility::remove_exit_callback (UtilityExitCallBack)
 Remove additional callback function that was previously added by using add_exit_callback. More...
 
void utility::exit (std::string const &file, int const line, std::string const &message, int const status)
 Exit with file + line + message + optional status. More...
 
int utility::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. More...
 

Variables

static void(* utility::main_exit_callback )(void)=0
 Place holder for 'end-action' of utility::exit(…) More...
 

Detailed Description

Program exit functions and macros.

Author
David Kim (dekim.nosp@m.@u.w.nosp@m.ashin.nosp@m.gton.nosp@m..edu)
Stuart G. Mentzer (Stuar.nosp@m.t_Me.nosp@m.ntzer.nosp@m.@obj.nosp@m.exx.c.nosp@m.om)