#include <SigHandlersList.h>
Public Types | |
typedef EventHandler * | key_type |
typedef EventHandler * | data_type |
typedef set< key_type, CompSHL > | set_t |
typedef set< key_type, CompSHL >::iterator | iterator |
Public Member Functions | |
~SigHandlersList () | |
Destructor. | |
bool | empty () const |
Is list empty. | |
size_t | size () const |
Size of the list. | |
bool | insert (data_type data_) |
Add an event handler data_ to the list. | |
void | erase (const key_type key_) |
Find and remove event handler key_ from the list. | |
void | erase (iterator it_) |
Remove an event handler pointed by iterator it_ from the list. | |
void | erase () |
Empty event handlers' list. | |
iterator | begin () |
Return an iterator pointing to the beginning of the list. | |
iterator | end () |
Return an iterator pointing to the end of the list. | |
iterator | find (const key_type key_) |
Find event handler by its pointer key_. | |
CFUNC_Handler * | cfunc_handler (CFUNC_Handler *cfp_) |
Save 3rd party C function handler to remember. | |
CFUNC_Handler * | cfunc_handler () const |
Retrieve pointer to 3rd party C function handler. | |
void | seen_cfunc_handler (bool ft_) |
Indicate whether 3rd party C function handler was installed. | |
bool | seen_cfunc_handler () const |
Static Public Member Functions | |
static SigHandlersList * | instance (int signum_) |
Retrieve a pointer to the list of event handlers listening to signum_ signal delivery. | |
Static Public Attributes | |
static SigHandlersList * | m_instance [NSIG] |
Static map of signal numbers to SigHandlerLists. | |
Protected Member Functions | |
SigHandlersList () | |
SigHandlersList (const SigHandlersList &map_) | |
SigHandlersList & | operator= (const SigHandlersList &map_) |
Private Attributes | |
set_t * | m_set |
Set of all event handlers registered for this signal. | |
int | m_seen_cfh |
If true this flag indicates that 3rd party event handler has already been installed prior taking control by SigHandlers manager. | |
CFUNC_Handler * | m_cfhp |
Pointer to the 3rd party signal handler in the set. | |
Classes | |
struct | CompSHL |
SigHandlersList class is used by SigHandlers class to keep track of EventHandlers installed to be called on signal's delivery. It is sort of global process map of signal numbers into corresponding sets of EventHandlers that are listening for signal delivery.
Definition at line 63 of file SigHandlersList.h.
|
Definition at line 67 of file SigHandlersList.h. |
|
Definition at line 80 of file SigHandlersList.h. |
|
Definition at line 66 of file SigHandlersList.h. |
|
Definition at line 79 of file SigHandlersList.h. |
|
Destructor.
Definition at line 190 of file SigHandlersList.h. References erase(), m_set, ASSA::SIGHAND, and trace_with_mask. 00191 { 00192 trace_with_mask("SigHandlersList::~SigHandlersList", SIGHAND); 00193 00194 erase (); 00195 delete m_set; 00196 m_set = NULL; 00197 }
|
|
Definition at line 180 of file SigHandlersList.h. References m_set, ASSA::SIGHAND, and trace_with_mask. Referenced by instance(). 00181 : m_seen_cfh (false), m_cfhp (NULL) 00182 { 00183 trace_with_mask("SigHandlersList::SigHandlersList", SIGHAND); 00184 00185 m_set = new set_t; 00186 }
|
|
|
|
Return an iterator pointing to the beginning of the list.
Definition at line 298 of file SigHandlersList.h. References m_set, ASSA::SIGHAND, and trace_with_mask. Referenced by ASSA::SigHandlers::dispatch(). 00299 { 00300 trace_with_mask("SigHandlersList::begin()", SIGHAND); 00301 00302 return m_set->begin (); 00303 }
|
|
Retrieve pointer to 3rd party C function handler.
Definition at line 338 of file SigHandlersList.h. References m_cfhp, ASSA::SIGHAND, and trace_with_mask. 00339 { 00340 trace_with_mask("SigHandlersList::cfunc_handler", SIGHAND); 00341 00342 return m_cfhp; 00343 }
|
|
Save 3rd party C function handler to remember.
Definition at line 326 of file SigHandlersList.h. References m_cfhp, m_seen_cfh, ASSA::SIGHAND, and trace_with_mask. Referenced by ASSA::SigHandlers::install(). 00327 { 00328 trace_with_mask("SigHandlersList::cfunc_handler", SIGHAND); 00329 00330 CFUNC_Handler* old_cfhp = m_cfhp; 00331 m_cfhp = cfhp_; 00332 m_seen_cfh = cfhp_ == NULL ? false : true; 00333 return old_cfhp; 00334 }
|
|
Is list empty.
Definition at line 217 of file SigHandlersList.h. References m_set, ASSA::SIGHAND, and trace_with_mask. 00218 { 00219 trace_with_mask("SigHandlersList::empty", SIGHAND); 00220 00221 // true if map is empty, false otherwise 00222 00223 return m_set->empty (); 00224 }
|
|
Return an iterator pointing to the end of the list.
Definition at line 307 of file SigHandlersList.h. References m_set, ASSA::SIGHAND, and trace_with_mask. Referenced by ASSA::SigHandlers::dispatch(), and ASSA::SigHandlers::remove(). 00308 { 00309 trace_with_mask("SigHandlersList::end", SIGHAND); 00310 00311 return m_set->end (); 00312 }
|
|
Empty event handlers' list.
Definition at line 278 of file SigHandlersList.h. References m_set, ASSA::SIGHAND, and trace_with_mask. Referenced by ~SigHandlersList(). 00279 { 00280 // empty the map 00281 trace_with_mask("SigHandlersList::erase(void)", SIGHAND); 00282 00283 m_set->erase (m_set->begin(), m_set->end()); 00284 }
|
|
Remove an event handler pointed by iterator it_ from the list.
Definition at line 288 of file SigHandlersList.h. References m_set, ASSA::SIGHAND, and trace_with_mask. 00289 { 00290 // erase element pointed by iterator 00291 trace_with_mask("SigHandlersList::erase(it_)", SIGHAND); 00292 00293 m_set->erase(it_); 00294 }
|
|
Find and remove event handler key_ from the list.
Definition at line 268 of file SigHandlersList.h. References m_set, ASSA::SIGHAND, and trace_with_mask. Referenced by ASSA::SigHandlers::dispatch(), and ASSA::SigHandlers::remove(). 00269 { 00270 // return number of erased elements 00271 trace_with_mask("SigHandlersList::erase(key_)", SIGHAND); 00272 00273 m_set->erase (key_); 00274 }
|
|
Find event handler by its pointer key_.
Definition at line 316 of file SigHandlersList.h. References m_set, ASSA::SIGHAND, and trace_with_mask. Referenced by ASSA::SigHandlers::remove(). 00317 { 00318 trace_with_mask("SigHandlersList::find", SIGHAND); 00319 00320 return m_set->find (key_); 00321 }
|
|
Add an event handler data_ to the list.
Definition at line 239 of file SigHandlersList.h. References m_set, ASSA::SIGHAND, and trace_with_mask. Referenced by ASSA::SigHandlers::install(). 00240 { 00241 trace_with_mask("SigHandlersList::insert", SIGHAND); 00242 00243 /*--- 00244 Insert 'eh_' into the set. set::insert() returns a 'pair' object. 00245 00246 If the set doesn't contain an element that matches 'eh_', insert a 00247 copy of 'eh_' and returns a 'pair' whose first element is an 00248 iterator positioned at the new element and second element is 00249 'true'. 00250 00251 If the set already contains an element that matches 'eh_', returns 00252 a pair whose first element is an iterator positioned at the 00253 existing element and second element is false! 00254 ---*/ 00255 00256 set_t::const_iterator it = m_set->find (eh_); 00257 00258 /*--- Not in the set ---*/ 00259 if (it == m_set->end ()) { 00260 return (m_set->insert (eh_)).second; 00261 } 00262 /*--- Already in the set ---*/ 00263 return true; 00264 }
|
|
Retrieve a pointer to the list of event handlers listening to signum_ signal delivery.
Definition at line 201 of file SigHandlersList.h. References ASSA::APP, DL, m_instance, ASSA::SIGHAND, SigHandlersList(), and trace_with_mask. Referenced by ASSA::SigHandlers::dispatch(), ASSA::SigHandlers::install(), and ASSA::SigHandlers::remove(). 00202 { 00203 trace_with_mask("SigHandlersList::instance", SIGHAND); 00204 00205 DL((APP, "m_instance[%d] = 0x%x\n", signum_, 00206 SigHandlersList::m_instance[signum_])); 00207 00208 if (SigHandlersList::m_instance[signum_] == 0) { 00209 DL((APP, "new SigHandlersList allocated\n")); 00210 SigHandlersList::m_instance[signum_] = new SigHandlersList(); 00211 } 00212 return SigHandlersList::m_instance[signum_]; 00213 }
|
|
|
|
Definition at line 356 of file SigHandlersList.h. References m_seen_cfh, ASSA::SIGHAND, and trace_with_mask. 00357 { 00358 trace_with_mask("SigHandlersList::seen_cfunc_handler", SIGHAND); 00359 00360 return m_seen_cfh; 00361 }
|
|
Indicate whether 3rd party C function handler was installed.
Definition at line 347 of file SigHandlersList.h. References m_seen_cfh, ASSA::SIGHAND, and trace_with_mask. 00348 { 00349 trace_with_mask("SigHandlersList::seen_cfunc_handler", SIGHAND); 00350 00351 m_seen_cfh = ft_; 00352 }
|
|
Size of the list.
Definition at line 228 of file SigHandlersList.h. References m_set, ASSA::SIGHAND, and trace_with_mask. Referenced by ASSA::SigHandlers::remove(). 00229 { 00230 trace_with_mask("SigHandlersList::size", SIGHAND); 00231 00232 // return number of elements in the map 00233 00234 return m_set->size (); 00235 }
|
|
Pointer to the 3rd party signal handler in the set.
Definition at line 171 of file SigHandlersList.h. Referenced by cfunc_handler(). |
|
Static map of signal numbers to SigHandlerLists.
Definition at line 157 of file SigHandlersList.h. Referenced by instance(). |
|
If true this flag indicates that 3rd party event handler has already been installed prior taking control by SigHandlers manager.
Definition at line 167 of file SigHandlersList.h. Referenced by cfunc_handler(), and seen_cfunc_handler(). |
|
Set of all event handlers registered for this signal.
Definition at line 161 of file SigHandlersList.h. Referenced by begin(), empty(), end(), erase(), find(), insert(), SigHandlersList(), size(), and ~SigHandlersList(). |