FACT++  1.0
void StateMachineDim::exitHandler ( int  code)
privatevirtual

DimService offering fCurrentState.

exitHandler of the DimServer. The EXIT command is implemented by each DimServer automatically. exitHandler calls Stop(code) and exit(-1) in case the received exit-value is a special number (42). abort() is called if 0x42 is received.

Parameters
codevalue which is passed to Stop(code)

Reimplemented from DimErrorRedirecter.

Definition at line 226 of file StateMachineDim.cc.

References Time::GetAsStr(), MessageImp::Out(), and StateMachineImp::Stop().

227 {
228  Out() << " -- " << Time().GetAsStr() << " - EXIT(" << code << ") command received." << endl;
229  if (code<0) // negative values reserved for internal use
230  {
231  Out() << " -- " << Time().GetAsStr() << ": ignored." << endl;
232  return;
233  }
234 
235  Stop(code);
236  if (code==42)
237  exit(128);
238  if (code==0x42)
239  abort();
240 }
virtual void Stop(int code=0)
Request to stop the mainloop.
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
std::ostream & Out() const
Definition: MessageImp.h:73
std::string GetAsStr(const char *fmt="%Y-%m-%d %H:%M:%S") const
Definition: Time.cc:240

+ Here is the call graph for this function: