void ExampleLink::monitorEvent(epics::pvData::MonitorPtr const & monitor) { cout << "ExampleLink::monitorEvent\n"; lock(); try { beginGroupPut(); process(); endGroupPut(); } catch(...) { unlock(); throw; } unlock(); MonitorElementPtr monitorElement = monitor->poll(); if(monitorElement) monitor->release(monitorElement); }
void TestChannelMonitorRequester::monitorEvent(pvd::MonitorPtr const & monitor) { testDiag("monitorEvent %p", monitor.get()); mon = monitor; eventCnt++; wait.trigger(); }
void TestChannelMonitorRequester::unlisten(pvd::MonitorPtr const & monitor) { testDiag("unlisten %p", monitor.get()); Guard G(lock); unlistend = true; wait.trigger(); }
void TestChannelMonitorRequester::monitorConnect(pvd::Status const & status, pvd::MonitorPtr const & monitor, pvd::StructureConstPtr const & structure) { testDiag("monitorConnect %p %d", monitor.get(), (int)status.isSuccess()); Guard G(lock); connectStatus = status; dtype = structure; connected = true; wait.trigger(); }
void ExampleLink::monitorEvent(epics::pvData::MonitorPtr const & monitor) { while(true) { MonitorElementPtr monitorElement = monitor->poll(); if(!monitorElement) break; PVStructurePtr pvStructurePtr = monitorElement->pvStructurePtr; PVDoubleArrayPtr pvDoubleArray = pvStructurePtr->getSubField<PVDoubleArray>("value"); if(!pvDoubleArray) throw std::runtime_error("value is not a double array"); lock(); try { beginGroupPut(); pvValue->replace(pvDoubleArray->view()); process(); endGroupPut(); } catch(...) { unlock(); throw; } unlock(); monitor->release(monitorElement); } }