libassa 3.5.1
Loading...
Searching...
No Matches
SigSet.h
Go to the documentation of this file.
1// -*- c++ -*-
2//------------------------------------------------------------------------------
3// SigSet.h
4//------------------------------------------------------------------------------
5// Copyright (c) 1997 by Vladislav Grinchenko
6//
7// This library is free software; you can redistribute it and/or
8// modify it under the terms of the GNU Library General Public
9// License as published by the Free Software Foundation; either
10// version 2 of the License, or (at your option) any later version.
11//------------------------------------------------------------------------------
12#ifndef _SigSet_h
13#define _SigSet_h
14
15// System includes
16//
17#include <signal.h>
18#include <errno.h>
19
20namespace ASSA {
21
22#if !defined(WIN32)
23
52class SigSet
53{
54public:
58 SigSet();
59
63
66 ~SigSet();
67
74 int empty (void);
75
82 int fill(void);
83
90 int add(int signo_);
91
97 int del(int signo_);
98
104 int is_member(int signo_);
105
109 operator sigset_t *();
110
111private:
114};
115
116inline
119
120inline
123
124inline
126~SigSet() { /* no-op */ }
127
128inline int
130empty(void) { return sigemptyset(&m_sigset); }
131
132inline int
134fill(void) { return sigfillset(&m_sigset); }
135
136inline int
139
140inline int
143
144inline int
147
148inline
149SigSet::
150operator sigset_t *() { return &m_sigset; }
151
152#endif // !defined(WIN32)
153
154} // end namespace ASSA
155
156#endif /* _SigSet_h */
A wrapper class to provide AutoPtr with reference semantics.
Definition AutoPtr.h:32
SigSet()
Default constructor creates SigSet object with an empty signal set.
Definition SigSet.h:118
sigset_t m_sigset
POSIX signal set.
Definition SigSet.h:113
int fill(void)
This function initializes a signal set to be full; all the signals defined by POSIX will be in the se...
Definition SigSet.h:134
int empty(void)
This function initializes a signal set to be empty, no signals in it.
Definition SigSet.h:130
~SigSet()
Destructor.
Definition SigSet.h:126
int is_member(int signo_)
Use this function to tell whether the signal signo_ is in the set.
Definition SigSet.h:146
int del(int signo_)
This function removes the signal signo_ from the set.
Definition SigSet.h:142
int add(int signo_)
This function adds the signal numbered signo_ to the set.
Definition SigSet.h:138