FACT++  1.0
int DimControl::Handler ( const EventImp evt)
inlineprivatevirtual

Reimplemented from DimState.

Definition at line 256 of file DimState.h.

References DimState::Callback(), DimState::HandlerImp(), StateMachineImp::kSM_KeepState, and DimState::msg.

257  {
258  HandlerImp(evt);
259 
260  shortmsg = msg;
261  file = "";
262  scriptdepth = -1;
263 
264  // Find begining of descriptor
265  const size_t p0 = msg.find_first_of(' ');
266  if (p0==std::string::npos)
268 
269  // Find begining of filename
270  const size_t p1 = msg.find_first_of(':');
271  if (p1==std::string::npos)
273 
274  // Find end of filename
275  const size_t p2 = msg.find_last_of('[');
276  if (p2==std::string::npos)
278 
279  scriptdepth = atoi(msg.c_str()+p0+1);
280  file = msg.substr(p1+1, p2-p1-1);
281 
282  shortmsg.insert(0, msg.substr(p0+1, p1-p0));
283  shortmsg.erase(p1+1,p2-p0-1);
284 
285  const int rc = Callback(evt);
286 
287  const auto func = fCallbacks.find(file);
288  if (func==fCallbacks.end())
289  return rc;
290 
291  // Call callback
292  return func->second(evt);
293  }
int scriptdepth
Definition: DimState.h:301
void HandlerImp(const EventImp &evt)
Definition: DimState.h:29
std::map< std::string, callback > fCallbacks
Definition: DimState.h:254
std::string shortmsg
Definition: DimState.h:300
std::string file
Definition: DimState.h:299
int Callback(const EventImp &evt)
Definition: DimState.h:39
std::string msg
Definition: DimState.h:66

+ Here is the call graph for this function: