An easy to use alternative to RPC.
More...
#include "pvaClient.h"
An easy to use alternative to RPC.
Overview of PvaClientRPC
Definition at line 1736 of file pvaClient.h.
epics::pvaClient::PvaClientRPC::~PvaClientRPC |
( |
| ) |
|
Destructor.
Definition at line 112 of file pvaClientRPC.cpp.
115 string channelName(
"disconnected");
116 Channel::shared_pointer chan(channel.lock());
117 if(chan) channelName = chan->getChannelName();
118 cout<<
"PvaClientRPC::~PvaClientRPC" 119 <<
" channelName " << channelName
static bool getDebug()
Is debug set?
void epics::pvaClient::PvaClientRPC::connect |
( |
| ) |
|
Call issueConnect and then waitConnect.
An exception is thrown if connect fails.
Definition at line 216 of file pvaClientRPC.cpp.
221 if(status.
isOK())
return;
222 Channel::shared_pointer chan(channel.lock());
223 string channelName(
"disconnected");
224 if(chan) channelName = chan->getChannelName();
225 string message = string(
"channel ")
227 +
" PvaClientRPC::connect " epics::pvData::Status waitConnect()
Wait until the channelRPC connection to the channel is complete.
const std::string & getMessage() const
void issueConnect()
Issue the channelRPC connection to the channel.
static bool getDebug()
Is debug set?
Create a PvaClientRPC.
- Parameters
-
&pvaClient | Interface to PvaClient |
channel | Interface to Channel |
pvRequest | The request structure. |
- Returns
- The interface to the PvaClientRPC.
double epics::pvaClient::PvaClientRPC::getResponseTimeout |
( |
| ) |
|
|
inline |
Get the responseTimeout.
- Returns
- The value.
Definition at line 1775 of file pvaClient.h.
1777 return responseTimeout;
void epics::pvaClient::PvaClientRPC::issueConnect |
( |
| ) |
|
Issue the channelRPC connection to the channel.
This can only be called once. An exception is thrown if connect fails.
- Exceptions
-
Definition at line 232 of file pvaClientRPC.cpp.
235 Channel::shared_pointer chan(channel.lock());
236 if(connectState!=connectIdle) {
237 string channelName(
"disconnected");
238 if(chan) channelName = chan->getChannelName();
239 string message = string(
"channel ")
241 +
" pvaClientRPC already connected ";
242 throw std::runtime_error(message);
245 connectState = connectActive;
246 channelRPC = chan->createChannelRPC(rpcRequester,pvRequest);
249 throw std::runtime_error(
"PvaClientRPC::issueConnect() but channel disconnected");
static bool getDebug()
Is debug set?
epics::pvaClient::PvaClientRPC::POINTER_DEFINITIONS |
( |
PvaClientRPC |
| ) |
|
epics::pvData::PVStructure::shared_pointer epics::pvaClient::PvaClientRPC::request |
( |
epics::pvData::PVStructure::shared_pointer const & |
pvArgument | ) |
|
Issue a request and wait for response.
Note that if responseTimeout is ( lt 0.0, ge 0.0) then this (will, will not) block until response completes or timeout.
- Parameters
-
pvArgument | The data to send to the service. |
- Returns
- The result
- Exceptions
-
void epics::pvaClient::PvaClientRPC::request |
( |
epics::pvData::PVStructure::shared_pointer const & |
pvArgument, |
|
|
PvaClientRPCRequesterPtr const & |
pvaClientRPCRequester |
|
) |
| |
issue a request and return immediately.
- Parameters
-
pvArgument | The data to send to the service. |
pvaClientRPCRequester | The requester that is called with the result. |
- Exceptions
-
void epics::pvaClient::PvaClientRPC::setResponseTimeout |
( |
double |
responseTimeout | ) |
|
|
inline |
Set a timeout for a request.
- Parameters
-
responseTimeout | The time in seconds to wait for a request to complete. |
Definition at line 1767 of file pvaClient.h.
1769 this->responseTimeout = responseTimeout;
Status epics::pvaClient::PvaClientRPC::waitConnect |
( |
| ) |
|
Wait until the channelRPC connection to the channel is complete.
- Returns
- status;
Definition at line 252 of file pvaClientRPC.cpp.
255 if(connectState==connected) {
256 if(!connectStatus.
isOK()) connectState = connectIdle;
257 return connectStatus;
259 if(connectState!=connectActive) {
260 Channel::shared_pointer chan(channel.lock());
261 string channelName(
"disconnected");
262 if(chan) channelName = chan->getChannelName();
263 string message = string(
"channel ")
265 +
" PvaClientRPC::waitConnect illegal connect state ";
266 throw std::runtime_error(message);
269 cout <<
"PvaClientRPC::waitConnect calling waitForConnect.wait\n";
271 waitForConnect.
wait();
272 connectState = connectStatus.
isOK() ? connected : connectIdle;
274 cout <<
"PvaClientRPC::waitConnect" 275 <<
" connectStatus " << (connectStatus.
isOK() ?
"connected" :
"not connected");
277 return connectStatus;
static bool getDebug()
Is debug set?
The documentation for this class was generated from the following files: