pvAccessCPP  7.1.2
Public Member Functions | Static Public Member Functions | List of all members
epics::pvAccess::RPCClient Class Reference

RPCClient is an interface class that is used by a service client. More...

#include <rpcClient/pv/rpcClient.h>

Public Member Functions

 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 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...
 

Detailed Description

RPCClient is an interface class that is used by a service client.

Definition at line 39 of file rpcClient.h.

Member Function Documentation

◆ 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
timeoutTimeout 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

Create a RPCClient.

Parameters
serviceNamethe service name
pvRequestthe pvRequest for the ChannelRPC
Returns
the RPCClient interface

◆ 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
pvAgumentThe argument to pass to the server.
lastRequestIf true an automatic destroy is made.
Exceptions
std::runtime_errorexcption 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
pvArgumentthe argument for the rpc
timeoutthe time in seconds to wait for the response, 0 means forever.
lastRequestIf true an automatic destroy is made.
Returns
request response.
Exceptions
RPCRequestExceptionexception thrown on error or timeout.

◆ waitConnect()

bool epics::pvAccess::RPCClient::waitConnect ( double  timeout = 5.0)

Wait for the connect request to complete.

Parameters
timeouttimeout 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
timeoutthe time in seconds to wait for the reponse.
Returns
request response.
Exceptions
RPCRequestExceptionexception thrown on error or timeout.

The documentation for this class was generated from the following file: