This is Unofficial EPICS BASE Doxygen Site
rpcService.cpp
Go to the documentation of this file.
1 
7 #define epicsExportSharedSymbols
8 #include <pv/rpcService.h>
9 
10 namespace pvd = epics::pvData;
11 
12 namespace epics{namespace pvAccess{
13 
15  pvd::PVStructure::shared_pointer const & args,
16  RPCResponseCallback::shared_pointer const & callback)
17 {
18  assert(callback && args);
19  pvd::PVStructure::shared_pointer ret;
20  pvd::Status sts;
21  try {
22  ret = request(args);
23  }catch(RPCRequestException& e){
24  sts = e.asStatus();
25  throw;
26  }catch(std::exception& e){
27  sts = pvd::Status::error(e.what());
28  }
29  if(!ret) {
30  sts = pvd::Status(pvd::Status::STATUSTYPE_FATAL, "RPCService.request(PVStructure) returned null.");
31  }
32  callback->requestDone(sts, ret);
33 }
34 
35 }} // namespace epics::pvAccess
#define assert(exp)
Declare that a condition should be true.
Definition: epicsAssert.h:70
static Status error(const std::string &m)
Definition: status.h:50
TODO only here because of the Lockable.
Definition: ntaggregate.cpp:16
pvData
Definition: monitor.h:428
Definition: caget.c:48
virtual epics::pvData::PVStructure::shared_pointer request(epics::pvData::PVStructure::shared_pointer const &args)=0