In file misc/SigFlag.hh:

class SigFlag

Signal handler.

Inheritance:


Public Classes

enum sigFunc
Function modifier flags.

Public Methods

SigFlag ()
Default constructor.
SigFlag (int sig, sigFunc flags=kNull)
Create a SigFlag and attach it to a signal.
~SigFlag (void)
SigFlag destructor
bool fBlock (void) const
Test kBlock flag.
bool fOnce (void) const
Test kOnce flag.
mask_t getSigFlags (void) const
Get signal mask.
bool isMember (int sig) const
Test if signal is in this flag group
operator bool () const
Conversion to bool data type.
bool test (void) const
Test if any signal has been caught.
bool test (int sig) const
Test if a specific signal has been caught.
void add (int sig)
Add a signal.
bool clear (void)
Clear all signal flags.
bool clear (int sig)
Clear a specified flag.
void clearFlags (mask_t flags)
Clear the specified signal flags.
void clrMode (sigFunc flags=kNull)
Clear the optional processing modes.
void remove (int sig)
Remove a signal from flag member list.
void setSig0 (void)
Set the unmaskable signal 0 flag.
void setMode (sigFunc flags=kNull)
Set the optional processing modes.
friend bool SigRestart (void)
Test whether to restart after a signal.
void zero (void)
Remove all signals.

Documentation

Class SigFlag establishes a signal handler for one or more specified signals. When a signal occurs, the handler remembers the signal, and optionally rearms. By default the signal will interrupt any blocked system functions. At present the handling of a signal by several SigFlags will give poorly defined results.
SigFlag()
Create an unattached SigFlag object.

enum sigFunc
Enumerate the bits for the signal function modifier flags. The valid bit values are:
kOnce (the handler catches a signal once and disarms)
kBlock (blocking system calls are not interrupted).

SigFlag(int sig, sigFunc flags=kNull)
The SigFlag object is constructed and attached to the specified signal.

~SigFlag(void)
SigFlag destructor

bool fBlock(void) const
Get the kBlock bit of the flag word. The kBlock flag indicates that the signal(s) specified by the object should not interrupt processing of the interruptable system calls.
Returns:
True if kBlock mode flag is set.

bool fOnce(void) const
Get the kOnce bit of the flag word. The kOnce flag indicates that the signal(s) specified by the object should be allowed to fire only once.
Returns:
True if kOnce mode flag is set.

mask_t getSigFlags(void) const
Get a mask containing one buit per signal caught.
Returns:
Mask with a bit set for each caught signal.

bool isMember(int sig) const
Test if the specified signal is a member of this flag group.
Returns:
True if the specified signal is a member of this flag.
Parameters:
sig - Signal to be tested for membership.

operator bool() const
The SigFlag is converted to true if any signal has been caught and not cleared.
Returns:
True if one or more signal flags are set.

bool test(void) const
Test returns true if any of the signals handled by the object has been caught.
Returns:
True if any signal has been caught.

bool test(int sig) const
Test returns true if the specified signals handled by the object has been caught.
Returns:
True if specified signal has been caught.
Parameters:
sig - Signal number to be tested.

void add(int sig)
Add a signal to the list of signals handled by this object.
Parameters:
sig - signal number to be added to member list.

bool clear(void)
Clear the flags for all signals. Clear returns true if one or more flags were set.
Returns:
true if one or more signals were set.

bool clear(int sig)
Clear the specified signal flag. Clear returns true if the specified flag was set.
Returns:
True if specified signal was set.

void clearFlags(mask_t flags)
The specified signal flags are cleared.
Parameters:
flags - Bit mask of signals to clear.

void clrMode(sigFunc flags=kNull)
The specified processing mode flags are cleared.
Parameters:
flags - Bit mask of mode flags to clear.

void remove(int sig)
Remove a signal from the list of signals handled by this object. No action is taken if the specified signal is not a member of the flag.
Parameters:
sig - Number of signal to be removed from the ember list.

void setSig0(void)
Set an unmaskable signal flag. This function gives the user a means to set a flag without sending a signal.

void setMode(sigFunc flags=kNull)
The SigFlag mode flags are set as specified.
Parameters:
flags - Bit mask of mode flags to set.

friend bool SigRestart(void)
The sRestart flag is tested. This is set by the Block flag of the most recently caught signal. This function is a workaround for the seeming inability of Solaris to restart some system calls after a signal is caught. This can be inspected after a system call returns with EINTR to see whether the call should be retried.
Returns:
False if the signal should interrupt the system calls.

void zero(void)
All signals are removed from the flag.


This class has no child classes.
Author:
J. Zweizig
Version:
1.2; Modified December 22, 1999

alphabetic index hierarchy of classes


Please send questions and comments to zweizig_j@ligo.caltech.edu


generated by doc++