signals.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * (C) 2003-2012 Anope Team
00004  * Contact us at team@anope.org
00005  *
00006  * Please read COPYING and README for further details.
00007  *
00008  * Based on the original code of Epona by Lara.
00009  * Based on the original code of Services by Andy Church.
00010  *
00011  */
00012 
00013 #ifndef SIGNAL_H
00014 #define SIGNAL_H
00015 
00016 #include <signal.h>
00017 
00018 #include "sockets.h"
00019 
00022 class Signal : public Pipe
00023 {
00024         static std::vector<Signal *> SignalHandlers;
00025         static void SignalHandler(int signal);
00026 
00027         struct sigaction action, old;
00028  public:
00029         int signal;
00030 
00034         Signal(int s);
00035         ~Signal();
00036 
00044         virtual void OnNotify() anope_override = 0;
00045 };
00046 
00047 #endif
00048