OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
process::Signal Class Reference

#include <process_signal.h>

Public Types

typedef boost::function< void(const
boost::system::error_code
&error, int sig, pid_t pid,
int status)> 
SignalChildHandler
 
typedef boost::function< void(const
boost::system::error_code
&error, int sig)> 
SignalHandler
 
typedef std::map< int,
std::vector< SignalHandler > > 
SignalCallbackMap
 

Public Member Functions

 Signal (EventManager *evm, const SignalCallbackMap &sig_callback_map, const std::vector< SignalChildHandler > &sigchld_callbacks, bool always_handle_sigchild)
 
 Signal (EventManager *evm, const SignalCallbackMap &sig_callback_map)
 
virtual ~Signal ()
 
void Initialize ()
 
void Terminate ()
 
void RegisterHandler (int sig, SignalHandler handler)
 
void RegisterHandler (SignalChildHandler handler)
 

Private Member Functions

boost::system::error_code AddSignal (int sig)
 
boost::system::error_code InitializeSigChild ()
 
void RegisterSigHandler ()
 
void HandleSig (const boost::system::error_code &error, int sig)
 
bool HandleSigOsSpecific (const boost::system::error_code &error, int sig)
 
void NotifySig (const boost::system::error_code &error, int sig)
 
void NotifySigChld (const boost::system::error_code &error, int sig, int pid, int status)
 
virtual int WaitPid (int pid, int *status, int options)
 

Private Attributes

boost::asio::signal_set signal_
 
SignalCallbackMap sig_callback_map_
 
std::vector< SignalChildHandlersigchld_callbacks_
 
bool always_handle_sigchild_
 

Friends

class ::ProcessSignalTest
 

Detailed Description

Definition at line 21 of file process_signal.h.

Member Typedef Documentation

typedef std::map<int, std::vector<SignalHandler> > process::Signal::SignalCallbackMap

Definition at line 28 of file process_signal.h.

typedef boost::function< void(const boost::system::error_code& error, int sig, pid_t pid, int status)> process::Signal::SignalChildHandler

Definition at line 25 of file process_signal.h.

typedef boost::function< void(const boost::system::error_code& error, int sig)> process::Signal::SignalHandler

Definition at line 27 of file process_signal.h.

Constructor & Destructor Documentation

process::Signal::Signal ( EventManager evm,
const SignalCallbackMap sig_callback_map,
const std::vector< SignalChildHandler > &  sigchld_callbacks,
bool  always_handle_sigchild 
)

Definition at line 17 of file process_signal_common.cc.

Here is the call graph for this function:

process::Signal::Signal ( EventManager evm,
const SignalCallbackMap sig_callback_map 
)

Definition at line 28 of file process_signal_common.cc.

Here is the call graph for this function:

process::Signal::~Signal ( )
virtual

Definition at line 37 of file process_signal_common.cc.

Member Function Documentation

boost::system::error_code process::Signal::AddSignal ( int  sig)
private

Definition at line 40 of file process_signal_common.cc.

void process::Signal::HandleSig ( const boost::system::error_code &  error,
int  sig 
)
private

Definition at line 86 of file process_signal_common.cc.

Here is the call graph for this function:

bool process::Signal::HandleSigOsSpecific ( const boost::system::error_code &  error,
int  sig 
)
private

Definition at line 30 of file process_signal.cc.

Here is the call graph for this function:

void process::Signal::Initialize ( )

Definition at line 99 of file process_signal_common.cc.

Here is the call graph for this function:

boost::system::error_code process::Signal::InitializeSigChild ( )
private

Definition at line 12 of file process_signal.cc.

Here is the call graph for this function:

void process::Signal::NotifySig ( const boost::system::error_code &  error,
int  sig 
)
private

Definition at line 70 of file process_signal_common.cc.

void process::Signal::NotifySigChld ( const boost::system::error_code &  error,
int  sig,
int  pid,
int  status 
)
private

Definition at line 63 of file process_signal_common.cc.

void process::Signal::RegisterHandler ( int  sig,
SignalHandler  handler 
)

Definition at line 50 of file process_signal_common.cc.

Here is the call graph for this function:

void process::Signal::RegisterHandler ( SignalChildHandler  handler)

Definition at line 22 of file process_signal.cc.

Here is the call graph for this function:

void process::Signal::RegisterSigHandler ( )
private

Definition at line 95 of file process_signal_common.cc.

Here is the call graph for this function:

void process::Signal::Terminate ( )

Definition at line 112 of file process_signal_common.cc.

int process::Signal::WaitPid ( int  pid,
int *  status,
int  options 
)
privatevirtual

Definition at line 82 of file process_signal_common.cc.

Friends And Related Function Documentation

friend class ::ProcessSignalTest
friend

Definition at line 56 of file process_signal.h.

Member Data Documentation

bool process::Signal::always_handle_sigchild_
private

Definition at line 55 of file process_signal.h.

SignalCallbackMap process::Signal::sig_callback_map_
private

Definition at line 53 of file process_signal.h.

std::vector<SignalChildHandler> process::Signal::sigchld_callbacks_
private

Definition at line 54 of file process_signal.h.

boost::asio::signal_set process::Signal::signal_
private

Definition at line 52 of file process_signal.h.


The documentation for this class was generated from the following files: