Go to the documentation of this file.
33 #undef DebugInfo // Windows name clash with OpenFOAM messageStream
35 #define WIN32_LEAN_AND_MEAN
37 #define WINVER 0x0500 // To access CreateTimerQueueTimer
55 unsigned int Foam::timer::oldTimeOut_ = 0;
62 static VOID CALLBACK
timerExpired(PVOID lpParam, BOOLEAN TimerOrWaitFired)
70 void Foam::timer::sigHandler(
int)
93 <<
"timer already used."
101 const bool ok = ::CreateTimerQueueTimer
116 <<
"CreateTimerQueueTimer, "
122 <<
"Installing timeout " << int(
timeOut_) <<
" seconds"
123 <<
" (overriding old timeout " << int(oldTimeOut_) <<
")." <<
endl;
137 <<
"timeOut=" << int(timeOut_)
138 <<
" : resetting timeOut to " << int(oldTimeOut_) <<
endl;
141 const bool ok = ::DeleteTimerQueueTimer(
nullptr,
hTimer_,
nullptr);
148 <<
"DeleteTimerQueueTimer, "
~timer()
Destructor. Restores the alarm and signal handler as required.
static void resetHandler(const char *what, int sigNum)
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define DebugInFunction
Report an information message using Foam::Info.
timer(unsigned int seconds)
Construct with specified time-out, a value of 0 makes it a no-op.
static jmp_buf envAlarm
State for setjmp. Needed by macro timedOut.
File-local code for setting/resetting signal handlers.
std::string lastError()
The last Windows API error from GetLastError.
errorManip< error > abort(error &err)
static VOID CALLBACK timerExpired(PVOID lpParam, BOOLEAN TimerOrWaitFired)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void setHandler(const char *what, int sigNum, void(*handler)(int))
unsigned int timeOut_
The time-out value (seconds). Needed by macro timedOut.
defineTypeNameAndDebug(combustionModel, 0)