ACE_Sig_Set Class Reference

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

#include <Signal.h>

List of all members.

Public Member Functions

 ACE_Sig_Set (sigset_t *sigset)
 ACE_Sig_Set (ACE_Sig_Set *sigset)
 ACE_Sig_Set (int fill=0)
 ~ACE_Sig_Set (void)
int empty_set (void)
 Create a set that excludes all signals defined by the system.

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

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

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

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

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

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

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


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Private Attributes

sigset_t sigset_
 Set of signals.


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 46 of file Signal.h.


Constructor & Destructor Documentation

ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_Sig_Set::ACE_Sig_Set sigset_t *  sigset  ) 
 

Initialize with sigset. If sigset == 0 then fill the set.

Definition at line 10 of file Signal.inl.

References ACE_TRACE, ACE_OS::sigfillset(), and sigset_.

00011      : sigset_ ()
00012 {
00013   ACE_TRACE ("ACE_Sig_Set::ACE_Sig_Set");
00014 
00015   if (ss == 0)
00016     ACE_OS::sigfillset (&this->sigset_);
00017   else
00018     // Structure assignment.
00019     this->sigset_ = *ss;
00020 }

ACE_INLINE ACE_Sig_Set::ACE_Sig_Set ACE_Sig_Set sigset  ) 
 

Initialize with sigset. If sigset == 0 then fill the set.

Definition at line 35 of file Signal.inl.

References ACE_TRACE, ACE_OS::sigfillset(), and sigset_.

00036      : sigset_ ()
00037 {
00038   ACE_TRACE ("ACE_Sig_Set::ACE_Sig_Set");
00039 
00040   if (ss == 0)
00041     ACE_OS::sigfillset (&this->sigset_);
00042   else
00043     this->sigset_ = ss->sigset_;
00044 }

ACE_INLINE ACE_Sig_Set::ACE_Sig_Set int  fill = 0  ) 
 

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

Definition at line 23 of file Signal.inl.

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

00024      : sigset_ ()
00025 {
00026   ACE_TRACE ("ACE_Sig_Set::ACE_Sig_Set");
00027 
00028   if (fill)
00029     ACE_OS::sigfillset (&this->sigset_);
00030   else
00031     ACE_OS::sigemptyset (&this->sigset_);
00032 }

ACE_Sig_Set::~ACE_Sig_Set void   ) 
 

Definition at line 68 of file Signal.cpp.

References ACE_TRACE, and ACE_OS::sigemptyset().

00069 {
00070   ACE_TRACE ("ACE_Sig_Set::~ACE_Sig_Set");
00071   ACE_OS::sigemptyset (&this->sigset_);
00072 }


Member Function Documentation

void ACE_Sig_Set::dump void   )  const
 

Dump the state of an object.

Definition at line 101 of file Signal.cpp.

References ACE_TRACE.

00102 {
00103 #if defined (ACE_HAS_DUMP)
00104   ACE_TRACE ("ACE_Sig_Set::dump");
00105 #endif /* ACE_HAS_DUMP */
00106 }

ACE_INLINE int ACE_Sig_Set::empty_set void   ) 
 

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

Definition at line 47 of file Signal.inl.

References ACE_TRACE, and ACE_OS::sigemptyset().

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

ACE_INLINE int ACE_Sig_Set::fill_set void   ) 
 

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

Definition at line 54 of file Signal.inl.

References ACE_TRACE, and ACE_OS::sigfillset().

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

ACE_INLINE int ACE_Sig_Set::is_member int  signo  )  const
 

Checks whether the signal specified by is in the set.

Definition at line 75 of file Signal.inl.

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().

00076 {
00077   ACE_TRACE ("ACE_Sig_Set::is_member");
00078   return ACE_OS::sigismember (const_cast<sigset_t *> (&this->sigset_), signo);
00079 }

ACE_INLINE ACE_Sig_Set::operator sigset_t *  ) 
 

Returns a pointer to the underlying .

Definition at line 82 of file Signal.inl.

References ACE_TRACE, and sigset_.

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

ACE_INLINE int ACE_Sig_Set::sig_add int  signo  ) 
 

Adds the individual signal specified by to the set.

Definition at line 61 of file Signal.inl.

References ACE_TRACE, and ACE_OS::sigaddset().

Referenced by ACE_Service_Config::open_i().

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

ACE_INLINE int ACE_Sig_Set::sig_del int  signo  ) 
 

Deletes the individual signal specified by from the set.

Definition at line 68 of file Signal.inl.

References ACE_TRACE, and ACE_OS::sigdelset().

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

ACE_INLINE sigset_t ACE_Sig_Set::sigset void   )  const
 

Returns a copy of the underlying .

Definition at line 89 of file Signal.inl.

References ACE_TRACE, and sigset_.

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

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


Member Data Documentation

ACE_Sig_Set::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 89 of file Signal.h.

sigset_t ACE_Sig_Set::sigset_ [private]
 

Set of signals.

Definition at line 93 of file Signal.h.

Referenced by ACE_Sig_Set(), operator sigset_t *(), and sigset().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:29:41 2006 for ACE by doxygen 1.3.6