timer Class Reference
Implements a timeout mechanism via sigalarm.
More...
List of all members.
|
Public Member Functions |
| | ClassName ("timer") |
| | Declare name of the class and its debug switch.
|
| | timer (const unsigned int newTimeOut) |
| | Construct from components.
|
| | ~timer () |
Public Attributes |
| unsigned int | newTimeOut_ |
| | current time out value. Needed by macro timedOut
|
Static Public Attributes |
| static jmp_buf | envAlarm |
| | state for setjmp. Needed by macro timedOut
|
Detailed Description
Implements a timeout mechanism via sigalarm.
Example usage:
Constructor set signal handler on sigalarm and alarm(). Destructor clears these.
timedOut is macro because setjmp can't be in member function of timer. ?something to do with stack frames.
- Warning:
- The setjmp restores complete register state so including local vars held in regs. So if in blocking part something gets calced in a stack based variable make sure it is declared 'volatile'.
- Source files
-
Definition at line 79 of file timer.H.
Constructor & Destructor Documentation
| timer |
( |
const unsigned int |
newTimeOut |
) |
|
Construct from components.
newTimeOut=0 makes it do nothing.
Definition at line 53 of file timer.C.
Member Function Documentation
Declare name of the class and its debug switch.
Member Data Documentation
current time out value. Needed by macro timedOut
Definition at line 104 of file timer.H.
state for setjmp. Needed by macro timedOut
Definition at line 107 of file timer.H.
The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd