/build/buildd/libassa-3.4.1/assa/SigSet.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //------------------------------------------------------------------------------
00003 //                            SigSet.h
00004 //------------------------------------------------------------------------------
00005 //  Copyright (c) 1997 by Vladislav Grinchenko
00006 //
00007 //  This library is free software; you can redistribute it and/or
00008 //  modify it under the terms of the GNU Library General Public
00009 //  License as published by the Free Software Foundation; either
00010 //  version 2 of the License, or (at your option) any later version.
00011 //------------------------------------------------------------------------------
00012 #ifndef _SigSet_h
00013 #define _SigSet_h
00014 
00015 // System includes
00016 //
00017 #include <signal.h>
00018 #include <errno.h>
00019 
00020 namespace ASSA {
00021 
00050 class SigSet
00051 {
00052 public:
00056     SigSet();
00057 
00060     SigSet(sigset_t* source_);
00061     
00064     ~SigSet();
00065 
00072     int empty (void);
00073 
00080     int fill(void);
00081 
00088     int add(int signo_);
00089 
00095     int del(int signo_);
00096 
00102     int is_member(int signo_);
00103 
00107     operator sigset_t *();
00108 
00109 private:
00111     sigset_t m_sigset; 
00112 };
00113 
00114 inline
00115 SigSet::
00116 SigSet() {  (int) sigemptyset(&m_sigset); }
00117 
00118 inline
00119 SigSet::
00120 SigSet(sigset_t* s_) { m_sigset = *s_; }
00121 
00122 inline 
00123 SigSet::
00124 ~SigSet() { /* no-op */ }
00125 
00126 inline int
00127 SigSet::
00128 empty(void) { return sigemptyset(&m_sigset); }
00129 
00130 inline int
00131 SigSet::
00132 fill(void) { return sigfillset(&m_sigset); }
00133 
00134 inline int
00135 SigSet::
00136 add(int signo_) { return sigaddset(&m_sigset,signo_); }
00137 
00138 inline int
00139 SigSet::
00140 del(int signo_) { return sigdelset(&m_sigset,signo_); }
00141 
00142 inline int
00143 SigSet::
00144 is_member(int signo_) { return sigismember(&m_sigset,signo_); }
00145 
00146 inline 
00147 SigSet::
00148 operator sigset_t *() { return &m_sigset; }
00149 
00150 } // end namespace ASSA
00151 
00152 #endif /* _SigSet_h */

Generated on Wed Jun 21 15:58:58 2006 for libassa by  doxygen 1.4.6