gr_local_sighandler.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef INCLUDED_GR_LOCAL_SIGHANDLER_H
00024 #define INCLUDED_GR_LOCAL_SIGHANDLER_H
00025
00026 #ifdef HAVE_SIGNAL_H
00027 #include <signal.h>
00028 #endif
00029
00030 #include <string>
00031
00039 class gr_local_sighandler {
00040 int d_signum;
00041 #ifdef HAVE_SIGACTION
00042 struct sigaction d_old_action;
00043 #endif
00044 public:
00045 gr_local_sighandler (int signum, void (*new_handler)(int));
00046 ~gr_local_sighandler ();
00047
00048
00049 static void throw_signal (int signum);
00050 };
00051
00055 class gr_signal
00056 {
00057 int d_signum;
00058 public:
00059 gr_signal (int signum) : d_signum (signum) {}
00060 int signal () const { return d_signum; }
00061 std::string name () const;
00062 };
00063
00064 #endif