FACT++  1.0
template<class T>
pair<uint64_t, EventImp *> RemoteControl< T >::JsGetEvent ( const std::string &  service)
inlineprotectedvirtual

Reimplemented from InterpreterV8.

Definition at line 274 of file RemoteControl.h.

275  {
276  // This function is called from JavaScript
277  const lock_guard<mutex> lock(fMutex);
278 
279  const auto it = fInfo.find(service);
280 
281  // No subscription for this event available
282  if (it==fInfo.end())
283  return make_pair(0, static_cast<EventImp*>(NULL));
284 
285  EventInfo &info = it->second;
286 
287  // No event was received yet
288  if (info.counter==0)
289  return make_pair(0, static_cast<EventImp*>(NULL));
290 
291  return make_pair(info.counter-1, (EventImp*)&info.data);
292  }
std::mutex fMutex
A general base-class describing events issues in a state machine.
Definition: EventImp.h:11
map< string, EventInfo > fInfo