This is Unofficial EPICS BASE Doxygen Site
rpcService.h
Go to the documentation of this file.
1 
7 #ifndef RPCSERVICE_H
8 #define RPCSERVICE_H
9 
10 #include <stdexcept>
11 
12 #ifdef epicsExportSharedSymbols
13 # define rpcServiceEpicsExportSharedSymbols
14 # undef epicsExportSharedSymbols
15 #endif
16 
17 #include <pv/sharedPtr.h>
18 #include <pv/status.h>
19 
20 #ifdef rpcServiceEpicsExportSharedSymbols
21 # define epicsExportSharedSymbols
22 # undef rpcServiceEpicsExportSharedSymbols
23 #endif
24 
25 #include <pv/pvAccess.h>
26 
27 #include <shareLib.h>
28 
29 namespace epics {
30 namespace pvAccess {
31 
32 class epicsShareClass RPCRequestException : public std::runtime_error {
33 public:
34 
35  explicit RPCRequestException(std::string const & message) :
36  std::runtime_error(message), m_status(epics::pvData::Status::STATUSTYPE_ERROR)
37  {}
38 
40  std::runtime_error(message), m_status(status)
41  {}
42 
44  return m_status;
45  }
46 
48  return epics::pvData::Status(m_status, what());
49  }
50 private:
52 };
53 
55 {
56 public:
58 
59  virtual ~RPCResponseCallback() {};
60 
61  virtual void requestDone(
63  epics::pvData::PVStructure::shared_pointer const & result
64  ) = 0;
65 };
66 
68 {
69 public:
71 
72  virtual ~RPCServiceAsync() {};
73 
74  virtual void request(
75  epics::pvData::PVStructure::shared_pointer const & args,
76  RPCResponseCallback::shared_pointer const & callback
77  ) = 0;
78 };
79 
81  public RPCServiceAsync
82 {
83 public:
85 
86  virtual ~RPCService() {};
87 
88  virtual epics::pvData::PVStructure::shared_pointer request(
89  epics::pvData::PVStructure::shared_pointer const & args
90  ) = 0;
91 
92 private:
93  virtual void request(
94  epics::pvData::PVStructure::shared_pointer const & args,
95  RPCResponseCallback::shared_pointer const & callback
96  ) OVERRIDE FINAL;
97 };
98 
99 }
100 }
101 
102 #endif /* RPCSERVICE_H */
pvac::PutEvent result
Definition: clientSync.cpp:117
std::string request
pvd::Status status
Definition: memory.hpp:41
TODO only here because of the Lockable.
Definition: ntaggregate.cpp:16
Mark external symbols and entry points for shared libraries.
RPCRequestException(std::string const &message)
Definition: rpcService.h:35
#define OVERRIDE
Definition: pvAccess.h:55
epics::pvData::Status asStatus() const
Definition: rpcService.h:47
#define POINTER_DEFINITIONS(clazz)
Definition: sharedPtr.h:198
Definition: caget.c:48
#define epicsShareClass
Definition: shareLib.h:206
epics::pvData::Status::StatusType getStatus() const
Definition: rpcService.h:43
RPCRequestException(epics::pvData::Status::StatusType status, std::string const &message)
Definition: rpcService.h:39
#define FINAL
Definition: pvAccess.h:48