From 87d5ca03f7dcc4b59024d29b96eba856d7138a50 Mon Sep 17 00:00:00 2001
From: Marty Kraimer EPICS pvaClientCPP
EPICS V4 Working Group, Working Draft,
-29-May-2015
+26-June-2015
The examples and tests require that an example pvAccess server is runnimg. -This distribution has a file exampleDatabasePvaClient.zip. +
The examples require that an example pvAccess server is runnimg. +To get the test database go to:
+pvaClientTestCPP/database.zip + +Then select "raw file" and You will be able to download the zip file. +When unzipped this is used to create an example IOC database.
After unzipping the file:
-cd configure +cd database/configure cp ExampleRELEASE.local RELEASE.local edit RELEASE.local cd .. @@ -126,19 +132,13 @@ make cd iocBoot/exampleDatabase ../../bin/<arch:>/exampleDatabase st.cmd-
The tests will fail unless the example database is running.
-Once it is running:
--make runtests -
Examples are in directory pvaExample/src. +
Examples are in directory example/src. An example of how to run them is:
mrk> pwd -/home/epicsv4/pvAccessCPP/pvaExample -mrk> bin/linux-x86_64/examplepvaClientGet +/home/epicsv4/pvaClientCPP/example +mrk> bin/linux-x86_64/examplePvaClientGet
The following is a brief description of each example. In order to understand each example it diff --git a/documentation/pvaClientCPP_20150626.html b/documentation/pvaClientCPP_20150626.html new file mode 100644 index 0000000..529daec --- /dev/null +++ b/documentation/pvaClientCPP_20150626.html @@ -0,0 +1,199 @@ + + + +
+ +pvaClient is a software library that provides to an EPICS client programmer, a friendly +client side programming interface to the data of an EPICS based control system. It is intended +for such uses as rapid development of ad hoc programs by controls engineers, or to provide +scientists a way to directly develop analytical applications.
+ +Specifically, pvaClient provides a synchronous interface for pvAccess, which is the +software support for high speed controls network communications used in EPICS version 4. +pvAccess provides a callback based interface, which can be hard to use. +pvaClient provides an interface that does not require callbacks even for monitors. +
+pvaClientChannel provides many "convenience" methods to directly get and put +scalar and scalarArray data types. +Additional methods provide access to the full features of pvAccess. + ++pvaClientMultiChannel provides access to data from multiple channels. +It can be used directly by a client or via pvaClientMultiDouble or pvaClientNTMultiChannel. +pvaClientMultiDouble allows the client to get and put data to multiple channels. +But each channel must have a value field that is a numeric scalar. +pvaClientNTMultiChannel allows the client to get and put data to multiple channels. +Each channel must have a value field. +The data for the channels is presented via normative type NTMultiChannel. +
+ +For more information about EPICS generally, please refer to the home page of the Experimental Physics and Industrial + Control System.
+ + + +pvaClientCPP is ready for use.
+ +pvaClient is a synchronous API for accessing PVData via PVAccess. It provides +an interface to many of the features provided by pvData and pvAccess.
+ +This document describes the layout of the source files in this project.
++A user overview is available via +pvaClientOverview.html + +
++Doxygen documentation is available at +doxygenDoc + +
+The examples require that an example pvAccess server is runnimg. +To get the test database go to:
+pvaClientTestCPP/database.zip + +Then select "raw file" and You will be able to download the zip file. ++When unzipped this is used to create an example IOC database. +
++After unzipping the file: +
++cd database/configure +cp ExampleRELEASE.local RELEASE.local +edit RELEASE.local +cd .. +make +cd iocBoot/exampleDatabase +../../bin/<arch:>/exampleDatabase st.cmd ++
Examples are in directory example/src. +An example of how to run them is:
++mrk> pwd +/home/epicsv4/pvaClientCPP/example +mrk> bin/linux-x86_64/examplePvaClientGet ++
The following is a brief description of each example. +In order to understand each example it +helps to also look at the source for the example.
+This has a number of examples:
+This is an example of creating a monitor on a channel. +It monitors a channel that models a powerSupply, i. e. it is not a "standard" record. +It does not have a value field. +
+After starting the example a change can be made to the powerSupply by issuing:
++pvput -r "power.value,voltage.value" examplePowerSupply 6 6 ++
This example gets and puts to channel exampleDouble.
+This example makes a process request to channel exampleDouble.
+This is an example of issuing a channelPutGet.
+This is an example of issuing gets and puts to multiple channels where each +channel has a numeric scalar value field.
+This is an example of using NDMultiChannel to obtain data from multiple channels. +
+This is an example of issuing a channelRPC request. +It does not use pva.
+pvaExample includes a number of examples.
-pva does not provide support for:
+pvClientCPP/example includes a number of examples.
+pvaClient does not provide support for:
PvaClient has methods to create instances of PvaClientChannel. The client can specify the provider name or use the default provider. -The client can manage it's own channels or can let pva cache channels. +The client can manage it's own channels or can let pvaClient cache channels. An example of using the cached method is:
PvaClientChannelPtr pvaChannel = pva->channel("exampleDouble");
diff --git a/exampleDatabasePva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hOE!NFfmJ
za-{GU&GPFQ*i|@P?)!;(O)C}N8-1ZvEOs=uZ=NR0Y8!c4dA~)*Y!3T;Pw7iM87M!OS=K|
zoBsQ`?idCFhyQ=`q(GPYpB@Mx$Y1z0*E=At68Q1YAlG!kZ^6D(^z#R`=&q^l0?I#9
z^b^6rv8RDlX*M9w_5jY9P)#R
z>y_@SH+B9;jB9o8+eGd=+^y
z)uQ%oDBuwRQ{SJB{@
z|Acl;t}aVrf1vDo5$7saCCi_%fGqi=r1NLeE)~`F;>lIGf=7P=_pO`bf4R;}%&{|JH5!p+T=_
iGp}N^J-HS8+8y5r1PRRLfPl~ee;EPsptq^?v{o3w#s+
diff --git a/src/pvaClient.cpp b/src/pvaClient.cpp
index c88533c..ebee3d4 100644
--- a/src/pvaClient.cpp
+++ b/src/pvaClient.cpp
@@ -78,32 +78,67 @@ public:
void destroy() {
pvaClientChannelMap.clear();
}
- PvaClientChannelPtr getChannel(string const & channelName);
+ PvaClientChannelPtr getChannel(
+ string const & channelName,
+ string const & providerName);
void addChannel(PvaClientChannelPtr const & pvaClientChannel);
- void removeChannel(string const & channelName);
+ void removeChannel(string const & channelName,string const & providerName);
+ void showCache();
+ size_t cacheSize();
private:
map pvaClientChannelMap;
};
-PvaClientChannelPtr PvaClientChannelCache::getChannel(string const & channelName)
+PvaClientChannelPtr PvaClientChannelCache::getChannel(
+ string const & channelName,
+ string const & providerName)
{
- map::iterator iter = pvaClientChannelMap.find(channelName);
+ string name = channelName + providerName;
+ map::iterator iter = pvaClientChannelMap.find(name);
if(iter!=pvaClientChannelMap.end()) return iter->second;
return PvaClientChannelPtr();
}
void PvaClientChannelCache::addChannel(PvaClientChannelPtr const & pvaClientChannel)
{
+ Channel::shared_pointer channel = pvaClientChannel->getChannel();
+ string name = channel->getChannelName()
+ + channel->getProvider()->getProviderName();
pvaClientChannelMap.insert(std::pair(
- pvaClientChannel->getChannelName(),pvaClientChannel));
+ name,pvaClientChannel));
}
-void PvaClientChannelCache::removeChannel(string const & channelName)
+void PvaClientChannelCache::removeChannel(
+ string const & channelName,
+ string const & providerName)
{
- map::iterator iter = pvaClientChannelMap.find(channelName);
+ string name = channelName + providerName;
+ map::iterator iter = pvaClientChannelMap.find(name);
if(iter!=pvaClientChannelMap.end()) pvaClientChannelMap.erase(iter);
}
+void PvaClientChannelCache::showCache()
+{
+ map::iterator iter;
+ for(iter = pvaClientChannelMap.begin(); iter != pvaClientChannelMap.end(); ++iter)
+ {
+ PvaClientChannelPtr pvaChannel = iter->second;
+ Channel::shared_pointer channel = pvaChannel->getChannel();
+ string channelName = channel->getChannelName();
+ string providerName = channel->getProvider()->getProviderName();
+ cout << "channel " << channelName << " provider " << providerName << endl;
+ cout << " get and put cacheSize " << pvaChannel->cacheSize() << endl;
+ pvaChannel->showCache();
+ }
+
+}
+
+size_t PvaClientChannelCache::cacheSize()
+{
+ return pvaClientChannelMap.size();
+
+}
+
using namespace epics::pvaClient::pvaClientPvt;
PvaClientPtr PvaClient::create()
@@ -149,6 +184,10 @@ void PvaClient::destroy()
string PvaClient:: getRequesterName()
{
static string name("pvaClient");
+ RequesterPtr req = requester.lock();
+ if(req) {
+ return req->getRequesterName();
+ }
return name;
}
@@ -156,6 +195,11 @@ void PvaClient::message(
string const & message,
MessageType messageType)
{
+ RequesterPtr req = requester.lock();
+ if(req) {
+ req->message(message,messageType);
+ return;
+ }
cout << getMessageTypeName(messageType) << " " << message << endl;
}
@@ -164,7 +208,8 @@ PvaClientChannelPtr PvaClient::channel(
std::string const & providerName,
double timeOut)
{
- PvaClientChannelPtr pvaClientChannel = pvaClientChannelCache->getChannel(channelName);
+ PvaClientChannelPtr pvaClientChannel =
+ pvaClientChannelCache->getChannel(channelName,providerName);
if(pvaClientChannel) return pvaClientChannel;
pvaClientChannel = createChannel(channelName,providerName);
pvaClientChannel->connect(timeOut);
@@ -172,16 +217,32 @@ PvaClientChannelPtr PvaClient::channel(
return pvaClientChannel;
}
-PvaClientChannelPtr PvaClient::createChannel(string const & channelName)
-{
- return PvaClientChannel::create(getPtrSelf(),channelName);
-}
-
PvaClientChannelPtr PvaClient::createChannel(string const & channelName, string const & providerName)
{
return PvaClientChannel::create(getPtrSelf(),channelName,providerName);
}
+void PvaClient::setRequester(RequesterPtr const & requester)
+{
+ this->requester = requester;
+}
+
+void PvaClient::clearRequester()
+{
+ requester = Requester::weak_pointer();
+}
+
+void PvaClient::showCache()
+{
+ pvaClientChannelCache->showCache();
+}
+
+
+size_t PvaClient::cacheSize()
+{
+ return pvaClientChannelCache->cacheSize();
+}
+
PvaClientMultiChannelPtr PvaClient::createMultiChannel(
epics::pvData::PVStringArrayPtr const & channelNames)
{
diff --git a/src/pvaClient.h b/src/pvaClient.h
index b79db45..620acaf 100644
--- a/src/pvaClient.h
+++ b/src/pvaClient.h
@@ -101,17 +101,15 @@ public:
* Destructor
*/
~PvaClient();
- /**
- * @brief Create an instance of PvaClient
+ /** Create an instance of PvaClient
* @return shared_ptr to new instance.
*/
static PvaClientPtr create();
- /** @brief get the requester name.
+ /** Get the requester name.
* @return The name.
*/
std::string getRequesterName();
- /**
- * @brief A new message.
+ /** A new message.
* If a requester is set then it is called otherwise message is displayed
* on standard out.
* @param message The message.
@@ -120,12 +118,11 @@ public:
void message(
std::string const & message,
epics::pvData::MessageType messageType);
- /**
- * @brief Destroy all the channels and multiChannels.
+ /** Destroy all the channels and multiChannels.
*/
void destroy();
- /**
- * @brief get a cached channel or create and connect to a new channel.
+ /** Get a cached channel or create and connect to a new channel.
+ *
* The provider is pvaClient. The timeout is 5 seconds.
* If connection can not be made an exception is thrown.
* @param channelName The channelName.
@@ -133,8 +130,7 @@ public:
*/
PvaClientChannelPtr channel(std::string const & channelName)
{ return channel(channelName,"pva", 5.0); }
- /**
- * @brief get a cached channel or create and connect to a new channel.
+ /** Get a cached channel or create and connect to a new channel.
* If connection can not be made an exception is thrown.
* @param channelName The channelName.
* @return The interface.
@@ -143,14 +139,13 @@ public:
std::string const & channelName,
std::string const &providerName,
double timeOut);
- /**
- * @brief Create an PvaClientChannel. The provider is pvaClient.
+ /** Create an PvaClientChannel. The provider is pvaClient.
* @param channelName The channelName.
* @return The interface.
*/
- PvaClientChannelPtr createChannel(std::string const & channelName);
- /**
- * @brief Create an PvaClientChannel with the specified provider.
+ PvaClientChannelPtr createChannel(std::string const & channelName)
+ { return createChannel(channelName,"pva");}
+ /** Create an PvaClientChannel with the specified provider.
* @param channelName The channelName.
* @param providerName The provider.
* @return The interface or null if the provider does not exist.
@@ -158,15 +153,28 @@ public:
PvaClientChannelPtr createChannel(
std::string const & channelName,
std::string const & providerName);
- /**
- * @brief Create an PvaClientMultiChannel. The provider is pvAccess.
+
+ /** Set a requester.
+ * The default is for PvaClient to handle messages by printing to System.out.
+ * @param requester The requester.
+ */
+ void setRequester(epics::pvData::RequesterPtr const & requester);
+ /** Clear the requester. PvaClient will handle messages.
+ */
+ void clearRequester();
+ /** Show the list of cached channels.
+ */
+ void showCache();
+ /** Get the number of cached channels.
+ */
+ size_t cacheSize();
+ /** Create an PvaClientMultiChannel. The provider is pvAccess.
* @param channelName The channelName array.
* @return The interface.
*/
PvaClientMultiChannelPtr createMultiChannel(
epics::pvData::PVStringArrayPtr const & channelNames);
- /**
- * @brief Create an PvaClientMultiChannel with the specified provider.
+ /** Create an PvaClientMultiChannel with the specified provider.
* @param channelName The channelName array.
* @param providerName The provider.
* @return The interface.
@@ -174,18 +182,7 @@ public:
PvaClientMultiChannelPtr createMultiChannel(
epics::pvData::PVStringArrayPtr const & channelNames,
std::string const & providerName);
- /**
- * @brief Set a requester.
- * The default is for PvaClient to handle messages by printing to System.out.
- * @param requester The requester.
- */
- void setRequester(epics::pvData::RequesterPtr const & requester);
- /**
- * @brief Clear the requester. PvaClient will handle messages.
- */
- void clearRequester();
- /**
- * @brief get shared pointer to this
+ /** Get shared pointer to this
*/
PvaClientPtr getPtrSelf()
{
@@ -209,8 +206,7 @@ typedef std::tr1::shared_ptr PvaClientGetCachePtr;
class PvaClientPutCache;
typedef std::tr1::shared_ptr PvaClientPutCachePtr;
class ChannelRequesterImpl;
-/**
- * @brief An easy to use alternative to directly calling the Channel methods of pvAccess.
+/** An easy to use alternative to directly calling the Channel methods of pvAccess.
*
* @author mrk
*/
@@ -219,18 +215,7 @@ class epicsShareClass PvaClientChannel :
{
public:
POINTER_DEFINITIONS(PvaClientChannel);
- /**
- * @brief Create a PvaClientChannel.
- * @param pvaClient Interface to PvaClient
- * @param channelName The name of the channel.
- * @return The interface.
- */
- static PvaClientChannelPtr create(
- PvaClientPtr const &pvaClient,
- std::string const & channelName)
- {return create(pvaClient,channelName,"pva");}
- /**
- * @brief Create a PvaClientChannel.
+ /** Create a PvaClientChannel.
* @param channelName The name of the channel.
* @param providerName The name of the provider.
* @return The interface to the PvaClientStructure.
@@ -240,144 +225,119 @@ public:
std::string const & channelName,
std::string const & providerName);
~PvaClientChannel();
- /**
- * @brief Destroy the pvAccess connection.
+ /** Destroy the pvAccess connection.
*/
void destroy();
- /**
- * @brief Get the name of the channel to which PvaClientChannel is connected.
+ /** Get the name of the channel to which PvaClientChannel is connected.
* @return The channel name.
*/
std::string getChannelName();
- /**
- * @brief Get the the channel to which PvaClientChannel is connected.
+ /** Get the the channel to which PvaClientChannel is connected.
* @return The channel interface.
*/
epics::pvAccess::Channel::shared_pointer getChannel();
- /**
- * @brief Connect to the channel.
+ /** Connect to the channel.
* This calls issueConnect and waitConnect.
* An exception is thrown if connect fails.
* @param timeout The time to wait for connecting to the channel.
*/
void connect(double timeout=5.0);
- /**
- * @brief Issue a connect request and return immediately.
+ /** Issue a connect request and return immediately.
*/
void issueConnect();
- /**
- * @brief Wait until the connection completes or for timeout.
+ /** Wait until the connection completes or for timeout.
* @param timeout The time in second to wait.
* @return status.
*/
epics::pvData::Status waitConnect(double timeout);
- /**
- * @brief Calls the next method with subField = "";
+ /** Calls the next method with subField = "";
* @return The interface.
*/
PvaClientFieldPtr createField();
- /**
- * @brief Create an PvaClientField for the specified subField.
+ /** Create an PvaClientField for the specified subField.
* @param subField The syntax for subField is defined in package org.epics.pvdata.copy
* @return The interface.
*/
PvaClientFieldPtr createField(std::string const & subField);
- /**
- * @brief Calls the next method with request = "";
+ /** Calls the next method with request = "";
* @return The interface.
*/
PvaClientProcessPtr createProcess();
- /**
- * @brief First call createRequest as implemented by pvDataJava and then calls the next method.
+ /** First call createRequest as implemented by pvDataJava and then calls the next method.
* @param request The request as described in package org.epics.pvdata.copy
* @return The interface.
*/
PvaClientProcessPtr createProcess(std::string const & request);
- /**
- * @brief Creates an PvaClientProcess.
+ /** Creates an PvaClientProcess.
* @param pvRequest The syntax of pvRequest is described in package org.epics.pvdata.copy.
* @return The interface.
*/
PvaClientProcessPtr createProcess(epics::pvData::PVStructurePtr const & pvRequest);
- /**
- * @brief Call the next method with request = "field(value,alarm,timeStamp)"
+ /** Call the next method with request = "field(value,alarm,timeStamp)"
* @return The interface.
*/
PvaClientGetPtr get();
- /**
- * @brief get a cached PvaClientGet or create and connect to a new PvaClientGet.
+ /** Get a cached PvaClientGet or create and connect to a new PvaClientGet.
* Then call it's get method.
* If connection can not be made an exception is thrown.
* @param request The request as described in package org.epics.pvdata.copy
* @return The interface.
*/
PvaClientGetPtr get(std::string const & request);
- /**
- * @brief Call the next method with request = "field(value,alarm,timeStamp)"
+ /** Call the next method with request = "field(value,alarm,timeStamp)"
* @return The interface.
*/
PvaClientGetPtr createGet();
- /**
- * @brief First call createRequest as implemented by pvDataJava and then call the next method.
+ /** First call createRequest as implemented by pvDataJava and then call the next method.
* @param request The request as described in package org.epics.pvdata.copy
* @return The interface.
*/
PvaClientGetPtr createGet(std::string const & request);
- /**
- * @brief Creates an PvaClientGet.
+ /** Creates an PvaClientGet.
* @param pvRequest The syntax of pvRequest is described in package org.epics.pvdata.copy.
* @return The interface.
*/
PvaClientGetPtr createGet(epics::pvData::PVStructurePtr const & pvRequest);
- /**
- * @brief Call the next method with request = "field(value)"
+ /** Call the next method with request = "field(value)"
* @return The interface.
*/
PvaClientPutPtr put();
- /**
- * @brief get a cached PvaClientPut or create and connect to a new PvaClientPut.
+ /** get a cached PvaClientPut or create and connect to a new PvaClientPut.
* Then call it's get method.
* If connection can not be made an exception is thrown.
* @param request The request as described in package org.epics.pvdata.copy
* @return The interface.
*/
PvaClientPutPtr put(std::string const & request);
- /**
- * @brief Call the next method with request = "field(value)"
+ /** Call the next method with request = "field(value)"
* @return The interface.
*/
PvaClientPutPtr createPut();
- /**
- * @brief First call createRequest as implemented by pvDataJava and then calls the next method.
+ /** First call createRequest as implemented by pvDataJava and then calls the next method.
* @param request The request as described in package org.epics.pvdata.copy
* @return The interface.
*/
PvaClientPutPtr createPut(std::string const & request);
- /**
- * @brief Create an PvaClientPut.
+ /** Create an PvaClientPut.
* @param pvRequest The syntax of pvRequest is described in package org.epics.pvdata.copy.
* @return The interface.
*/
PvaClientPutPtr createPut(epics::pvData::PVStructurePtr const & pvRequest);
- /**
- * @brief Call the next method with request = "record[process=true]putField(argument)getField(result)".
+ /** Call the next method with request = "record[process=true]putField(argument)getField(result)".
* @return The interface.
*/
PvaClientPutGetPtr createPutGet();
- /**
- * @brief First call createRequest as implemented by pvDataJava and then calls the next method.
+ /** First call createRequest as implemented by pvDataJava and then calls the next method.
* @param request The request as described in package org.epics.pvdata.copy
* @return The interface.
*/
PvaClientPutGetPtr createPutGet(std::string const & request);
- /**
- * @brief Create an PvaClientPutGet.
+ /** Create an PvaClientPutGet.
* @param pvRequest The syntax of pvRequest is described in package org.epics.pvdata.copy.
* @return The interface.
*/
PvaClientPutGetPtr createPutGet(epics::pvData::PVStructurePtr const & pvRequest);
- /**
- * @brief Call createRPC(PVStructure(null))
+ /** Call createRPC(PVStructure(null))
* @return The interface.
*/
PvaClientRPCPtr createRPC();
@@ -387,51 +347,43 @@ public:
* @return The interface.
*/
PvaClientRPCPtr createRPC(std::string const & request);
- /**
- * @brief Create an PvaClientRPC.
+ /** Create an PvaClientRPC.
* @param pvRequest The syntax of pvRequest is described in package org.epics.pvdata.copy.
* @return The interface.
*/
PvaClientRPCPtr createRPC(epics::pvData::PVStructurePtr const & pvRequest);
- /**
- * @brief Call the next method with request = "field(value)";
+ /** Call the next method with request = "field(value)";
* @return The interface.
*/
PvaClientArrayPtr createArray();
- /**
- * @brief First call createRequest as implemented by pvDataJava and then calls the next method.
+ /** First call createRequest as implemented by pvDataJava and then call the next method.
* @param request The request as described in package org.epics.pvdata.copy
* @return The interface.
*/
PvaClientArrayPtr createArray(std::string const & request);
- /**
- * @brief Create an PvaClientArray.
+ /** Create an PvaClientArray.
* @param pvRequest The syntax of pvRequest is described in package org.epics.pvdata.copy.
* @return The interface.
*/
PvaClientArrayPtr createArray(epics::pvData::PVStructurePtr const & pvRequest);
- /**
- * @brief Call the next method with request = "field(value,alarm,timeStamp)"
+ /** Call the next method with request = "field(value,alarm,timeStamp)"
* @return The interface.
*/
PvaClientMonitorPtr monitor();
- /**
- * @brief get a cached PvaClientMonitor or create and connect to a new PvaClientMonitor.
+ /** Get a cached PvaClientMonitor or create and connect to a new PvaClientMonitor.
* Then call it's start method.
* If connection can not be made an exception is thrown.
* @param request The request as described in package org.epics.pvdata.copy
* @return The interface.
*/
PvaClientMonitorPtr monitor(std::string const & request);
- /**
- * @brief Call the next method with request = "field(value,alarm,timeStamp)"
+ /** Call the next method with request = "field(value,alarm,timeStamp)"
* @param pvaClientMonitorRequester The client callback.
* @return The interface.
*/
PvaClientMonitorPtr monitor(PvaClientMonitorRequesterPtr const & pvaClientMonitorRequester);
- /**
- * @brief get a cached PvaClientMonitor or create and connect to a new PvaClientMonitor.
+ /** get a cached PvaClientMonitor or create and connect to a new PvaClientMonitor.
* Then call it's start method.
* If connection can not be made an exception is thrown.
* @param request The request as described in package org.epics.pvdata.copy
@@ -441,8 +393,7 @@ public:
PvaClientMonitorPtr monitor(
std::string const & request,
PvaClientMonitorRequesterPtr const & pvaClientMonitorRequester);
- /**
- * @brief Call the next method with request = "field(value.alarm,timeStamp)"
+ /** Call the next method with request = "field(value.alarm,timeStamp)"
* @return The interface.
*/
PvaClientMonitorPtr createMonitor();
@@ -452,12 +403,17 @@ public:
* @return The interface.
*/
PvaClientMonitorPtr createMonitor(std::string const & request);
- /**
- * @brief Create an PvaClientMonitor.
+ /** Create an PvaClientMonitor.
* @param pvRequest The syntax of pvRequest is described in package org.epics.pvdata.copy.
* @return The interface.
*/
PvaClientMonitorPtr createMonitor(epics::pvData::PVStructurePtr const & pvRequest);
+ /** Show the list of cached gets and puts.
+ */
+ void showCache();
+ /** Get the number of cached gets and puts.
+ */
+ size_t cacheSize();
PvaClientChannelPtr getPtrSelf()
{
return shared_from_this();
@@ -497,67 +453,58 @@ private:
friend class ChannelRequesterImpl;
};
-/**
- * @brief This is a class that holds data returned by PvaClientGet or PvaClientPutGet
+/** This is a class that holds data returned by PvaClientGet or PvaClientPutGet
*
*/
class epicsShareClass PvaClientGetData
{
public:
POINTER_DEFINITIONS(PvaClientGetData);
- /**
- * @brief Factory method for creating an instance of PvaClientGetData.
+ /** Factory method for creating an instance of PvaClientGetData.
*/
static PvaClientGetDataPtr create(epics::pvData::StructureConstPtr const & structure);
~PvaClientGetData() {}
- /**
- * @brief Set a prefix for throw messages.
+ /** Set a prefix for throw messages.
* @param value The prefix.
*/
void setMessagePrefix(std::string const & value);
- /** @brief Get the structure.
- * @return the structure.
+ /** Get the structure.
*/
epics::pvData::StructureConstPtr getStructure();
- /** @brief Get the pvStructure.
+ /** Get the pvStructure.
* @return the pvStructure.
*/
epics::pvData::PVStructurePtr getPVStructure();
- /** @brief Get the BitSet for the pvStructure
+ /** Get the BitSet for the pvStructure
* This shows which fields have changed value.
* @return The bitSet
*/
epics::pvData::BitSetPtr getBitSet();
- /** @brief show the fields that have changed.
+ /** Show the fields that have changed.
* @param out The stream that shows the changed fields.
* @return The stream that was input
*/
std::ostream & showChanged(std::ostream & out);
- /**
- * @brief New data is present.
+ /** New data is present.
* @param pvStructureFrom The new data.
* @param bitSetFrom the bitSet showing which values have changed.
*/
void setData(
epics::pvData::PVStructurePtr const & pvStructureFrom,
epics::pvData::BitSetPtr const & bitSetFrom);
- /**
- * @brief Is there a top level field named value.
+ /** Is there a top level field named value.
* @return The answer.
*/
bool hasValue();
- /**
- * @brief Is the value field a scalar?
+ /** Is the value field a scalar?
* @return The answer.
*/
bool isValueScalar();
- /**
- * @brief Is the value field a scalar array?
+ /** Is the value field a scalar array?
* @return The answer.
*/
bool isValueScalarArray();
- /**
- * @brief Return the interface to the value field.
+ /** Get the interface to the value field.
* @return The interface. an excetion is thrown if a value field does not exist.
*/
epics::pvData::PVFieldPtr getValue();
@@ -567,51 +514,43 @@ public:
* An exception is thown if no scalar value field.
*/
epics::pvData::PVScalarPtr getScalarValue();
- /**
- * @brief Return the interface to an array value field.
+ /** Getthe interface to an array value field.
* @return The interface.
* An exception is thown if no array value field.
*/
std::tr1::shared_ptr getArrayValue();
- /**
- * @brief Return the interface to a scalar array value field.
+ /** Get the interface to a scalar array value field.
* @return Return the interface.
* An exception is thown if no scalar array value field.
*/
std::tr1::shared_ptr getScalarArrayValue();
- /**
- * @brief Get the value as a double.
+ /** Get the value as a double.
* If value is not a numeric scalar an exception is thrown.
* @return The value.
*/
double getDouble();
- /**
- * @brief Get the value as a string.
+ /** Get the value as a string.
* If value is not a scalar an exception is thrown
* @return The value.
*/
std::string getString();
- /**
- * @brief Get the value as a double array.
+ /** Get the value as a double array.
* If the value is not a numeric array an exception is thrown.
* @return The value.
*/
epics::pvData::shared_vector getDoubleArray();
- /**
- * @brief Get the value as a string array.
+ /** Get the value as a string array.
* If the value is not a string array an exception is thrown.
* @return The value.
*/
epics::pvData::shared_vector getStringArray();
- /**
- * @brief Get the alarm.
+ /** Get the alarm.
* If the pvStructure as an alarm field it's values are returned.
- * If no then alarm shows that not alarm defined.
+ * If no then alarm shows that no alarm defined.
* @return The alarm.
*/
epics::pvData::Alarm getAlarm();
- /**
- * @brief Get the timeStamp.
+ /** Get the timeStamp.
* If the pvStructure as a timeStamp field, it's values are returned.
* If no then all fields are 0.
* @return The timeStamp.
@@ -631,129 +570,111 @@ private:
};
class PvaClientPostHandlerPvt; // private to PvaClientPutData
-/**
- * @brief This is a class that holds data given to by PvaClientPut or PvaClientPutGet
+/** This is a class that holds data given to by PvaClientPut or PvaClientPutGet
*
*/
class epicsShareClass PvaClientPutData
{
public:
POINTER_DEFINITIONS(PvaClientPutData);
- /**
- * @brief Factory method for creating an instance of PvaClientPutData.
+ /** Factory method for creating an instance of PvaClientPutData.
*/
static PvaClientPutDataPtr create(epics::pvData::StructureConstPtr const & structure);
~PvaClientPutData() {}
- /**
- * @brief Set a prefix for throw messages.
+ /** Set a prefix for throw messages.
* @param value The prefix.
*/
void setMessagePrefix(std::string const & value);
- /** @brief Get the structure.
+ /** Get the structure.
* @return the structure.
*/
epics::pvData::StructureConstPtr getStructure();
- /** @brief Get the pvStructure.
+ /** Get the pvStructure.
* @return the pvStructure.
*/
epics::pvData::PVStructurePtr getPVStructure();
- /** @brief Get the BitSet for the pvStructure
+ /** Get the BitSet for the pvStructure
* This shows which fields have changed value.
* @return The bitSet
*/
epics::pvData::BitSetPtr getBitSet();
- /** @brief show the fields that have changed.
+ /** Show the fields that have changed.
* @param out The stream that shows the changed fields.
* @return The stream that was input
*/
std::ostream & showChanged(std::ostream & out);
/**
- * @brief Is there a top level field named value.
+ * Is there a top level field named value.
* @return The answer.
*/
bool hasValue();
- /**
- * @brief Is the value field a scalar?
+ /** Is the value field a scalar?
* @return The answer.
*/
bool isValueScalar();
- /**
- * @brief Is the value field a scalar array?
+ /** Is the value field a scalar array?
* @return The answer.
*/
bool isValueScalarArray();
- /**
- * @brief Return the interface to the value field.
+ /** Get the interface to the value field.
* @return The interface. an excetion is thrown if a value field does not exist.
*/
epics::pvData::PVFieldPtr getValue();
- /**
- * @brief Return the interface to a scalar value field.
+ /** Get the interface to a scalar value field.
* @return The interface for a scalar value field.
* An exception is thown if no scalar value field.
*/
epics::pvData::PVScalarPtr getScalarValue();
- /**
- * @brief Return the interface to an array value field.
+ /** Get the interface to an array value field.
* @return The interface.
* An exception is thown if no array value field.
*/
std::tr1::shared_ptr getArrayValue();
- /**
- * @brief Return the interface to a scalar array value field.
+ /** Get the interface to a scalar array value field.
* @return Return the interface.
* An exception is thown if no scalar array value field.
*/
std::tr1::shared_ptr getScalarArrayValue();
- /**
- * @brief Get the value as a double.
+ /** Get the value as a double.
* If value is not a numeric scalar an exception is thrown.
* @return The value.
*/
double getDouble();
- /**
- * @brief Get the value as a string.
+ /** Get the value as a string.
* If value is not a string an exception is thrown
* @return The value.
*/
std::string getString();
- /**
- * @brief Get the value as a double array.
+ /** Get the value as a double array.
* If the value is not a numeric array an exception is thrown.
* @return The value.
*/
epics::pvData::shared_vector getDoubleArray();
- /**
- * @brief Get the value as a string array.
+ /** Get the value as a string array.
* If the value is not a string array an exception is thrown.
* @return The value.
*/
epics::pvData::shared_vector getStringArray();
- /**
- * Put the value as a double.
+ /** Put the value as a double.
* An exception is also thrown if the actualy type can cause an overflow.
* If value is not a numeric scalar an exception is thrown.
*/
void putDouble(double value);
- /**
- * Put the value as a string.
+ /** Put the value as a string.
* If value is not a scalar an exception is thrown.
*/
void putString(std::string const & value);
- /**
- * Copy the array to the value field.
+ /** Copy the array to the value field.
* If the value field is not a double array field an exception is thrown.
* @param value The place where data is copied.
*/
void putDoubleArray(epics::pvData::shared_vector const & value);
- /**
- * Copy array to the value field.
+ /** Copy array to the value field.
* If the value field is not a string array field an exception is thrown.
* @param value data source
*/
void putStringArray(epics::pvData::shared_vector const & value);
- /**
- * Copy array to the value field.
+ /** Copy array to the value field.
* If the value field is not a scalarArray field an exception is thrown.
* @param value data source
*/
@@ -774,7 +695,7 @@ private:
};
/**
- * @brief This is a class that holds data returned by PvaClientMonitor
+ * This is a class that holds data returned by PvaClientMonitor
*
*/
class epicsShareClass PvaClientMonitorData
@@ -786,35 +707,34 @@ public:
*/
static PvaClientMonitorDataPtr create(epics::pvData::StructureConstPtr const & structure);
~PvaClientMonitorData() {}
- /**
- * @brief Set a prefix for throw messages.
+ /** Set a prefix for throw messages.
* @param value The prefix.
*/
void setMessagePrefix(std::string const & value);
- /** @brief Get the structure.
+ /** Get the structure.
* @return the structure.
*/
epics::pvData::StructureConstPtr getStructure();
- /** @brief Get the pvStructure.
+ /** Get the pvStructure.
* @return the pvStructure.
*/
epics::pvData::PVStructurePtr getPVStructure();
- /** @brief Get the BitSet for the pvStructure
+ /** Get the BitSet for the pvStructure
* This shows which fields have changed value.
* @return The bitSet
*/
epics::pvData::BitSetPtr getChangedBitSet();
- /** @brief Get the overrun BitSet for the pvStructure
+ /** Get the overrun BitSet for the pvStructure
* This shows which fields have had more than one change.
* @return The bitSet
*/
epics::pvData::BitSetPtr getOverrunBitSet();
- /** @brief show the fields that have changed.
+ /** Show the fields that have changed.
* @param out The stream that shows the changed fields.
* @return The stream that was input
*/
std::ostream & showChanged(std::ostream & out);
- /** @brief show the fields that have overrun.
+ /** Show the fields that have overrun.
* @param out The stream that shows the overrun fields.
* @return The stream that was input
*/
@@ -824,78 +744,65 @@ public:
* @param monitorElement The new data.
*/
void setData(epics::pvData::MonitorElementPtr const & monitorElement);
- /**
- * @brief Is there a top level field named value.
+ /** Is there a top level field named value.
* @return The answer.
*/
bool hasValue();
- /**
- * @brief Is the value field a scalar?
+ /** Is the value field a scalar?
* @return The answer.
*/
bool isValueScalar();
- /**
- * @brief Is the value field a scalar array?
+ /** Is the value field a scalar array?
* @return The answer.
*/
bool isValueScalarArray();
- /**
- * @brief Return the interface to the value field.
+ /** Get the interface to the value field.
* @return The interface. an excetion is thrown if a value field does not exist.
*/
epics::pvData::PVFieldPtr getValue();
- /**
- * @brief Return the interface to a scalar value field.
+ /** Get the interface to a scalar value field.
* @return The interface for a scalar value field.
* An exception is thown if no scalar value field.
*/
epics::pvData::PVScalarPtr getScalarValue();
- /**
- * @brief Return the interface to an array value field.
+ /** Get the interface to an array value field.
* @return The interface.
* An exception is thown if no array value field.
*/
std::tr1::shared_ptr getArrayValue();
- /**
- * @brief Return the interface to a scalar array value field.
+ /** Get the interface to a scalar array value field.
* @return Return the interface.
* An exception is thown if no scalar array value field.
*/
std::tr1::shared_ptr getScalarArrayValue();
- /**
- * @brief Get the value as a double.
+ /** Get the value as a double.
* If value is not a numeric scalar an exception is thrown.
* @return The value.
*/
double getDouble();
- /**
- * @brief Get the value as a string.
+ /** Get the value as a string.
* If value is not a scalar an exception is thrown
* @return The value.
*/
std::string getString();
- /**
- * @brief Get the value as a double array.
+ /** Get the value as a double array.
* If the value is not a numeric array an exception is thrown.
* @return The value.
*/
epics::pvData::shared_vector getDoubleArray();
- /**
- * @brief Get the value as a string array.
+ /** Get the value as a string array.
* If the value is not a string array an exception is thrown.
* @return The value.
*/
epics::pvData::shared_vector getStringArray();
- /**
- * @brief Get the alarm.
+ /** Get the alarm.
* If the pvStructure as an alarm field it's values are returned.
* If no then alarm shows that not alarm defined.
* @return The alarm.
*/
epics::pvData::Alarm getAlarm();
- /**
- * @brief Get the timeStamp.
- * If the pvStructure as a timeStamp field, it's values are returned.
+ /** Get the timeStamp.
+ * If the pvStructure has a timeStamp field, it's values are returned.
* If no then all fields are 0.
* @return The timeStamp.
*/
@@ -917,7 +824,7 @@ private:
class ChannelProcessRequesterImpl; // private to PvaClientProcess
/**
- * @brief An easy to use alternative to ChannelProcess.
+ * An easy to use alternative to ChannelProcess.
*
* @author mrk
*/
@@ -925,8 +832,7 @@ class epicsShareClass PvaClientProcess
{
public:
POINTER_DEFINITIONS(PvaClientProcess);
- /**
- * @brief Create a PvaClientProcess.
+ /** Create a PvaClientProcess.
* @param &pvaClient Interface to PvaClient
* @param pvaClientChannel Interface to PvaClientChannel
* @param channel Interface to Channel
@@ -939,40 +845,32 @@ public:
epics::pvAccess::Channel::shared_pointer const & channel,
epics::pvData::PVStructurePtr const &pvRequest
);
- /**
- * @brief destructor
+ /** Destructor
*/
~PvaClientProcess();
- /**
- * @brief destroy an resources used.
+ /** Destroy all resources used.
*/
void destroy();
- /**
- * @brief call issueConnect and then waitConnect.
+ /** Call issueConnect and then waitConnect.
* An exception is thrown if connect fails.
*/
void connect();
- /**
- * @brief create the channelProcess connection to the channel.
+ /** Issue the channelProcess connection to the channel.
* This can only be called once.
*/
void issueConnect();
- /**
- * @brief wait until the channelProcess connection to the channel is complete.
+ /** Wait until the channelProcess connection to the channel is complete.
* @return status;
*/
epics::pvData::Status waitConnect();
- /**
- * @brief Call issueProcess and then waitProcess.
+ /** Call issueProcess and then waitProcess.
* An exception is thrown if get fails.
*/
void process();
- /**
- * @brief Issue a get and return immediately.
+ /** Issue a process and return immediately.
*/
void issueProcess();
- /**
- * @brief Wait until get completes.
+ /** Wait until process completes.
* @return status.
*/
epics::pvData::Status waitProcess();
@@ -1017,7 +915,7 @@ private:
class ChannelGetRequesterImpl; // private to PvaClientGet
/**
- * @brief An easy to use alternative to ChannelGet.
+ * An easy to use alternative to ChannelGet.
*
* @author mrk
*/
@@ -1025,8 +923,7 @@ class epicsShareClass PvaClientGet
{
public:
POINTER_DEFINITIONS(PvaClientGet);
- /**
- * @brief Create a PvaClientGet.
+ /** Create a PvaClientGet.
* @param &pvaClient Interface to PvaClient
* @param pvaClientChannel Interface to PvaClientChannel
* @param channel Interface to Channel
@@ -1039,16 +936,14 @@ public:
epics::pvAccess::Channel::shared_pointer const & channel,
epics::pvData::PVStructurePtr const &pvRequest
);
- /**
- * @brief destructor
+ /** Destructor
*/
~PvaClientGet();
/**
* @brief destroy an resources used.
*/
void destroy();
- /**
- * @brief call issueConnect and then waitConnect.
+ /** Call issueConnect and then waitConnect.
* An exception is thrown if connect fails.
*/
void connect();
@@ -1057,22 +952,18 @@ public:
* This can only be called once.
*/
void issueConnect();
- /**
- * @brief wait until the channelGet connection to the channel is complete.
+ /** Wait until the channelGet connection to the channel is complete.
* @return status;
*/
epics::pvData::Status waitConnect();
- /**
- * @brief Call issueGet and then waitGet.
+ /** Call issueGet and then waitGet.
* An exception is thrown if get fails.
*/
void get();
- /**
- * @brief Issue a get and return immediately.
+ /** Issue a get and return immediately.
*/
void issueGet();
- /**
- * @brief Wait until get completes.
+ /** Wait until get completes.
* @return status;
*/
epics::pvData::Status waitGet();
@@ -1126,7 +1017,7 @@ private:
class ChannelPutRequesterImpl; // private to PvaClientPut
/**
- * @brief An easy to use alternative to ChannelPut.
+ * An easy to use alternative to ChannelPut.
*
* @author mrk
*/
@@ -1134,8 +1025,7 @@ class epicsShareClass PvaClientPut
{
public:
POINTER_DEFINITIONS(PvaClientPut);
- /**
- * @brief Create a PvaClientPut.
+ /** Create a PvaClientPut.
* @param &pvaClient Interface to PvaClient
* @param pvaClientChannel Interface to PvaClientChannel
* @param channel Interface to Channel
@@ -1148,54 +1038,44 @@ public:
epics::pvAccess::Channel::shared_pointer const & channel,
epics::pvData::PVStructurePtr const &pvRequest
);
- /**
- * @brief destructor
+ /** Destructor
*/
~PvaClientPut();
/**
- * @brief destroy an resources used.
+ * @brief destroy all resources used.
*/
void destroy();
- /**
- * @brief call issueConnect and then waitConnect.
+ /** Call issueConnect and then waitConnect.
* An exception is thrown if connect fails.
*/
void connect();
- /**
- * @brief create the channelPut connection to the channel.
+ /** Issue the channelPut connection to the channel.
* This can only be called once.
*/
void issueConnect();
- /**
- * @brief wait until the channelPut connection to the channel is complete.
+ /** Wait until the channelPut connection to the channel is complete.
* @return status;
*/
epics::pvData::Status waitConnect();
- /**
- * @brief Call issueGet and then waitGet.
+ /** Call issueGet and then waitGet.
* An exception is thrown if get fails.
*/
void get();
- /**
- * @brief Issue a get and return immediately.
+ /** Issue a get and return immediately.
*/
void issueGet();
- /**
- * @brief Wait until get completes.
+ /** Wait until get completes.
* @return status
*/
epics::pvData::Status waitGet();
- /**
- * @brief Call issuePut and then waitPut.
+ /** Call issuePut and then waitPut.
* An exception is thrown if get fails.
*/
void put();
- /**
- * @brief Issue a put and return immediately.
+ /** Issue a put and return immediately.
*/
void issuePut();
- /**
- * @brief Wait until put completes.
+ /** Wait until put completes.
* @return status
*/
epics::pvData::Status waitPut();
@@ -1251,8 +1131,7 @@ private :
};
class ChannelPutGetRequesterImpl; // private to PvaClientPutGet
-/**
- * @brief An easy to use alternative to ChannelPutGet.
+/** An easy to use alternative to ChannelPutGet.
*
* @author mrk
*/
@@ -1260,8 +1139,7 @@ class epicsShareClass PvaClientPutGet
{
public:
POINTER_DEFINITIONS(PvaClientPutGet);
- /**
- * @brief Create a PvaClientPutGet.
+ /** Create a PvaClientPutGet.
* @param &pvaClient Interface to PvaClient
* @param pvaClientChannel Interface to PvaClientChannel
* @param channel Interface to Channel
@@ -1274,81 +1152,65 @@ public:
epics::pvAccess::Channel::shared_pointer const & channel,
epics::pvData::PVStructurePtr const &pvRequest
);
- /**
- * @brief destructor
+ /** Destructor
*/
~PvaClientPutGet();
- /**
- * @brief destroy an resources used.
+ /** Destroy all resources used.
*/
void destroy();
- /**
- * @brief call issueConnect and then waitConnect.
+ /** Call issueConnect and then waitConnect.
* An exception is thrown if connect fails.
*/
void connect();
- /**
- * @brief create the channelPutGet connection to the channel.
+ /** Issue the channelPutGet connection to the channel.
* This can only be called once.
* An exception is thrown if connect fails.
*/
void issueConnect();
- /**
- * @brief wait until the channelPutGet connection to the channel is complete.
+ /** Wait until the channelPutGet connection to the channel is complete.
* @return status;
*/
epics::pvData::Status waitConnect();
- /**
- * @brief Call issuePutGet and then waitPutGet.
+ /** Call issuePutGet and then waitPutGet.
* An exception is thrown if putGet fails.
*/
void putGet();
- /**
- * @brief Issue a putGet and return immediately.
+ /** Issue a putGet and return immediately.
*/
void issuePutGet();
- /**
- * @brief Wait until putGet completes.
+ /** Wait until putGet completes.
* If failure getStatus can be called to get reason.
* @return status
*/
epics::pvData::Status waitPutGet();
- /**
- * @brief Call issueGet and then waitGetGet.
+ /** Call issueGet and then waitGetGet.
* An exception is thrown if get fails.
*/
void getGet();
- /**
- * @brief Issue a getGet and return immediately.
+ /** Issue a getGet and return immediately.
*/
void issueGetGet();
- /**
- * @brief Wait until getGet completes.
+ /** Wait until getGet completes.
* If failure getStatus can be called to get reason.
* @return status
*/
epics::pvData::Status waitGetGet();
- /**
- * @brief Call issuePut and then waitGetPut.
+ /** Call issuePut and then waitGetPut.
* An exception is thrown if getPut fails.
*/
void getPut();
- /**
- * @brief Issue a getPut and return immediately.
+ /** Issue a getPut and return immediately.
*/
void issueGetPut();
- /**
- * @brief Wait until getPut completes.
+ /** Wait until getPut completes.
* @return status
*/
epics::pvData::Status waitGetPut();
- /**
- * @brief Get the put data.
+ /** Get the put data.
* @return The interface.
*/
PvaClientPutDataPtr getPutData();
- /**
- * @brief Get the get data.
+ /** Get the get data.
* @return The interface.
*/
PvaClientGetDataPtr getGetData();
@@ -1410,26 +1272,24 @@ private :
class ChannelMonitorRequester; // private to PvaClientMonitor
/**
- * @brief Optional client callback.
+ * Optional client callback.
*
*/
class epicsShareClass PvaClientMonitorRequester
{
public:
POINTER_DEFINITIONS(PvaClientMonitorRequester);
- /**
- * @brief destructor
+ /** Destructor
*/
virtual ~PvaClientMonitorRequester(){}
- /**
- * @brief A monitor event has occurred.
+ /** A monitor event has occurred.
* @param monitor The PvaClientMonitor that received the event.
*/
virtual void event(PvaClientMonitorPtr monitor) = 0;
};
/**
- * @brief An easy to use alternative to Monitor.
+ * An easy to use alternative to Monitor.
*
*/
class epicsShareClass PvaClientMonitor :
@@ -1437,8 +1297,7 @@ class epicsShareClass PvaClientMonitor :
{
public:
POINTER_DEFINITIONS(PvaClientMonitor);
- /**
- * @brief Create a PvaClientMonitor.
+ /** Create a PvaClientMonitor.
* @param &pvaClient Interface to PvaClient
* @param pvaClientChannel Interface to PvaClientChannel
* @param channel Interface to Channel
@@ -1451,67 +1310,54 @@ public:
epics::pvAccess::Channel::shared_pointer const & channel,
epics::pvData::PVStructurePtr const &pvRequest
);
- /**
- * @brief destructor
+ /** Destructor
*/
~PvaClientMonitor();
- /**
- * @brief destroy an resources used.
+ /** Destroy all resources used.
*/
void destroy();
- /**
- * @brief call issueConnect and then waitConnect.
+ /** Call issueConnect and then waitConnect.
* An exception is thrown if connect fails.
*/
void connect();
- /**
- * @brief create the channelMonitor connection to the channel.
+ /** Issue the channelMonitor connection to the channel.
* This can only be called once.
* An exception is thrown if connect fails.
*/
void issueConnect();
- /**
- * @brief wait until the channelMonitor connection to the channel is complete.
+ /** Wait until the channelMonitor connection to the channel is complete.
* @return status;
*/
epics::pvData::Status waitConnect();
- /**
- * @brief Set a user callback.
+ /** Set a user callback.
* @param pvaClientMonitorrRequester The requester which must be implemented by the caller.
*/
void setRequester(PvaClientMonitorRequesterPtr const & pvaClientMonitorrRequester);
- /**
- * @brief Start monitoring.
+ /** Start monitoring.
*/
void start();
- /**
- * @brief Stop monitoring.
+ /** Stop monitoring.
*/
void stop();
- /**
- * @brief poll for a monitor event.
+ /** Poll for a monitor event.
* The data will be in PvaClientData.
* @return (false,true) means event (did not, did) occur.
*/
bool poll();
- /**
- * @brief wait for a monitor event.
+ /** Wait for a monitor event.
* The data will be in PvaClientData.
* @param secondsToWait Time to wait for event.
* @return (false,true) means event (did not, did) occur.
*/
bool waitEvent(double secondsToWait = 0.0);
- /**
- * @brief Release the monitorElement returned by poll
+ /** Release the monitorElement returned by poll
*/
void releaseEvent();
- /**
- * @brief The data in which monitor events are placed.
+ /** The data in which monitor events are placed.
* @return The interface.
*/
PvaClientMonitorDataPtr getData();
- /**
- * @brief get shared pointer to this
+ /** Get shared pointer to this
*/
PvaClientMonitorPtr getPtrSelf()
{
@@ -1558,7 +1404,7 @@ private:
};
/**
- * @brief Provides access to multiple channels.
+ * Provides access to multiple channels.
*
* @author mrk
*/
@@ -1567,8 +1413,7 @@ class epicsShareClass PvaClientMultiChannel :
{
public:
POINTER_DEFINITIONS(PvaClientMultiChannel);
- /**
- * @brief Create a PvaClientMultiChannel.
+ /** Create a PvaClientMultiChannel.
* @param channelNames The name. of the channel..
* @param providerName The name of the provider.
* @return The interface to the PvaClientStructure.
@@ -1578,17 +1423,14 @@ public:
epics::pvData::PVStringArrayPtr const & channelNames,
std::string const & providerName = "pva");
~PvaClientMultiChannel();
- /**
- * @brief Destroy the pvAccess connection.
+ /** Destroy the pvAccess connection.
*/
void destroy();
- /**
- * @brief Get the channelNames.
+ /** Get the channelNames.
* @return The names.
*/
epics::pvData::PVStringArrayPtr getChannelNames();
- /**
- * @brief Connect to the channel.
+ /** Connect to the channels.
* This calls issueConnect and waitConnect.
* An exception is thrown if connect fails.
* @param timeout The time to wait for connecting to the channel.
@@ -1598,33 +1440,27 @@ public:
epics::pvData::Status connect(
double timeout=5,
size_t maxNotConnected=0);
- /**
- * Are all channels connected?
+ /** Are all channels connected?
* @return if all are connected.
*/
bool allConnected();
- /**
- * Has a connection state change occured?
+ /** Has a connection state change occured?
* @return (true, false) if (at least one, no) channel has changed state.
*/
bool connectionChange();
- /**
- * Get the connection state of each channel.
+ /** Get the connection state of each channel.
* @return The state of each channel.
*/
epics::pvData::PVBooleanArrayPtr getIsConnected();
- /**
- * Get the pvaClientChannelArray.
+ /** Get the pvaClientChannelArray.
* @return The weak shared pointer.
*/
PvaClientChannelArrayWPtr getPvaClientChannelArray();
- /**
- * Get pvaClient.
+ /** Get pvaClient.
* @return The weak shared pointer.
*/
PvaClient::weak_pointer getPvaClient();
- /**
- * Get the shared pointer to self.
+ /** Get the shared pointer to self.
* @return The shared pointer.
*/
PvaClientMultiChannelPtr getPtrSelf()
diff --git a/src/pvaClientChannel.cpp b/src/pvaClientChannel.cpp
index 57a3328..b0d0eb9 100644
--- a/src/pvaClientChannel.cpp
+++ b/src/pvaClientChannel.cpp
@@ -36,6 +36,8 @@ public:
}
PvaClientGetPtr getGet(string const & request);
void addGet(string const & request,PvaClientGetPtr const & pvaClientGet);
+ void showCache();
+ size_t cacheSize();
private:
map pvaClientGetMap;
};
@@ -58,6 +60,20 @@ void PvaClientGetCache::addGet(string const & request,PvaClientGetPtr const & pv
request,pvaClientGet));
}
+void PvaClientGetCache::showCache()
+{
+ map::iterator iter;
+ for(iter = pvaClientGetMap.begin(); iter != pvaClientGetMap.end(); ++iter)
+ {
+ cout << " " << iter->first << endl;
+ }
+}
+
+size_t PvaClientGetCache::cacheSize()
+{
+ return pvaClientGetMap.size();
+
+}
class PvaClientPutCache
{
@@ -69,6 +85,8 @@ public:
}
PvaClientPutPtr getPut(string const & request);
void addPut(string const & request,PvaClientPutPtr const & pvaClientPut);
+ void showCache();
+ size_t cacheSize();
private:
map pvaClientPutMap;
};
@@ -91,6 +109,21 @@ void PvaClientPutCache::addPut(string const & request,PvaClientPutPtr const & pv
request,pvaClientPut));
}
+void PvaClientPutCache::showCache()
+{
+ map::iterator iter;
+ for(iter = pvaClientPutMap.begin(); iter != pvaClientPutMap.end(); ++iter)
+ {
+ cout << " " << iter->first << endl;
+ }
+}
+
+size_t PvaClientPutCache::cacheSize()
+{
+ return pvaClientPutMap.size();
+
+}
+
class ChannelRequesterImpl : public ChannelRequester
{
PvaClientChannel *pvaClientChannel;
@@ -482,6 +515,19 @@ PvaClientMonitorPtr PvaClientChannel::createMonitor(PVStructurePtr const & pvR
return PvaClientMonitor::create(yyy,getPtrSelf(),channel,pvRequest);
}
+void PvaClientChannel::showCache()
+{
+ cout << " pvaClientGet" << endl;
+ pvaClientGetCache->showCache();
+ cout << " pvaClientPut" << endl;
+ pvaClientPutCache->showCache();
+}
+
+size_t PvaClientChannel::cacheSize()
+{
+ return pvaClientGetCache->cacheSize() + pvaClientPutCache->cacheSize();
+}
+
PvaClientChannelPtr PvaClientChannel::create(
PvaClientPtr const &pvaClient,
diff --git a/src/pvaClientGet.cpp b/src/pvaClientGet.cpp
index bc8653d..e2d4492 100644
--- a/src/pvaClientGet.cpp
+++ b/src/pvaClientGet.cpp
@@ -169,7 +169,7 @@ Status PvaClientGet::waitConnect()
return Status::Ok;
}
connectState = connectIdle;
- return Status(Status::STATUSTYPE_ERROR,channelGetConnectStatus.getMessage());
+ return channelGetConnectStatus;
}
void PvaClientGet::get()
@@ -209,7 +209,7 @@ Status PvaClientGet::waitGet()
if(channelGetStatus.isOK()) {
return Status::Ok;
}
- return Status(Status::STATUSTYPE_ERROR,channelGetStatus.getMessage());
+ return channelGetStatus;
}
PvaClientGetDataPtr PvaClientGet::getData()
{
diff --git a/src/pvaClientMonitorData.cpp b/src/pvaClientMonitorData.cpp
index 768ffad..e6fb86b 100644
--- a/src/pvaClientMonitorData.cpp
+++ b/src/pvaClientMonitorData.cpp
@@ -38,6 +38,8 @@ static string noArray("value is not an array");
static string noScalarArray("value is not a scalarArray");
static string notDoubleArray("value is not a doubleArray");
static string notStringArray("value is not a stringArray");
+static string noAlarm("no alarm");
+static string noTimeStamp("no timeStamp");
PvaClientMonitorDataPtr PvaClientMonitorData::create(StructureConstPtr const & structure)
{
@@ -223,4 +225,38 @@ shared_vector PvaClientMonitorData::getStringArray()
}
+Alarm PvaClientMonitorData::getAlarm()
+{
+ if(!pvStructure) {
+ throw std::runtime_error(messagePrefix + noAlarm);
+ }
+ PVStructurePtr pvs = pvStructure->getSubField("alarm");
+ if(!pvs) throw std::runtime_error(messagePrefix + noAlarm);
+ pvAlarm.attach(pvs);
+ if(pvAlarm.isAttached()) {
+ Alarm alarm;
+ pvAlarm.get(alarm);
+ pvAlarm.detach();
+ return alarm;
+ }
+ throw std::runtime_error(messagePrefix + noAlarm);
+}
+
+TimeStamp PvaClientMonitorData::getTimeStamp()
+{
+ if(!pvStructure) {
+ throw std::runtime_error(messagePrefix + noTimeStamp);
+ }
+ PVStructurePtr pvs = pvStructure->getSubField("timeStamp");
+ if(!pvs) throw std::runtime_error(messagePrefix + noTimeStamp);
+ pvTimeStamp.attach(pvs);
+ if(pvTimeStamp.isAttached()) {
+ TimeStamp timeStamp;
+ pvTimeStamp.get(timeStamp);
+ pvTimeStamp.detach();
+ return timeStamp;
+ }
+ throw std::runtime_error(messagePrefix + noTimeStamp);
+}
+
}}
diff --git a/src/pvaClientMultiDouble.h b/src/pvaClientMultiDouble.h
index 028f923..b71fcd2 100644
--- a/src/pvaClientMultiDouble.h
+++ b/src/pvaClientMultiDouble.h
@@ -23,8 +23,7 @@ namespace epics { namespace pvaClient {
class PvaClientMultiDouble;
typedef std::tr1::shared_ptr PvaClientMultiDoublePtr;
-/**
- * @brief Support for multiple channels where each channel has a value field that is a scalar double.
+/** Support for multiple channels where each channel has a value field that is a scalar double.
* If any problems arise an exception is thrown.
*
* @author mrk
@@ -33,8 +32,7 @@ class epicsShareClass PvaClientMultiDouble
{
public:
POINTER_DEFINITIONS(PvaClientMultiDouble);
- /**
- * @brief Create a PvaClientMultiDouble.
+ /** Create a PvaClientMultiDouble.
* @param &pvaClient Interface to PvaClient
* @param channelName PVStringArray of channelNames.
* @param timeout The timeout in seconds for connecting.
@@ -46,21 +44,17 @@ public:
epics::pvData::PVStringArrayPtr const & channelName,
double timeout = 5.0,
std::string const & providerName = "pva");
- /**
- * @brief destructor
+ /** Destructor
*/
~PvaClientMultiDouble();
- /**
- * @brief destroy any resources used.
+ /** Destroy all resources used.
*/
void destroy();
- /**
- * @brief get the value of all the channels.
+ /** Get the value of all the channels.
* @return The data.
*/
epics::pvData::shared_vector get();
- /**
- * @brief put a new value to each channel.
+ /** Put a new value to each channel.
* @param value The data.
*/
void put(epics::pvData::shared_vector const &value);
diff --git a/src/pvaClientNTMultiChannel.h b/src/pvaClientNTMultiChannel.h
index aee1ff0..4732a87 100644
--- a/src/pvaClientNTMultiChannel.h
+++ b/src/pvaClientNTMultiChannel.h
@@ -23,8 +23,7 @@ namespace epics { namespace pvaClient {
class PvaClientNTMultiChannel;
typedef std::tr1::shared_ptr PvaClientNTMultiChannelPtr;
-/**
- * @brief Support for multiple channels where each channel has a value field that
+/** Support for multiple channels where each channel has a value field that
* is a scalar, scalarArray, or enumerated structure.
* The data is provided via normativeType NTMultiChannel.
* If any problems arise an exception is thrown.
@@ -35,8 +34,7 @@ class epicsShareClass PvaClientNTMultiChannel
{
public:
POINTER_DEFINITIONS(PvaClientNTMultiChannel);
- /**
- * @brief Create a PvaClientNTMultiChannel.
+ /** Create a PvaClientNTMultiChannel.
* @param &pvaClient Interface to PvaClient
* @param channelName PVStringArray of channelNames.
* @param structure valid NTMultiChannel structure.
@@ -50,26 +48,21 @@ public:
epics::pvData::StructureConstPtr const & structure,
double timeout = 5.0,
std::string const & providerName = "pva");
- /**
- * @brief destructor
+ /** Destructor
*/
~PvaClientNTMultiChannel();
- /**
- * @brief destroy any resources used.
+ /** Destroy all resources used.
*/
void destroy();
- /**
- * @brief get the value of all the channels.
+ /** Get the value of all the channels.
* @return The data.
*/
epics::nt::NTMultiChannelPtr get();
- /**
- * @brief put a new value to each channel.
+ /** Put a new value to each channel.
* @param value The data.
*/
void put(epics::nt::NTMultiChannelPtr const &value);
- /**
- * @brief Get the PvaClientMultiChannel.
+ /** Get the PvaClientMultiChannel.
* @return The interface.
*/
PvaClientMultiChannelPtr getPvaClientMultiChannel();
diff --git a/test/Makefile b/test/Makefile
deleted file mode 100644
index 0a9fd57..0000000
--- a/test/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Makefile at top of application tree
-
-TOP = .
-include $(TOP)/configure/CONFIG
-
-DIRS += configure
-
-DIRS += src
-src_DEPEND_DIRS = configure
-
-include $(TOP)/configure/RULES_TOP
-
-
diff --git a/test/configure/CONFIG b/test/configure/CONFIG
deleted file mode 100644
index c1a4703..0000000
--- a/test/configure/CONFIG
+++ /dev/null
@@ -1,29 +0,0 @@
-# CONFIG - Load build configuration data
-#
-# Do not make changes to this file!
-
-# Allow user to override where the build rules come from
-RULES = $(EPICS_BASE)
-
-# RELEASE files point to other application tops
-include $(TOP)/configure/RELEASE
--include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common
-ifdef T_A
--include $(TOP)/configure/RELEASE.Common.$(T_A)
--include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A)
-endif
-
-CONFIG = $(RULES)/configure
-include $(CONFIG)/CONFIG
-
-# Override the Base definition:
-INSTALL_LOCATION = $(TOP)
-
-# CONFIG_SITE files contain other build configuration settings
-include $(TOP)/configure/CONFIG_SITE
--include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common
-ifdef T_A
- -include $(TOP)/configure/CONFIG_SITE.Common.$(T_A)
- -include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
-endif
-
diff --git a/test/configure/CONFIG_SITE b/test/configure/CONFIG_SITE
deleted file mode 100644
index 6648852..0000000
--- a/test/configure/CONFIG_SITE
+++ /dev/null
@@ -1,27 +0,0 @@
-# CONFIG_SITE
-
-# Make any application-specific changes to the EPICS build
-# configuration variables in this file.
-#
-# Host/target specific settings can be specified in files named
-# CONFIG_SITE.$(EPICS_HOST_ARCH).Common
-# CONFIG_SITE.Common.$(T_A)
-# CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
-
-# CHECK_RELEASE controls the consistency checking of the support
-# applications pointed to by the RELEASE* files.
-# Normally CHECK_RELEASE should be set to YES.
-# Set CHECK_RELEASE to NO to disable checking completely.
-# Set CHECK_RELEASE to WARN to perform consistency checking but
-# continue building anyway if conflicts are found.
-CHECK_RELEASE = WARN
-
-# To install files into a location other than $(TOP) define
-# INSTALL_LOCATION here.
-#INSTALL_LOCATION=
-
-INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv
-USR_INCLUDES += -I $(INSTALL_LOCATION)/include
-
--include $(TOP)/../../CONFIG_SITE.local
--include $(TOP)/../configure/CONFIG_SITE.local
diff --git a/test/configure/ExampleRELEASE.local b/test/configure/ExampleRELEASE.local
deleted file mode 100644
index c94e3be..0000000
--- a/test/configure/ExampleRELEASE.local
+++ /dev/null
@@ -1,7 +0,0 @@
-EPICS_BASE=/home/install/epics/base
-TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top
-EPICSV4HOME=/home/hg
-PVCOMMON=${EPICSV4HOME}/pvCommonCPP
-PVDATA=${EPICSV4HOME}/pvDataCPP
-PVACCESS=${EPICSV4HOME}/pvAccessCPP
-EASYPVA==${EPICSV4HOME}/easyPVACPP
diff --git a/test/configure/Makefile b/test/configure/Makefile
deleted file mode 100644
index 9254309..0000000
--- a/test/configure/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-TOP=..
-
-include $(TOP)/configure/CONFIG
-
-TARGETS = $(CONFIG_TARGETS)
-CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS)))
-
-include $(TOP)/configure/RULES
diff --git a/test/configure/RELEASE b/test/configure/RELEASE
deleted file mode 100644
index 56e5b8b..0000000
--- a/test/configure/RELEASE
+++ /dev/null
@@ -1,41 +0,0 @@
-# pvDatabaseCPP/example RELEASE - Location of external support modules
-#
-# IF YOU CHANGE this file or any file it includes you must
-# subsequently do a "gnumake rebuild" in the application's
-# top level directory.
-#
-# The build process does not check dependencies against files
-# that are outside this application, thus you should also do a
-# "gnumake rebuild" in the top level directory after EPICS_BASE
-# or any other external module pointed to below is rebuilt.
-#
-# Host- or target-specific settings can be given in files named
-# RELEASE.$(EPICS_HOST_ARCH).Common
-# RELEASE.Common.$(T_A)
-# RELEASE.$(EPICS_HOST_ARCH).$(T_A)
-
-# EPICS V4 Developers: Do not edit the locations in this file!
-#
-# Create a file RELEASE.local pointing to your PVASRV, PVACCESS,
-# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g.
-# PVASRV = /path/to/epics/pvaSrvCPP
-# PVACCESS = /path/to/epics/pvAccessCPP
-# PVDATA = /path/to/epics/pvDataCPP
-# PVCOMMON = /path/to/epics/pvCommonCPP
-# EPICS_BASE = /path/to/epics/base
-
-# If this example is built in a directory under pvDatabaseCPP,
-# use the following definitions:
-
-EASYPVA = $(TOP)/..
-
--include $(TOP)/../configure/RELEASE.local
--include $(TOP)/../../RELEASE.local
-
-# If you copied this example from pvDatabaseCPP to be built as a
-# standalone TOP, adjust and use the following definitions:
-
-#EASYPVA = /path/to/epics/easyPVACPP
-
-#-include $(TOP)/../RELEASE.local
-#-include $(TOP)/configure/RELEASE.local
diff --git a/test/configure/RULES b/test/configure/RULES
deleted file mode 100644
index 6d56e14..0000000
--- a/test/configure/RULES
+++ /dev/null
@@ -1,6 +0,0 @@
-# RULES
-
-include $(CONFIG)/RULES
-
-# Library should be rebuilt because LIBOBJS may have changed.
-$(LIBNAME): ../Makefile
diff --git a/test/configure/RULES.ioc b/test/configure/RULES.ioc
deleted file mode 100644
index 901987c..0000000
--- a/test/configure/RULES.ioc
+++ /dev/null
@@ -1,2 +0,0 @@
-#RULES.ioc
-include $(CONFIG)/RULES.ioc
diff --git a/test/configure/RULES_DIRS b/test/configure/RULES_DIRS
deleted file mode 100644
index 3ba269d..0000000
--- a/test/configure/RULES_DIRS
+++ /dev/null
@@ -1,2 +0,0 @@
-#RULES_DIRS
-include $(CONFIG)/RULES_DIRS
diff --git a/test/configure/RULES_TOP b/test/configure/RULES_TOP
deleted file mode 100644
index d09d668..0000000
--- a/test/configure/RULES_TOP
+++ /dev/null
@@ -1,3 +0,0 @@
-#RULES_TOP
-include $(CONFIG)/RULES_TOP
-
diff --git a/test/src/Makefile b/test/src/Makefile
deleted file mode 100644
index 48feea6..0000000
--- a/test/src/Makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-# Makefile for the pvAccess tests
-
-TOP = ..
-include $(TOP)/configure/CONFIG
-
-TESTPROD_HOST += pvaClientTestPutData
-pvaClientTestPutData_SRCS = pvaClientTestPutData
-testHarness_SRCS += pvaClientTestPutData.cpp
-TESTS += pvaClientTestPutData
-
-TESTPROD_HOST += pvaClientTestGetData
-pvaClientTestGetData_SRCS = pvaClientTestGetData
-testHarness_SRCS += pvaClientTestGetData.cpp
-TESTS += pvaClientTestGetData
-
-TESTPROD_HOST += pvaClientTestMonitorData
-pvaClientTestMonitorData_SRCS = pvaClientTestMonitorData
-testHarness_SRCS += pvaClientTestMonitorData.cpp
-TESTS += pvaClientTestMonitorData
-
-TESTPROD_HOST += pvaClientTestPutGetMonitor
-pvaClientTestPutGetMonitor_SRCS = pvaClientTestPutGetMonitor
-testHarness_SRCS += pvaClientTestPutGetMonitor.cpp
-TESTS += pvaClientTestPutGetMonitor
-
-TESTPROD_HOST += pvaClientTestPutGet
-pvaClientTestPutGet_SRCS = pvaClientTestPutGet
-testHarness_SRCS += pvaClientTestPutGet.cpp
-TESTS += pvaClientTestPutGet
-
-TESTPROD_HOST += pvaClientTestMultiDouble
-pvaClientTestMultiDouble_SRCS = pvaClientTestMultiDouble
-testHarness_SRCS += pvaClientTestMultiDouble.cpp
-TESTS += pvaClientTestMultiDouble
-
-TESTPROD_HOST += pvaClientTestNTMultiChannel
-pvaClientTestNTMultiChannel_SRCS = pvaClientTestNTMultiChannel
-testHarness_SRCS += pvaClientTestNTMultiChannel.cpp
-TESTS += pvaClientTestNTMultiChannel
-
-
-PROD_LIBS += pvaClient pvAccess pvData nt Com
-
-testHarness_SRCS += pvaClientAllTests.c
-
-PROD_vxWorks = vxTestHarness
-vxTestHarness_SRCS += $(testHarness_SRCS)
-TESTSPEC_vxWorks = vxTestHarness.$(MUNCH_SUFFIX); pvaClientAllTests
-
-PROD_RTEMS += rtemsTestHarness
-rtemsTestHarness_SRCS += rtemsTestHarness.c rtemsConfig.c
-rtemsTestHarness_SRCS += $(testHarness_SRCS)
-TESTSPEC_RTEMS = rtemsTestHarness.$(MUNCH_SUFFIX); pvaClientAllTests
-
-TESTSCRIPTS_HOST += $(TESTS:%=%.t)
-
-include $(TOP)/configure/RULES
diff --git a/test/src/pvaClientAllTests.c b/test/src/pvaClientAllTests.c
deleted file mode 100644
index 347da3f..0000000
--- a/test/src/pvaClientAllTests.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Run pvaClient tests as a batch.
- *
- * Do *not* include performance measurements here, they don't help to
- * prove functionality (which is the point of this convenience routine).
- */
-
-#include
-#include
-#include
-
-int pvaClientTestGetData(void);
-int pvaClientTestPutData(void);
-int pvaClientTestMonitorData(void);
-int pvaClientTestPutGetMonitor(void);
-int pvaClientTestPutGet(void);
-int pvaClientTestMultiDouble(void);
-int pvaClientTestNTMultiChannel(void);
-
-void easyAllTests(void)
-{
- testHarness();
- runTest(pvaClientTestGetData);
- runTest(pvaClientTestPutData);
- runTest(pvaClientTestMonitorData);
- runTest(pvaClientTestPutMonitor);
- runTest(pvaClientTestPut);
- runTest(pvaClientTestMultiDouble);
- runTest(pvaClientTestNTMultiChannel);
-}
-
diff --git a/test/src/pvaClientTestGetData.cpp b/test/src/pvaClientTestGetData.cpp
deleted file mode 100644
index dab4403..0000000
--- a/test/src/pvaClientTestGetData.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/*pvaClientTestGetData.cpp */
-/**
- * Copyright - See the COPYRIGHT that is included with this distribution.
- * EPICS pvData is distributed subject to a Software License Agreement found
- * in file LICENSE that is included with this distribution.
- */
-/**
- * @author mrk
- */
-
-/* Author: Marty Kraimer */
-
-#include
-
-#include
-#include
-
-#include
-#include
-
-using namespace std;
-using namespace epics::pvData;
-using namespace epics::pvAccess;
-using namespace epics::pvaClient;
-
-static PvaClientPtr pvaClient = PvaClient::create();
-static FieldCreatePtr fieldCreate = getFieldCreate();
-static StandardFieldPtr standardField = getStandardField();
-static PVDataCreatePtr pvDataCreate = getPVDataCreate();
-
-
-void testDouble()
-{
- cout << "\nstarting testDouble\n";
- StructureConstPtr structure =
- fieldCreate->createFieldBuilder()->
- add("alarm",standardField->alarm()) ->
- add("timeStamp",standardField->timeStamp()) ->
- add("value",pvDouble) ->
- createStructure();
-
- PvaClientGetDataPtr pvaData = PvaClientGetData::create(structure);
- PVStructurePtr pvStructure = pvDataCreate->createPVStructure(pvaData->getStructure());
- BitSetPtr bitSet = BitSetPtr(new BitSet(pvStructure->getNumberFields()));
- pvaData->setData(pvStructure,bitSet);
- PVDoublePtr pvDouble = pvStructure->getSubField("value");
- size_t valueOffset = pvDouble->getFieldOffset();
- BitSetPtr change = pvaData->getBitSet();
- pvDouble->put(5.0);
- change->set(pvDouble->getFieldOffset());
- testOk(change->cardinality()==1,"num set bits 1");
- testOk(change->get(valueOffset)==true,"value changed");
- testOk(pvaData->hasValue()==true,"hasValue");
- testOk(pvaData->isValueScalar()==true,"isValueScalar");
- testOk(pvaData->isValueScalarArray()==false,"isValueScalarArray");
- bool result;
- result = false;
- if(pvaData->getValue()) result = true;
- testOk(result==true,"getValue");
- result = false;
- if(pvaData->getScalarValue()) result = true;
- testOk(result==true,"getScalarValue");
- try {
- pvaData->getArrayValue();
- } catch (std::runtime_error e) {
- cout << "getArrayValue " << e.what() << endl;
- }
- try {
- pvaData->getScalarArrayValue();
- } catch (std::runtime_error e) {
- cout << " getScalarArrayValue " << e.what() << endl;
- }
- cout << "as double " << pvaData->getDouble() << endl;
- cout << "as string " << pvaData->getString() << endl;
- try {
- shared_vector value = pvaData->getDoubleArray();
- } catch (std::runtime_error e) {
- cout << " getDoubleArray " << e.what() << endl;
- }
- try {
- shared_vector value = pvaData->getStringArray();
- } catch (std::runtime_error e) {
- cout << " getStringArray " << e.what() << endl;
- }
-}
-
-void testDoubleArray()
-{
- cout << "\nstarting testDoubleArray\n";
- StructureConstPtr structure =
- fieldCreate->createFieldBuilder()->
- add("alarm",standardField->alarm()) ->
- add("timeStamp",standardField->timeStamp()) ->
- addArray("value",pvDouble) ->
- createStructure();
-
- PvaClientGetDataPtr pvaData = PvaClientGetData::create(structure);
- PVStructurePtr pvStructure = pvDataCreate->createPVStructure(pvaData->getStructure());
- BitSetPtr bitSet = BitSetPtr(new BitSet(pvStructure->getNumberFields()));
- pvaData->setData(pvStructure,bitSet);
- PVDoubleArrayPtr pvalue = pvaData->getPVStructure()->getSubField("value");
- BitSetPtr change = pvaData->getBitSet();
- size_t valueOffset = pvalue->getFieldOffset();
- size_t len = 5;
- shared_vector value(len);
- for(size_t i=0; ireplace(freeze(value));
- change->set(valueOffset);
- testOk(change->cardinality()==1,"num set bits 1");
- testOk(change->get(valueOffset)==true,"value changed");
- testOk(pvaData->hasValue()==true,"hasValue");
- testOk(pvaData->isValueScalar()==false,"isValueScalar");
- testOk(pvaData->isValueScalarArray()==true,"isValueScalarArray");
- bool result;
- result = false;
- if(pvaData->getValue()) result = true;
- testOk(result==true,"getValue");
- result = false;
- if(pvaData->getArrayValue()) result = true;
- testOk(result==true,"getArrayValue");
- result = false;
- if(pvaData->getScalarArrayValue()) result = true;
- testOk(result==true,"getScalarValue");
- try {
- pvaData->getScalarValue();
- } catch (std::runtime_error e) {
- cout << " getScalarValue " << e.what() << endl;
- }
- try {
- cout << "as double " << pvaData->getDouble() << endl;
- } catch (std::runtime_error e) {
- cout << " getDouble " << e.what() << endl;
- }
- try {
- string val = pvaData->getString();
- } catch (std::runtime_error e) {
- cout << " getString " << e.what() << endl;
- }
- cout << "as doubleArray " << pvaData->getDoubleArray() << endl;
- try {
- shared_vector value = pvaData->getStringArray();
- } catch (std::runtime_error e) {
- cout << " getStringArray " << e.what() << endl;
- }
-}
-
-MAIN(pvaClientTestGetData)
-{
- cout << "\nstarting pvaClientTestGetData\n";
- testPlan(15);
- testDouble();
- testDoubleArray();
- return 0;
-}
-
diff --git a/test/src/pvaClientTestMonitorData.cpp b/test/src/pvaClientTestMonitorData.cpp
deleted file mode 100644
index a299563..0000000
--- a/test/src/pvaClientTestMonitorData.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-/*pvaClientTestMonitorData.cpp */
-/**
- * Copyright - See the COPYRIGHT that is included with this distribution.
- * EPICS pvData is distributed subject to a Software License Agreement found
- * in file LICENSE that is included with this distribution.
- */
-/**
- * @author mrk
- */
-
-/* Author: Marty Kraimer */
-
-#include
-
-#include
-#include
-
-#include
-#include
-
-using namespace std;
-using namespace epics::pvData;
-using namespace epics::pvAccess;
-using namespace epics::pvaClient;
-
-static PvaClientPtr pvaClient = PvaClient::create();
-static FieldCreatePtr fieldCreate = getFieldCreate();
-static StandardFieldPtr standardField = getStandardField();
-static PVDataCreatePtr pvDataCreate = getPVDataCreate();
-
-
-void testDouble()
-{
- cout << "\nstarting testDouble\n";
- StructureConstPtr structure =
- fieldCreate->createFieldBuilder()->
- add("alarm",standardField->alarm()) ->
- add("timeStamp",standardField->timeStamp()) ->
- add("value",pvDouble) ->
- createStructure();
-
- PvaClientMonitorDataPtr pvaData = PvaClientMonitorData::create(structure);
- MonitorElementPtr monitorElement(new MonitorElement(pvDataCreate->createPVStructure(pvaData->getStructure())));
- pvaData->setData(monitorElement);
- PVDoublePtr pvDouble = pvaData->getPVStructure()->getSubField("value");
- size_t valueOffset = pvDouble->getFieldOffset();
- BitSetPtr change = pvaData->getChangedBitSet();
- pvDouble->put(5.0);
- change->set(pvDouble->getFieldOffset());
- testOk(change->cardinality()==1,"num set bits 1");
- testOk(change->get(valueOffset)==true,"value changed");
- testOk(pvaData->hasValue()==true,"hasValue");
- testOk(pvaData->isValueScalar()==true,"isValueScalar");
- testOk(pvaData->isValueScalarArray()==false,"isValueScalarArray");
- bool result;
- result = false;
- if(pvaData->getValue()) result = true;
- testOk(result==true,"getValue");
- result = false;
- if(pvaData->getScalarValue()) result = true;
- testOk(result==true,"getScalarValue");
- try {
- pvaData->getArrayValue();
- } catch (std::runtime_error e) {
- cout << "getArrayValue " << e.what() << endl;
- }
- try {
- pvaData->getScalarArrayValue();
- } catch (std::runtime_error e) {
- cout << " getScalarArrayValue " << e.what() << endl;
- }
- cout << "as double " << pvaData->getDouble() << endl;
- cout << "as string " << pvaData->getString() << endl;
- try {
- shared_vector value = pvaData->getDoubleArray();
- } catch (std::runtime_error e) {
- cout << " getDoubleArray " << e.what() << endl;
- }
- try {
- shared_vector value = pvaData->getStringArray();
- } catch (std::runtime_error e) {
- cout << " getStringArray " << e.what() << endl;
- }
-}
-
-void testDoubleArray()
-{
- cout << "\nstarting testDoubleArray\n";
- StructureConstPtr structure =
- fieldCreate->createFieldBuilder()->
- add("alarm",standardField->alarm()) ->
- add("timeStamp",standardField->timeStamp()) ->
- addArray("value",pvDouble) ->
- createStructure();
-
- PvaClientMonitorDataPtr pvaData = PvaClientMonitorData::create(structure);
- MonitorElementPtr monitorElement(new MonitorElement(pvDataCreate->createPVStructure(pvaData->getStructure())));
- pvaData->setData(monitorElement);
- PVDoubleArrayPtr pvalue = pvaData->getPVStructure()->getSubField("value");
- BitSetPtr change = pvaData->getChangedBitSet();
- size_t valueOffset = pvalue->getFieldOffset();
- size_t len = 5;
- shared_vector value(len);
- for(size_t i=0; ireplace(freeze(value));
- change->set(valueOffset);
- testOk(change->cardinality()==1,"num set bits 1");
- testOk(change->get(valueOffset)==true,"value changed");
- testOk(pvaData->hasValue()==true,"hasValue");
- testOk(pvaData->isValueScalar()==false,"isValueScalar");
- testOk(pvaData->isValueScalarArray()==true,"isValueScalarArray");
- bool result;
- result = false;
- if(pvaData->getValue()) result = true;
- testOk(result==true,"getValue");
- result = false;
- if(pvaData->getArrayValue()) result = true;
- testOk(result==true,"getArrayValue");
- result = false;
- if(pvaData->getScalarArrayValue()) result = true;
- testOk(result==true,"getScalarValue");
- try {
- pvaData->getScalarValue();
- } catch (std::runtime_error e) {
- cout << " getScalarValue " << e.what() << endl;
- }
- try {
- cout << "as double " << pvaData->getDouble() << endl;
- } catch (std::runtime_error e) {
- cout << " getDouble " << e.what() << endl;
- }
- try {
- string val = pvaData->getString();
- } catch (std::runtime_error e) {
- cout << " getString " << e.what() << endl;
- }
- cout << "as doubleArray " << pvaData->getDoubleArray() << endl;
- try {
- shared_vector value = pvaData->getStringArray();
- } catch (std::runtime_error e) {
- cout << " getStringArray " << e.what() << endl;
- }
-}
-
-MAIN(pvaClientTestMonitorData)
-{
- cout << "\nstarting pvaClientTestMonitorData\n";
- testPlan(15);
- testDouble();
- testDoubleArray();
- return 0;
-}
-
diff --git a/test/src/pvaClientTestMultiDouble.cpp b/test/src/pvaClientTestMultiDouble.cpp
deleted file mode 100644
index 6735500..0000000
--- a/test/src/pvaClientTestMultiDouble.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-/*pvaClientTestMultiDouble.cpp */
-/**
- * Copyright - See the COPYRIGHT that is included with this distribution.
- * EPICS pvData is distributed subject to a Software License Agreement found
- * in file LICENSE that is included with this distribution.
- */
-/**
- * @author mrk
- */
-
-/* Author: Marty Kraimer */
-
-#include
-
-#include
-#include
-#include
-
-using namespace std;
-using namespace epics::pvData;
-using namespace epics::pvAccess;
-using namespace epics::pvaClient;
-
-
-static void testGood(PvaClientPtr const &pvaClient)
-{
- bool isOk = true;
- cout << "\nstarting testGood\n";
- try {
- PvaClientPtr pvaClient(PvaClient::create());
- size_t num = 5;
- shared_vector channelNames(num);
- channelNames[0] = "exampleDouble01";
- channelNames[1] = "exampleDouble02";
- channelNames[2] = "exampleDouble03";
- channelNames[3] = "exampleDouble04";
- channelNames[4] = "exampleDouble05";
- PVStringArrayPtr pvNames =
- getPVDataCreate()->createPVScalarArray();
- pvNames->replace(freeze(channelNames));
- PvaClientMultiDoublePtr multiDouble(PvaClientMultiDouble::create(pvaClient,pvNames));
- shared_vector data = multiDouble->get();
- cout << "initial " << data << endl;
- for(size_t i=0; iput(data);
- data = multiDouble->get();
- cout << "final " << data << endl;
- } catch (std::runtime_error e) {
- cout << "exception " << e.what() << endl;
- isOk = false;
- }
- testOk(isOk==true,"all channels double");
-}
-
-static void testGoodMixed(PvaClientPtr const &pvaClient)
-{
- bool isOk = true;
- cout << "\nstarting testGoodMixed\n";
- try {
- PvaClientPtr pvaClient(PvaClient::create());
- size_t num = 5;
- shared_vector channelNames(num);
- channelNames[0] = "exampleByte";
- channelNames[1] = "exampleShort";
- channelNames[2] = "exampleInt";
- channelNames[3] = "exampleFloat";
- channelNames[4] = "exampleDouble";
- PVStringArrayPtr pvNames =
- getPVDataCreate()->createPVScalarArray();
- pvNames->replace(freeze(channelNames));
- PvaClientMultiDoublePtr multiDouble(PvaClientMultiDouble::create(pvaClient,pvNames));
- shared_vector data = multiDouble->get();
- cout << "initial " << data << endl;
- for(size_t i=0; iput(data);
- data = multiDouble->get();
- cout << "final " << data << endl;
- } catch (std::runtime_error e) {
- cout << "exception " << e.what() << endl;
- isOk = false;
- }
- testOk(isOk==true,"channels mixed type");
-}
-
-static void testChannelNotExist(PvaClientPtr const &pvaClient)
-{
- bool isOk = true;
- cout << "\nstarting testChannelNotExist\n";
- try {
- PvaClientPtr pvaClient(PvaClient::create());
- size_t num = 5;
- shared_vector channelNames(num);
- channelNames[0] = "exampleDouble01";
- channelNames[1] = "exampleDouble02";
- channelNames[2] = "exampleDouble03";
- channelNames[3] = "NoneExistChannel";
- channelNames[4] = "exampleDouble05";
- PVStringArrayPtr pvNames =
- getPVDataCreate()->createPVScalarArray();
- pvNames->replace(freeze(channelNames));
- PvaClientMultiDoublePtr multiDouble(PvaClientMultiDouble::create(pvaClient,pvNames));
- shared_vector data = multiDouble->get();
- cout << "initial " << data << endl;
- for(size_t i=0; iput(data);
- data = multiDouble->get();
- cout << "final " << data << endl;
- } catch (std::runtime_error e) {
- cout << "exception " << e.what() << endl;
- isOk = false;
- }
- testOk(isOk==false,"channel not exist");
-}
-
-static void testNonNumeric(PvaClientPtr const &pvaClient)
-{
- bool isOk = true;
- cout << "\nstarting testNonNumeric\n";
- try {
- PvaClientPtr pvaClient(PvaClient::create());
- size_t num = 5;
- shared_vector channelNames(num);
- channelNames[0] = "exampleDouble01";
- channelNames[1] = "exampleDouble02";
- channelNames[2] = "exampleDouble03";
- channelNames[3] = "exampleDouble04";
- channelNames[4] = "exampleDouble05Array";
- PVStringArrayPtr pvNames =
- getPVDataCreate()->createPVScalarArray();
- pvNames->replace(freeze(channelNames));
- PvaClientMultiDoublePtr multiDouble(PvaClientMultiDouble::create(pvaClient,pvNames));
- shared_vector data = multiDouble->get();
- cout << "initial " << data << endl;
- for(size_t i=0; iput(data);
- data = multiDouble->get();
- cout << "final " << data << endl;
- } catch (std::runtime_error e) {
- cout << "exception " << e.what() << endl;
- isOk = false;
- }
- testOk(isOk==false,"channel not numeric");
-}
-
-MAIN(pvaClientTestMultiDouble)
-{
- cout << "\nstarting pvaClientTestMultiDouble\n";
- testPlan(4);
- PvaClientPtr pvaClient = PvaClient::create();
- testGood(pvaClient);
- testGoodMixed(pvaClient);
- testChannelNotExist(pvaClient);
- testNonNumeric(pvaClient);
- cout << "done\n";
- return 0;
-}
diff --git a/test/src/pvaClientTestNTMultiChannel.cpp b/test/src/pvaClientTestNTMultiChannel.cpp
deleted file mode 100644
index 7b222ce..0000000
--- a/test/src/pvaClientTestNTMultiChannel.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/*pvaClientTestNTMultiChannel.cpp */
-/**
- * Copyright - See the COPYRIGHT that is included with this distribution.
- * EPICS pvData is distributed subject to a Software License Agreement found
- * in file LICENSE that is included with this distribution.
- */
-/**
- * @author mrk
- */
-
-/* Author: Marty Kraimer */
-
-#include
-
-#include
-#include
-#include
-
-using namespace std;
-using namespace epics::pvData;
-using namespace epics::pvAccess;
-using namespace epics::pvaClient;
-using namespace epics::nt;
-using std::tr1::static_pointer_cast;
-
-
-static void testGood(PvaClientPtr const &pvaClient)
-{
- PVDataCreatePtr pvDataCreate(getPVDataCreate());
- bool isOk = true;
- cout << "\nstarting testGood\n";
- try {
- PvaClientPtr pvaClient(PvaClient::create());
- size_t num = 5;
- shared_vector channelNames(num);
- channelNames[0] = "exampleDouble";
- channelNames[1] = "exampleDoubleArray";
- channelNames[2] = "exampleString";
- channelNames[3] = "exampleBoolean";
- channelNames[4] = "exampleEnum";
- PVStringArrayPtr pvNames = pvDataCreate->
- createPVScalarArray();
- pvNames->replace(freeze(channelNames));
- NTMultiChannelBuilderPtr builder = NTMultiChannel::createBuilder();
- StructureConstPtr structure = builder->
- addTimeStamp()->
- addSeverity() ->
- addStatus() ->
- addMessage() ->
- addSecondsPastEpoch() ->
- addNanoseconds() ->
- addUserTag() ->
- createStructure();
- PvaClientNTMultiChannelPtr multi = PvaClientNTMultiChannel::create(
- pvaClient,pvNames,structure);
- NTMultiChannelPtr nt = multi->get();
- for(size_t numtimes=0; numtimes<3; ++numtimes) {
- PVUnionArrayPtr pvValue = nt->getPVStructure()->
- getSubField("value");
- cout << "initial\n" << nt->getPVStructure() << endl;
- shared_vector valueVector = pvValue->reuse();
- for(size_t i=0; iget();
- Type type = pvField->getField()->getType();
- if(type==scalar) {
- PVScalarPtr pvScalar = static_pointer_cast(pvField);
- ScalarType scalarType = pvScalar->getScalar()->getScalarType();
- if(ScalarTypeFunc::isNumeric(scalarType)) {
- double oldValue = pvScalar->getAs();
- oldValue++;
- pvScalar->putFrom(oldValue);
- } else if(scalarType==pvString) {
- PVStringPtr pv = static_pointer_cast(pvField);
- string val = pv->get();
- val += " added";
- pv->put(val);
- } else if(scalarType==pvBoolean) {
- PVBooleanPtr pv = static_pointer_cast(pvField);
- bool val = pv->get();
- pv->put(!val);
- }
- } else if(type==scalarArray) {
- PVScalarArrayPtr pv =
- static_pointer_cast(pvField);
- ScalarType scalarType = pv->getScalarArray()->getElementType();
- if(scalarType==pvDouble) {
- PVDoubleArrayPtr pvd = static_pointer_cast(pv);
- shared_vector valvec = pvd->reuse();
- if(valvec.capacity()==0) {
- valvec.resize(4);
- for(size_t i=0; ireplace(freeze(valvec));
- }
- } else if(type==epics::pvData::structure) {
- PVStructurePtr pvStructure = static_pointer_cast(pvField);
- PVIntPtr pv = pvStructure->getSubField("index");
- if(pv) {
- PVStringArrayPtr choices = pvStructure->getSubField("choices");
- if(choices) {
- int32 nchoices = choices->getLength();
- int32 oldval = pv->get();
- int32 newval = (oldval==nchoices) ? 0 : ++oldval;
- pv->put(newval);
- }
- }
- }
- }
- pvValue->replace(freeze(valueVector));
- multi->put(nt);
- nt = multi->get();
- }
- cout << "final\n" << nt->getPVStructure() << endl;
- } catch (std::runtime_error e) {
- cout << "exception " << e.what() << endl;
- isOk = false;
- }
- testOk(isOk==true,"no problems");
-}
-
-
-MAIN(pvaClientTestNTMultiChannel)
-{
- cout << "\nstarting pvaClientTestNTMultiChannel\n";
- testPlan(1);
- PvaClientPtr pvaClient = PvaClient::create();
- testGood(pvaClient);
- cout << "done\n";
- return 0;
-}
diff --git a/test/src/pvaClientTestPutData.cpp b/test/src/pvaClientTestPutData.cpp
deleted file mode 100644
index 72d20fc..0000000
--- a/test/src/pvaClientTestPutData.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-/*pvaClientTestPutData.cpp */
-/**
- * Copyright - See the COPYRIGHT that is included with this distribution.
- * EPICS pvData is distributed subject to a Software License Agreement found
- * in file LICENSE that is included with this distribution.
- */
-/**
- * @author mrk
- */
-
-/* Author: Marty Kraimer */
-
-#include
-
-#include
-#include
-
-#include
-#include
-
-using namespace std;
-using namespace epics::pvData;
-using namespace epics::pvAccess;
-using namespace epics::pvaClient;
-
-static PvaClientPtr pvaClient = PvaClient::create();
-static FieldCreatePtr fieldCreate = getFieldCreate();
-static StandardFieldPtr standardField = getStandardField();
-static PVDataCreatePtr pvDataCreate = getPVDataCreate();
-
-static void testPostPut()
-{
- cout << "\nstarting testPostPut\n";
- StructureConstPtr structure =
- fieldCreate->createFieldBuilder()->
- add("alarm",standardField->alarm()) ->
- add("timeStamp",standardField->timeStamp()) ->
- addNestedStructure("power") ->
- add("value",pvDouble) ->
- add("alarm",standardField->alarm()) ->
- endNested()->
- addNestedStructure("voltage") ->
- add("value",pvDouble) ->
- add("alarm",standardField->alarm()) ->
- endNested()->
- addNestedStructure("current") ->
- add("value",pvDouble) ->
- add("alarm",standardField->alarm()) ->
- endNested()->
- createStructure();
-
- PvaClientPutDataPtr pvaData = PvaClientPutData::create(structure);
- PVStructurePtr pvStructure = pvaData->getPVStructure();
- BitSetPtr change = pvaData->getBitSet();
- PVDoublePtr powerValue = pvStructure->getSubField("power.value");
- PVDoublePtr voltageValue = pvStructure->getSubField("voltage.value");
- PVDoublePtr currentValue = pvStructure->getSubField("current.value");
- size_t powerOffset = powerValue->getFieldOffset();
- size_t voltageOffset = voltageValue->getFieldOffset();
- size_t currentOffset = currentValue->getFieldOffset();
- change->clear();
- powerValue->put(1.0);
- voltageValue->put(2.0);
- currentValue->put(.5);
- cout << "changed\n";
- cout << pvaData->showChanged(cout) << endl;
- testOk(change->cardinality()==3,"num set bits 3");
- testOk(change->get(powerOffset)==true,"power changed");
- testOk(change->get(voltageOffset)==true,"voltage changed");
- testOk(change->get(currentOffset)==true,"current changed");
-}
-
-void testDouble()
-{
- cout << "\nstarting testDouble\n";
- StructureConstPtr structure =
- fieldCreate->createFieldBuilder()->
- add("alarm",standardField->alarm()) ->
- add("timeStamp",standardField->timeStamp()) ->
- add("value",pvDouble) ->
- createStructure();
-
- PvaClientPutDataPtr pvaData = PvaClientPutData::create(structure);
- PVDoublePtr pvDouble = pvaData->getPVStructure()->getSubField("value");
- pvDouble->put(5.0);
- BitSetPtr change = pvaData->getBitSet();
- size_t valueOffset = pvDouble->getFieldOffset();
- testOk(change->cardinality()==1,"num set bits 1");
- testOk(change->get(valueOffset)==true,"value changed");
- testOk(pvaData->hasValue()==true,"hasValue");
- testOk(pvaData->isValueScalar()==true,"isValueScalar");
- testOk(pvaData->isValueScalarArray()==false,"isValueScalarArray");
- bool result;
- result = false;
- if(pvaData->getValue()) result = true;
- testOk(result==true,"getValue");
- result = false;
- if(pvaData->getScalarValue()) result = true;
- testOk(result==true,"getScalarValue");
- try {
- pvaData->getArrayValue();
- } catch (std::runtime_error e) {
- cout << "getArrayValue " << e.what() << endl;
- }
- try {
- pvaData->getScalarArrayValue();
- } catch (std::runtime_error e) {
- cout << " getScalarArrayValue " << e.what() << endl;
- }
- cout << "as double " << pvaData->getDouble() << endl;
- cout << "as string " << pvaData->getString() << endl;
- try {
- shared_vector value = pvaData->getDoubleArray();
- } catch (std::runtime_error e) {
- cout << " getDoubleArray " << e.what() << endl;
- }
- try {
- shared_vector value = pvaData->getStringArray();
- } catch (std::runtime_error e) {
- cout << " getStringArray " << e.what() << endl;
- }
- pvaData->putDouble(5.0);
- pvaData->putString("1e5");
- try {
- size_t len = 2;
- shared_vector val(len);
- for(size_t i=0; iputDoubleArray(freeze(val));
- } catch (std::runtime_error e) {
- cout << " putDoubleArray " << e.what() << endl;
- }
- try {
- size_t len = 2;
- shared_vector val(len);
- val[0] = "one"; val[1] = "two";
- pvaData->putStringArray(freeze(val));
- } catch (std::runtime_error e) {
- cout << " putStringArray " << e.what() << endl;
- }
-}
-
-void testDoubleArray()
-{
- cout << "\nstarting testDoubleArray\n";
- StructureConstPtr structure =
- fieldCreate->createFieldBuilder()->
- add("alarm",standardField->alarm()) ->
- add("timeStamp",standardField->timeStamp()) ->
- addArray("value",pvDouble) ->
- createStructure();
-
- PvaClientPutDataPtr pvaData = PvaClientPutData::create(structure);
- PVDoubleArrayPtr pvalue = pvaData->getPVStructure()->getSubField("value");
- size_t len = 5;
- shared_vector value(len);
- for(size_t i=0; ireplace(freeze(value));
- BitSetPtr change = pvaData->getBitSet();
- size_t valueOffset = pvalue->getFieldOffset();
- testOk(change->cardinality()==1,"num set bits 1");
- testOk(change->get(valueOffset)==true,"value changed");
- testOk(pvaData->hasValue()==true,"hasValue");
- testOk(pvaData->isValueScalar()==false,"isValueScalar");
- testOk(pvaData->isValueScalarArray()==true,"isValueScalarArray");
- bool result;
- result = false;
- if(pvaData->getValue()) result = true;
- testOk(result==true,"getValue");
- result = false;
- if(pvaData->getArrayValue()) result = true;
- testOk(result==true,"getArrayValue");
- result = false;
- if(pvaData->getScalarArrayValue()) result = true;
- testOk(result==true,"getScalarValue");
- try {
- pvaData->getScalarValue();
- } catch (std::runtime_error e) {
- cout << " getScalarValue " << e.what() << endl;
- }
- try {
- cout << "as double " << pvaData->getDouble() << endl;
- } catch (std::runtime_error e) {
- cout << " getDouble " << e.what() << endl;
- }
- try {
- string val = pvaData->getString();
- } catch (std::runtime_error e) {
- cout << " getString " << e.what() << endl;
- }
- cout << "as doubleArray " << pvaData->getDoubleArray() << endl;
- try {
- shared_vector value = pvaData->getStringArray();
- } catch (std::runtime_error e) {
- cout << " getStringArray " << e.what() << endl;
- }
- try {
- pvaData->putDouble(5.0);
- } catch (std::runtime_error e) {
- cout << " putDouble " << e.what() << endl;
- }
- try {
- pvaData->putString("1e5");
- } catch (std::runtime_error e) {
- cout << " putString " << e.what() << endl;
- }
- value = shared_vector(len);
- for(size_t i=0; iputDoubleArray(freeze(value));
- cout << "as doubleArray " << pvaData->getDoubleArray() << endl;
- try {
- size_t len = 2;
- shared_vector val(len);
- val[0] = "one"; val[1] = "two";
- pvaData->putStringArray(freeze(val));
- cout << "as stringArray " << val << endl;
- } catch (std::runtime_error e) {
- cout << " putStringArray " << e.what() << endl;
- }
-}
-
-MAIN(pvaClientTestPutData)
-{
- cout << "\nstarting pvaClientTestPutData\n";
- testPlan(19);
- testPostPut();
- testDouble();
- testDoubleArray();
- return 0;
-}
diff --git a/test/src/pvaClientTestPutGet.cpp b/test/src/pvaClientTestPutGet.cpp
deleted file mode 100644
index eb08007..0000000
--- a/test/src/pvaClientTestPutGet.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*pvaClientTestPutGet.cpp */
-/**
- * Copyright - See the COPYRIGHT that is included with this distribution.
- * EPICS pvData is distributed subject to a Software License Agreement found
- * in file LICENSE that is included with this distribution.
- */
-/**
- * @author mrk
- */
-
-/* Author: Marty Kraimer */
-
-#include
-
-#include
-#include
-#include
-
-using namespace std;
-using namespace epics::pvData;
-using namespace epics::pvAccess;
-using namespace epics::pvaClient;
-
-
-static void example(PvaClientPtr const &pvaClient)
-{
- cout << "\nstarting channelPutGet example\n";
- try {
-cout << "calling createChannel\n";
- PvaClientChannelPtr pvaChannel = pvaClient->createChannel("examplePowerSupply");
-cout << "calling connect\n";
- pvaChannel->connect(2.0);
- testOk(true==true,"connected");
-cout << "calling createPutGet\n";
- PvaClientPutGetPtr putGet = pvaChannel->createPutGet(
- "putField(power.value,voltage.value)getField()");
-cout << "calling getPutData\n";
- PvaClientPutDataPtr putData = putGet->getPutData();
- testOk(true==true,"put connected");
- PVStructurePtr pvStructure = putData->getPVStructure();
- PVDoublePtr power = pvStructure->getSubField("power.value");
- PVDoublePtr voltage = pvStructure->getSubField("voltage.value");
- power->put(5.0);
- voltage->put(5.0);
- putGet->putGet();
- PvaClientGetDataPtr getData = putGet->getGetData();
- pvStructure = getData->getPVStructure();
- BitSetPtr bitSet = getData->getBitSet();
- cout << "changed " << getData->showChanged(cout) << endl;
- cout << "bitSet " << *bitSet << endl;
- power->put(6.0);
- putGet->putGet();
- pvStructure = getData->getPVStructure();
- bitSet = getData->getBitSet();
- cout << "changed " << getData->showChanged(cout) << endl;
- } catch (std::runtime_error e) {
- cout << "exception " << e.what() << endl;
- }
-}
-
-
-MAIN(pvaClientTestPutGet)
-{
- cout << "\nstarting pvaClientTestPutGet\n";
- testPlan(2);
- PvaClientPtr pvaClient = PvaClient::create();
- example(pvaClient);
- cout << "done\n";
- return 0;
-}
diff --git a/test/src/pvaClientTestPutGetMonitor.cpp b/test/src/pvaClientTestPutGetMonitor.cpp
deleted file mode 100644
index 88386c6..0000000
--- a/test/src/pvaClientTestPutGetMonitor.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*pvaClientTestPutGetMonitor.cpp */
-/**
- * Copyright - See the COPYRIGHT that is included with this distribution.
- * EPICS pvData is distributed subject to a Software License Agreement found
- * in file LICENSE that is included with this distribution.
- */
-/**
- * @author mrk
- */
-
-/* Author: Marty Kraimer */
-
-#include
-
-#include
-#include
-#include
-
-using namespace std;
-using namespace epics::pvData;
-using namespace epics::pvAccess;
-using namespace epics::pvaClient;
-
-
-class MyMonitor : public PvaClientMonitorRequester
-{
-public:
- MyMonitor() {}
- virtual ~MyMonitor() {}
- virtual void event(PvaClientMonitorPtr monitor)
- {
- while(true) {
- if(!monitor->poll()) return;
- PvaClientMonitorDataPtr pvaData = monitor->getData();
- cout << "changed\n";
- pvaData->showChanged(cout);
- cout << "overrun\n";
- pvaData->showOverrun(cout);
- monitor->releaseEvent();
-
- }
- }
-};
-
-static void exampleDouble(PvaClientPtr const &pvaClient)
-{
- cout << "\nstarting exampleDouble\n";
- try {
- cout << "long way\n";
- PvaClientChannelPtr pvaChannel = pvaClient->createChannel("exampleDouble");
- pvaChannel->connect(2.0);
- testOk(true==true,"connected");
- PvaClientPutPtr put = pvaChannel->createPut();
- PvaClientPutDataPtr putData = put->getData();
- testOk(true==true,"put connected");
- PvaClientGetPtr get = pvaChannel->createGet();
- PvaClientGetDataPtr getData = get->getData();
- testOk(true==true,"get connected");
- PvaClientMonitorRequesterPtr requester(new MyMonitor());
- PvaClientMonitorPtr monitor = pvaChannel->monitor(requester);
- testOk(true==true,"monitor connected");
- double out;
- double in;
- for(size_t i=0 ; i< 5; ++i) {
- out = i;
- putData->putDouble(out);
- put->put();
- get->get();
- in = getData->getDouble();
- cout << "out " << out << " in " << in << endl;
- }
- PvaClientProcessPtr process = pvaChannel->createProcess();
- process->connect();
- process->process();
- } catch (std::runtime_error e) {
- cout << "exception " << e.what() << endl;
- }
-}
-
-
-MAIN(pvaClientTestPutGetMonitor)
-{
- cout << "\nstarting pvaClientTestPutGetMonitor\n";
- testPlan(4);
- PvaClientPtr pvaClient = PvaClient::create();
- exampleDouble(pvaClient);
- cout << "done\n";
- return 0;
-}