SigAction is a C++ wrapper around sigaction structure. More...
#include <signal.h>#include <errno.h>#include "assa/Assure.h"#include "assa/SigSet.h"Go to the source code of this file.
Classes | |
| class | ASSA::SigAction |
Namespaces | |
| namespace | ASSA |
Typedefs | |
| typedef struct sigaction | SIGACTION |
| typedef void(* | C_SIG_HANDLER )(int) |
SigAction is a C++ wrapper around sigaction structure.
Class SigAction implements a C++ wrapper around struct sigaction. It class also provides a range of all possible operation that can be performed on it, including sigaction(2) system call.
struct sigaction is defined as:
struct sigaction {
void (*sa_handler) ();
sigset_t sa_mask;
int sa_flags;
void (*sa_sigaction) (int, siginfo_t*, void*);
};
It is used to set all the details of what your process should do when a signal arrives. It encapsulates the action to be taken on receipt of a particular signal.
The most important member is sa_handler, which takes a pointer to a function. This function will be invoked whenever the process gets a particular POSIX.1 signal.
Some of the member function of SigAction class take a parameter of type C_SIG_HANDLER.
It can be one of:
The sa_mask mask for the signal action specifies a set of signals to be blocked while the signal handler is active. On the ent----------------------------------- 00013 // Created: 06/07/99 00014 //------------------------------------------------------------------------------ 00015 #ifndef SERVICE_HANDLER_H 00016 #define SERVICE_HANDLER_H 00017 00018 #include "assa/Assure.h" 00019 #include "assa/EventHandler.h" 00020 00021 namespace ASSA { 00022 00030 template <class PEER_STREAM> 00031 class ServiceHandler : public EventHandler 00032 { 00033 public: 00038 ServiceHandler () 00039 : m_peerStream (new PEER_STREAM) 00040 { 00041 trace("ServiceHandler::ServiceHandler"); 00042 } 00043 00049 ServiceHandler (PEER_STREAM* ps_) 00050 : m_peerStream (ps_) 00051 { 00052 trace("ServiceHandler::ServiceHandler"); 00053 } 00054 00056 virtual ~ServiceHandler () { 00057 trace("ServiceHandler::~ServiceHandler"); 00058 00059 if ( m_peerStream ) { 00060 delete m_peerStream; 00061