pvAccessCPP
7.1.7
|
RPCClient is an interface class that is used by a service client. More...
#include <rpcClient/pv/rpcClient.h>
Public Types | |
typedef std::tr1::shared_ptr < RPCClient > | shared_pointer |
typedef std::tr1::shared_ptr < const RPCClient > | const_shared_pointer |
typedef std::tr1::weak_ptr < RPCClient > | weak_pointer |
typedef std::tr1::weak_ptr < const RPCClient > | const_weak_pointer |
Public Member Functions | |
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 Public Member Functions | |
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.
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.
timeout | Timeout in seconds to wait, 0 means forever. |
|
static |
Create a RPCClient.
serviceName | the service name |
pvRequest | the pvRequest for the ChannelRPC |
void epics::pvAccess::RPCClient::destroy | ( | ) |
Destroy this instance (i.e.
release resources).
void epics::pvAccess::RPCClient::issueConnect | ( | ) |
Issue a connect request and return immediately.
waitConnect must be called to complete the request.
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.
pvAgument | The argument to pass to the server. |
lastRequest | If true an automatic destroy is made. |
std::runtime_error | excption thrown on any runtime error condition (e.g. no connection made). |
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.
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. |
RPCRequestException | exception thrown on error or timeout. |
bool epics::pvAccess::RPCClient::waitConnect | ( | double | timeout = 5.0 | ) |
Wait for the connect request to complete.
timeout | timeout in seconds to wait, 0 means forever. |
epics::pvData::PVStructure::shared_pointer epics::pvAccess::RPCClient::waitResponse | ( | double | timeout = 5.0 | ) |
Wait for the request to complete.
timeout | the time in seconds to wait for the reponse. |
RPCRequestException | exception thrown on error or timeout. |