Rudiments

signalclasses.h
1 // Copyright (c) 1999-2018 David Muse
2 // See the COPYING file for more information.
3
4 #ifndef RUDIMENTS_SIGNALCLASSES_H
5 #define RUDIMENTS_SIGNALCLASSES_H
6
7 #include <rudiments/private/signalclassesincludes.h>
8
12 class RUDIMENTS_DLLSPEC signalset {
13 friend class signalmanager;
14 friend class signalhandler;
15 public:
16
18 signalset();
19
21 ~signalset();
22
25 bool addSignal(int32_t signum);
26
29 bool addAllSignals();
30
33 bool removeSignal(int32_t signum);
34
37 bool removeShutDownSignals();
38
41 bool removeCrashSignals();
42
45 bool removeAllSignals();
46
49 int32_t signalIsInSet(int32_t signum) const;
50
51 #include <rudiments/private/signalset.h>
52 };
53
54
55
58 class RUDIMENTS_DLLSPEC signalmanager {
59 public:
69 static uint32_t alarm(uint32_t seconds);
70
73 static bool ignoreSignals(const signalset *sset);
74
78 static bool waitForSignals(const signalset *mask);
79
84 static bool examineBlockedSignals(signalset *sset);
85 };
86
87
90 class RUDIMENTS_DLLSPEC signalhandler {
91 public:
92
94 signalhandler();
95
97 ~signalhandler();
98
101 void setHandler(void (*handler)(int32_t));
102
105 void (*getHandler())(int32_t);
106
113 bool handleSignal(int32_t signum);
114
123 bool handleSignal(int32_t signum, signalhandler *oldhandler);
124
126 void removeAllFlags();
127
130 void addFlag(int32_t flag);
131
134 void removeFlag(int32_t flag);
135
138 int32_t getFlags() const;
139
140
142 void setMask(const signalset *sset);
143
145 const signalset *getMask() const;
146
157 static bool isSignalHandlerIntUsed();
158
159 #include <rudiments/private/signalhandler.h>
160
161 };
162
163 #endif
signalhandler
Definition: signalclasses.h:90
signalhandler::setHandler
void setHandler(void(*handler)(int32_t))
signalhandler::signalhandler
signalhandler()
signalhandler::~signalhandler
~signalhandler()
signalhandler::getHandler
void(*)(int32_t) getHandler()
Definition: signalclasses.h:105
signalhandler::isSignalHandlerIntUsed
static bool isSignalHandlerIntUsed()
signalhandler::getMask
const signalset * getMask() const
signalhandler::addFlag
void addFlag(int32_t flag)
signalhandler::removeFlag
void removeFlag(int32_t flag)
signalhandler::handleSignal
bool handleSignal(int32_t signum)
signalhandler::getFlags
int32_t getFlags() const
signalhandler::handleSignal
bool handleSignal(int32_t signum, signalhandler *oldhandler)
signalhandler::setMask
void setMask(const signalset *sset)
signalhandler::removeAllFlags
void removeAllFlags()
signalmanager
Definition: signalclasses.h:58
signalmanager::alarm
static uint32_t alarm(uint32_t seconds)
signalmanager::examineBlockedSignals
static bool examineBlockedSignals(signalset *sset)
signalmanager::ignoreSignals
static bool ignoreSignals(const signalset *sset)
signalmanager::waitForSignals
static bool waitForSignals(const signalset *mask)
signalset
Definition: signalclasses.h:12
signalset::signalIsInSet
int32_t signalIsInSet(int32_t signum) const
signalset::removeShutDownSignals
bool removeShutDownSignals()
signalset::removeCrashSignals
bool removeCrashSignals()
signalset::removeAllSignals
bool removeAllSignals()
signalset::~signalset
~signalset()
signalset::addSignal
bool addSignal(int32_t signum)
signalset::removeSignal
bool removeSignal(int32_t signum)
signalset::addAllSignals
bool addAllSignals()
signalset::signalset
signalset()