pvAccessCPP  7.1.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | 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 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...
 

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

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

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