14 #include <shogun/lib/config.h> 16 #if defined(__MINGW64__) || defined(_MSC_VER) 17 typedef unsigned long sigset_t;
19 #if defined(__MINGW32__) && !defined(__MINGW64__) 27 #if defined(__MINGW64__) || defined(_MSC_VER) || defined(__MINGW32__) 28 typedef void Sigfunc (
int);
36 #define sigemptyset(ptr) (*(ptr) = 0) 37 #define sigfillset(ptr) ( *(ptr) = ~(sigset_t)0,0) 39 int sigaddset(sigset_t*,
int);
40 int sigaction(
int signo,
const struct sigaction *act,
struct sigaction *oact);
43 #ifndef DISABLE_CANCEL_CALLBACK 54 #define NUMTRAPPEDSIGS 2 84 static void handler(
int signal);
90 static bool set_handler();
96 static bool unset_handler();
102 static void clear_cancel();
105 static void set_cancel(
bool immediately=
false);
113 #ifndef DISABLE_CANCEL_CALLBACK 117 if (cancel_immediately)
120 return cancel_computation;
124 virtual const char*
get_name()
const {
return "Signal"; }
143 #endif // __SIGNAL__H_
Class ShogunException defines an exception which is thrown whenever an error inside of shogun occurs...
Class SGObject is the base class of all shogun objects.
static bool cancel_computation
void(* sg_cancel_computations)(bool &delayed, bool &immediately)
function called to cancel things
virtual const char * get_name() const
static bool cancel_computations()
all of classes and functions are contained in the shogun namespace
Class Signal implements signal handling to e.g. allow ctrl+c to cancel a long running process...
static bool cancel_immediately