15 #ifndef _SigHandlersList_h
16 #define _SigHandlersList_h
21 #include <sys/types.h>
81 typedef set< key_type, CompSHL >
set_t;
82 typedef set< key_type, CompSHL >::iterator
iterator;
183 : m_seen_cfh (false), m_cfhp (NULL)
207 DL((
APP,
"m_instance[%d] = 0x%x\n", signum_,
211 DL((
APP,
"new SigHandlersList allocated\n"));
225 return m_set->empty ();
236 return m_set->size ();
258 set_t::const_iterator it =
m_set->find (eh_);
261 if (it ==
m_set->end ()) {
262 return (
m_set->insert (eh_)).second;
304 return m_set->begin ();
313 return m_set->end ();
322 return m_set->find (key_);
372 : m_c_sig_hand (csigh_)
384 (*m_c_sig_hand)(signum_);
#define DL(X)
A macro for writing debug message to the Logger.
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
void(* C_SIG_HANDLER)(int)
Class SigHandler is a UNIX signal handlers manager/dispatcher class.
int handle_signal(int signum_)
Signal handler callback.
CFUNC_Handler(C_SIG_HANDLER csigh_)
C_SIG_HANDLER m_c_sig_hand
SigHandlersList(const SigHandlersList &map_)
bool empty() const
Is list empty.
set< key_type, CompSHL >::iterator iterator
static SigHandlersList * m_instance[NSIG]
Static map of signal numbers to SigHandlerLists.
SigHandlersList & operator=(const SigHandlersList &map_)
iterator find(const key_type key_)
Find event handler by its pointer key_.
int m_seen_cfh
If true this flag indicates that 3rd party event handler has already been installed prior taking cont...
set_t * m_set
Set of all event handlers registered for this signal.
iterator begin()
Return an iterator pointing to the beginning of the list.
CFUNC_Handler * cfunc_handler() const
Retrieve pointer to 3rd party C function handler.
bool insert(data_type data_)
Add an event handler data_ to the list.
iterator end()
Return an iterator pointing to the end of the list.
~SigHandlersList()
Destructor.
void erase()
Empty event handlers' list.
CFUNC_Handler * m_cfhp
Pointer to the 3rd party signal handler in the set.
set< key_type, CompSHL > set_t
size_t size() const
Size of the list.
static SigHandlersList * instance(int signum_)
Retrieve a pointer to the list of event handlers listening to signum_ signal delivery.
bool seen_cfunc_handler() const
@ SIGHAND
Class SigHandler(s) messages
@ APP
Application-level messages
bool operator()(const key_type c1_, const key_type c2_) const