Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Sig_Set Class Reference

Provide a C++ wrapper for the C sigset_t interface. More...

#include <Signal.h>

List of all members.

Public Methods

 ACE_Sig_Set (sigset_t *sigset)
 Initialize <sigset_> with <sigset>. If <sigset> == 0 then fill the set. More...

 ACE_Sig_Set (ACE_Sig_Set *sigset)
 Initialize <sigset_> with <sigset>. If <sigset> == 0 then fill the set. More...

 ACE_Sig_Set (int fill=0)
 If <fill> == 0 then initialize the <sigset_> to be empty, else full. More...

 ~ACE_Sig_Set (void)
int empty_set (void)
 Create a set that excludes all signals defined by the system. More...

int fill_set (void)
 Create a set that includes all signals defined by the system. More...

int sig_add (int signo)
 Adds the individual signal specified by <signo> to the set. More...

int sig_del (int signo)
 Deletes the individual signal specified by <signo> from the set. More...

int is_member (int signo) const
 Checks whether the signal specified by <signo> is in the set. More...

 operator sigset_t * ()
 Returns a pointer to the underlying <sigset_t>. More...

sigset_t sigset (void) const
 Returns a copy of the underlying <sigset_t>. More...

void dump (void) const
 Dump the state of an object. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Private Attributes

sigset_t sigset_
 Set of signals. More...


Detailed Description

Provide a C++ wrapper for the C sigset_t interface.

Handle signals via a more elegant C++ interface (e.g., doesn't require the use of global variables or global functions in an application).

Definition at line 41 of file Signal.h.


Constructor & Destructor Documentation

ACE_INLINE ACE_Sig_Set::ACE_Sig_Set sigset_t *    sigset
 

Initialize <sigset_> with <sigset>. If <sigset> == 0 then fill the set.

Definition at line 5 of file Signal.i.

References ACE_TRACE, and ACE_OS::sigfillset.

00006      : sigset_ ()
00007 {
00008   ACE_TRACE ("ACE_Sig_Set::ACE_Sig_Set");
00009 
00010   if (ss == 0)
00011     ACE_OS::sigfillset (&this->sigset_);
00012   else
00013     // Structure assignment.
00014     this->sigset_ = *ss;
00015 }

ACE_INLINE ACE_Sig_Set::ACE_Sig_Set ACE_Sig_Set *    sigset
 

Initialize <sigset_> with <sigset>. If <sigset> == 0 then fill the set.

Definition at line 30 of file Signal.i.

References ACE_TRACE, and ACE_OS::sigfillset.

00031      : sigset_ ()
00032 {
00033   ACE_TRACE ("ACE_Sig_Set::ACE_Sig_Set");
00034 
00035   if (ss == 0)
00036     ACE_OS::sigfillset (&this->sigset_);
00037   else
00038     this->sigset_ = ss->sigset_;
00039 }

ACE_INLINE ACE_Sig_Set::ACE_Sig_Set int    fill = 0
 

If <fill> == 0 then initialize the <sigset_> to be empty, else full.

Definition at line 18 of file Signal.i.

References ACE_TRACE, ACE_OS::sigemptyset, and ACE_OS::sigfillset.

00019      : sigset_ ()
00020 {
00021   ACE_TRACE ("ACE_Sig_Set::ACE_Sig_Set");
00022 
00023   if (fill)
00024     ACE_OS::sigfillset (&this->sigset_);
00025   else
00026     ACE_OS::sigemptyset (&this->sigset_);
00027 }

ACE_INLINE ACE_Sig_Set::~ACE_Sig_Set void   
 

Definition at line 42 of file Signal.i.

References ACE_TRACE, and ACE_OS::sigemptyset.

00043 {
00044   ACE_TRACE ("ACE_Sig_Set::~ACE_Sig_Set");
00045   ACE_OS::sigemptyset (&this->sigset_);
00046 }


Member Function Documentation

void ACE_Sig_Set::dump void    const
 

Dump the state of an object.

Definition at line 65 of file Signal.cpp.

References ACE_TRACE.

00066 {
00067   ACE_TRACE ("ACE_Sig_Set::dump");
00068 }

ACE_INLINE int ACE_Sig_Set::empty_set void   
 

Create a set that excludes all signals defined by the system.

Definition at line 49 of file Signal.i.

References ACE_TRACE, and ACE_OS::sigemptyset.

00050 {
00051   ACE_TRACE ("ACE_Sig_Set::empty_set");
00052   return ACE_OS::sigemptyset (&this->sigset_);
00053 }

ACE_INLINE int ACE_Sig_Set::fill_set void   
 

Create a set that includes all signals defined by the system.

Definition at line 56 of file Signal.i.

References ACE_TRACE, and ACE_OS::sigfillset.

00057 {
00058   ACE_TRACE ("ACE_Sig_Set::fill_set");
00059   return ACE_OS::sigfillset (&this->sigset_);
00060 }

ACE_INLINE int ACE_Sig_Set::is_member int    signo const
 

Checks whether the signal specified by <signo> is in the set.

Definition at line 77 of file Signal.i.

References ACE_TRACE, and ACE_OS::sigismember.

Referenced by ACE_Sig_Action::ACE_Sig_Action, ACE_WFMO_Reactor::register_handler, ACE_Dev_Poll_Reactor::register_handler, ACE_WFMO_Reactor::remove_handler, and ACE_Dev_Poll_Reactor::remove_handler.

00078 {
00079   ACE_TRACE ("ACE_Sig_Set::is_member");
00080   return ACE_OS::sigismember (ACE_const_cast (sigset_t *, &this->sigset_), signo);
00081 }

ACE_INLINE ACE_Sig_Set::operator sigset_t *  
 

Returns a pointer to the underlying <sigset_t>.

Definition at line 84 of file Signal.i.

References ACE_TRACE, and sigset_.

00085 {
00086   ACE_TRACE ("ACE_Sig_Set::operator sigset_t *");
00087   return &this->sigset_;
00088 }

ACE_INLINE int ACE_Sig_Set::sig_add int    signo
 

Adds the individual signal specified by <signo> to the set.

Definition at line 63 of file Signal.i.

References ACE_TRACE, and ACE_OS::sigaddset.

00064 {
00065   ACE_TRACE ("ACE_Sig_Set::sig_add");
00066   return ACE_OS::sigaddset (&this->sigset_, signo);
00067 }

ACE_INLINE int ACE_Sig_Set::sig_del int    signo
 

Deletes the individual signal specified by <signo> from the set.

Definition at line 70 of file Signal.i.

References ACE_TRACE, and ACE_OS::sigdelset.

00071 {
00072   ACE_TRACE ("ACE_Sig_Set::sig_del");
00073   return ACE_OS::sigdelset (&this->sigset_, signo);
00074 }

ACE_INLINE sigset_t ACE_Sig_Set::sigset void    const
 

Returns a copy of the underlying <sigset_t>.

Definition at line 91 of file Signal.i.

References ACE_TRACE, and sigset_.

Referenced by ACE_Sig_Action::ACE_Sig_Action, and ACE_Sig_Action::mask.

00092 {
00093   ACE_TRACE ("ACE_Sig_Set::sigset");
00094   return this->sigset_;
00095 }


Member Data Documentation

ACE_Sig_Set::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 84 of file Signal.h.

sigset_t ACE_Sig_Set::sigset_ [private]
 

Set of signals.

Definition at line 88 of file Signal.h.

Referenced by operator sigset_t *, and sigset.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:56:11 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002