FACT++  1.0
template<class T>
void* RemoteControl< T >::JsSubscribe ( const std::string &  service)
inlineprotectedvirtual

Reimplemented from InterpreterV8.

Definition at line 320 of file RemoteControl.h.

321  {
322  if (!fImp)
323  return 0;
324 
325  // This function is called from JavaScript
326  const lock_guard<mutex> lock(fMutex);
327 
328  // Do not subscribe twice
329  if (fInfo.find(service)!=fInfo.end())
330  return 0;
331 
332  EventImp *ptr = &fImp->Subscribe(service)(fImp->Wrap(bind(&RemoteControl<T>::Handle, this, placeholders::_1, service)));
333  fInfo.insert(make_pair(service, EventInfo(ptr)));
334  return ptr;
335  }
std::mutex fMutex
A general base-class describing events issues in a state machine.
Definition: EventImp.h:11
StateMachineDimControl * fImp
Definition: RemoteControl.h:70
Implements a remote control based on a Readline class for the dim network.
Definition: RemoteControl.h:67
map< string, EventInfo > fInfo
EventImp & Subscribe(const std::string &name)
std::function< int(const EventImp &)> Wrap(const std::function< int(const EventImp &)> &func)