RPCClient is an interface class that is used by a service client.
More...
#include <rpcClient/pv/rpcClient.h>
|
| POINTER_DEFINITIONS (RPCClient) |
|
| RPCClient (const std::string &serviceName, epics::pvData::PVStructure::shared_pointer const &pvRequest, const ChannelProvider::shared_pointer &provider=ChannelProvider::shared_pointer(), const std::string &address=std::string()) |
|
void | destroy () |
| Destroy this instance (i.e. More...
|
|
bool | connect (double timeout=5.0) |
| Connect to the server. More...
|
|
void | issueConnect () |
| Issue a connect request and return immediately. More...
|
|
bool | waitConnect (double timeout=5.0) |
| Wait for the connect request to complete. More...
|
|
epics::pvData::PVStructure::shared_pointer | request (epics::pvData::PVStructure::shared_pointer const &pvArgument, double timeout=5.0, bool lastRequest=false) |
| Sends a request and wait for the response or until timeout occurs. More...
|
|
void | issueRequest (epics::pvData::PVStructure::shared_pointer const &pvArgument, bool lastRequest=false) |
| Issue a channelRPC request and return immediately. More...
|
|
epics::pvData::PVStructure::shared_pointer | waitResponse (double timeout=5.0) |
| Wait for the request to complete. More...
|
|
|
static shared_pointer | create (const std::string &serviceName, epics::pvData::PVStructure::shared_pointer const &pvRequest=epics::pvData::PVStructure::shared_pointer()) |
| Create a RPCClient. More...
|
|
RPCClient is an interface class that is used by a service client.
Definition at line 39 of file rpcClient.h.
◆ connect()
bool epics::pvAccess::RPCClient::connect |
( |
double |
timeout = 5.0 | ) |
|
Connect to the server.
The method blocks until the connection is made or a timeout occurs. It is the same as calling issueConnect and then waitConnect.
- Parameters
-
timeout | Timeout in seconds to wait, 0 means forever. |
- Returns
- (false,true) If (not connected, is connected). If false then connect must be reissued.
◆ create()
static shared_pointer epics::pvAccess::RPCClient::create |
( |
const std::string & |
serviceName, |
|
|
epics::pvData::PVStructure::shared_pointer const & |
pvRequest = epics::pvData::PVStructure::shared_pointer() |
|
) |
| |
|
static |
◆ destroy()
void epics::pvAccess::RPCClient::destroy |
( |
| ) |
|
Destroy this instance (i.e.
release resources).
◆ issueConnect()
void epics::pvAccess::RPCClient::issueConnect |
( |
| ) |
|
Issue a connect request and return immediately.
waitConnect must be called to complete the request.
◆ issueRequest()
void epics::pvAccess::RPCClient::issueRequest |
( |
epics::pvData::PVStructure::shared_pointer const & |
pvArgument, |
|
|
bool |
lastRequest = false |
|
) |
| |
Issue a channelRPC request and return immediately.
waitRequest must be called to complete the request.
- Parameters
-
pvAgument | The argument to pass to the server. |
lastRequest | If true an automatic destroy is made. |
- Exceptions
-
std::runtime_error | excption thrown on any runtime error condition (e.g. no connection made). |
◆ request()
epics::pvData::PVStructure::shared_pointer epics::pvAccess::RPCClient::request |
( |
epics::pvData::PVStructure::shared_pointer const & |
pvArgument, |
|
|
double |
timeout = 5.0 , |
|
|
bool |
lastRequest = false |
|
) |
| |
Sends a request and wait for the response or until timeout occurs.
This method will also wait for client to connect, if necessary.
- Parameters
-
pvArgument | the argument for the rpc |
timeout | the time in seconds to wait for the response, 0 means forever. |
lastRequest | If true an automatic destroy is made. |
- Returns
- request response.
- Exceptions
-
RPCRequestException | exception thrown on error or timeout. |
◆ waitConnect()
bool epics::pvAccess::RPCClient::waitConnect |
( |
double |
timeout = 5.0 | ) |
|
Wait for the connect request to complete.
- Parameters
-
timeout | timeout in seconds to wait, 0 means forever. |
- Returns
- (false,true) If (not connected, is connected). If false then connect must be reissued.
◆ waitResponse()
epics::pvData::PVStructure::shared_pointer epics::pvAccess::RPCClient::waitResponse |
( |
double |
timeout = 5.0 | ) |
|
Wait for the request to complete.
- Parameters
-
timeout | the time in seconds to wait for the reponse. |
- Returns
- request response.
- Exceptions
-
RPCRequestException | exception thrown on error or timeout. |
The documentation for this class was generated from the following file: