SignalHandler Class Reference

Ratpac-two: SignalHandler Class Reference
Ratpac-two
SignalHandler Class Reference

#include <SignalHandler.hh>

Detailed Description

Catches UNIX signals sent to the main application by the operating system.

Author
Stan Seibert volsu.nosp@m.ng@p.nosp@m.hysic.nosp@m.s.ut.nosp@m.exas..nosp@m.edu

This is a singleton which handles UNIX signals sent by the operating system. It must be initialized in the main() function of the program by calling SignalHandler::Init(). Then SIGINT (sent by Ctrl-C) will be trapped by this handler. All other signals remain connected to the default handlers.

When SIGINT is first received, a flag is set and execution resumes as normal. The flag can be checked by calling SignalHandler::IsTermRequested(). If it returns true, then the current operation should be aborted as soon as it is possible without losing data. In general, the only objects which need to check this flag are subclasses of Producer. If the user really needs to abort now, they can hit Ctrl-C again, and the second time SIGINT is received, the application terminates immediately with no cleanup.

Note that this class only contains static methods and cannot be instantiated.


The documentation for this class was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/core/include/RAT/SignalHandler.hh