/home/vlg/develop/libASSA/libassa/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 
00022 #if !defined(WIN32)
00023 
00052 class SigSet
00053 {
00054 public:
00058     SigSet();
00059 
00062     SigSet(sigset_t* source_);
00063     
00066     ~SigSet();
00067 
00074     int empty (void);
00075 
00082     int fill(void);
00083 
00090     int add(int signo_);
00091 
00097     int del(int signo_);
00098 
00104     int is_member(int signo_);
00105 
00109     operator sigset_t *();
00110 
00111 private:
00113     sigset_t m_sigset; 
00114 };
00115 
00116 inline
00117 SigSet::
00118 SigSet() {  (int) sigemptyset(&m_sigset); }
00119 
00120 inline
00121 SigSet::
00122 SigSet(sigset_t* s_) { m_sigset = *s_; }
00123 
00124 inline 
00125 SigSet::
00126 ~SigSet() { /* no-op */ }
00127 
00128 inline int
00129 SigSet::
00130 empty(void) { return sigemptyset(&m_sigset); }
00131 
00132 inline int
00133 SigSet::
00134 fill(void) { return sigfillset(&m_sigset); }
00135 
00136 inline int
00137 SigSet::
00138 add(int signo_) { return sigaddset(&m_sigset,signo_); }
00139 
00140 inline int
00141 SigSet::
00142 del(int signo_) { return sigdelset(&m_sigset,signo_); }
00143 
00144 inline int
00145 SigSet::
00146 is_member(int signo_) { return sigismember(&m_sigset,signo_); }
00147 
00148 inline 
00149 SigSet::
00150 operator sigset_t *() { return &m_sigset; }
00151 
00152 #endif // !defined(WIN32)
00153 
00154 } // end namespace ASSA
00155 
00156 #endif /* _SigSet_h */

Generated on Sun Aug 13 15:08:00 2006 for libassa by  doxygen 1.4.6