124 lines
3.9 KiB
HTML
124 lines
3.9 KiB
HTML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
|
|
<title>PvaClientChannel</title>
|
|
<link rel="stylesheet" type="text/css"
|
|
href="http://epics-pvdata.sourceforge.net/base.css" />
|
|
<link rel="stylesheet" type="text/css"
|
|
href="http://epics-pvdata.sourceforge.net/epicsv4.css" />
|
|
<style type="text/css">
|
|
/*<![CDATA[*/
|
|
.about { margin-left: 3em; margin-right: 3em; font-size: .83em}
|
|
table { margin-left: auto; margin-right: auto }
|
|
.diagram { text-align: center; margin: 2.5em 0 }
|
|
span.opt { color: grey }
|
|
span.nterm { font-style:italic }
|
|
span.term { font-family:courier }
|
|
span.user { font-family:courier }
|
|
span.user:before { content:"<" }
|
|
span.user:after { content:">" }
|
|
.nonnorm { font-style:italic }
|
|
p.ed { color: #AA0000 }
|
|
span.ed { color: #AA0000 }
|
|
p.ed.priv { display: inline; }
|
|
span.ed.priv { display: inline; }
|
|
/*]]>*/</style>
|
|
<!-- Script that generates the Table of Contents -->
|
|
<script type="text/javascript"
|
|
src="http://epics-pvdata.sourceforge.net/script/tocgen.js">
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
<h1>PvaClientChannel</h1>
|
|
|
|
<h2>Overview</h2>
|
|
<p>
|
|
pvaClientChannel is a synchronous wrapper for the pvAccess::Channel API, which is a callback based API.
|
|
Thus it is easier to use than pvAccess::Channel itself.
|
|
</p>
|
|
<p>An instance of <b>PvaClientChannel</b> connects to a single channel.
|
|
An instance can only be created via class <b>PvaClient</b> which has both synchronous methods, which block, and non blocking methods.
|
|
The synchrouous methods block until a connection is made to the channel and throw an exception if a
|
|
timeout occurs while trying to make a connection.
|
|
The non blocking methods leave connection to the caller.
|
|
</p>
|
|
<p><b>PvaClientChannel</b> has methods:</p>
|
|
<dl>
|
|
<dt>Connect to channel</dt>
|
|
<dd>These can be called indirectly by a blocking request to <b>PvaClient</b>
|
|
or by the client if a non blocking request is made to <b>PvaClient</b>.
|
|
</dd>
|
|
<dt>Channel state change requester</dt>
|
|
<dd>The client can provide a callback that is called each time the connection state
|
|
of the channel changes.
|
|
</dd>
|
|
<dt>Creating all of the following</dt>
|
|
<dd>
|
|
<pre>
|
|
PvaClientField NOT IMPLEMENTED
|
|
PvaClientProcess
|
|
PvaClientGet
|
|
PvaClientPut
|
|
PvaClientPutGet
|
|
PvaClientMonitor
|
|
PvaClientArray NOT IMPLEMENTED
|
|
PvaClientRPC
|
|
</pre>
|
|
</dd>
|
|
</dl>
|
|
<h2>Connect: Blocking vs Non-Blocking </h2>
|
|
<p><b>PvaClientChannel</b> has methods:</p>
|
|
<dl>
|
|
<dt>connect</dt>
|
|
<dd>
|
|
This calls issueConnect and then waitConnect.
|
|
If waitConnect fails an exception is thrown.
|
|
Since waitConnect is a blocking method so is this.
|
|
</dd>
|
|
<dt>issueConnect</dt>
|
|
<dd>
|
|
This is a request to connect to the channel. This is a non blocking call.
|
|
</dd>
|
|
<dt>waitConnect</dt>
|
|
<dd>
|
|
This waits for the server to respond to issueConnect.
|
|
It blocks until the server responds or a timeout occurs.
|
|
</dd>
|
|
</dl>
|
|
|
|
<h2>Get and Put Caching</h2>
|
|
<p>
|
|
<b>PvaClientChannel</b> has methods:
|
|
</p>
|
|
<pre>
|
|
PvaClientGetPtr get(std::string const & request);
|
|
PvaClientPutPtr put(std::string const & request);
|
|
</pre>
|
|
<p>
|
|
Each of these caches.
|
|
For example all calls to <b>get</b> with the same <b>request</b> will share the same
|
|
<b>PvaChannelGet</b>
|
|
</p>
|
|
<p>
|
|
For example consider a client that makes multiple calls like:
|
|
</p>
|
|
<pre>
|
|
double value;
|
|
value = pva->channel(channelName)->get()->getData()->getDouble();
|
|
...
|
|
value = pva->channel(channelName)->get()->getData()->getDouble();
|
|
</pre>
|
|
<p>
|
|
Only the first call creates a new PvaClientChannel and a new PvaClientGet.
|
|
The second call reuses the cached PvaClientChannel and PvaClientGet.
|
|
</p>
|
|
|
|
|
|
</body>
|
|
</html>
|
|
|