18 Commits

Author SHA1 Message Date
Andrew Johnson b1c101578b Update version numbers and formatting in documentation 2018-12-17 16:17:52 -06:00
Andrew Johnson 8ab4dd1fdb Correct SHRLIB_VERSION 2018-12-17 16:16:59 -06:00
Andrew Johnson 5242540725 Update and unify README.md 2018-12-17 16:16:06 -06:00
Michael Davidsaver a8f296ceb3 update travis-ci 2018-10-29 18:02:20 -07:00
Marty Kraimer 6633d4f21e Merge pull request #52 from mrkraimer/master
with multiple threads callback can occur before create completes
2018-10-06 05:59:14 -04:00
mrkraimer 8745dd03b3 with multithreads callback can occur before create completes 2018-10-05 15:59:59 -04:00
Marty Kraimer cfc3c9b998 Merge pull request #51 from mrkraimer/master
several changes
2018-09-28 07:00:34 -04:00
mrkraimer d57893b566 remove #include <pv/pvCopy.h> 2018-09-27 15:34:02 -04:00
mrkraimer b7ea0fe59a fix bug that causes failure in monotor::stop for privider ca 2018-07-27 05:43:47 -04:00
Marty Kraimer 4e4554af4e Merge pull request #50 from mrkraimer/master
re-implement methods used by pvaPy
2018-01-30 09:11:28 -05:00
mrkraimer d6d5bcf771 merge with epics-base 2018-01-12 15:20:47 -05:00
mrkraimer 6bcc036c71 reimplement methods called by pvaPy
The methods are:
static PvaClientPtr create() EPICS_DEPRECATED;
and
static PvaClientMonitorPtr create(
    PvaClientPtr const &pvaClient,
    std::string const & channelName,
    std::string const & providerName,
    std::string const & request,
    PvaClientChannelStateChangeRequesterPtr const & stateChangeRequester
            = PvaClientChannelStateChangeRequesterPtr(),
    PvaClientMonitorRequesterPtr const & monitorRequester
            = PvaClientMonitorRequesterPtr()
) EPICS_DEPRECATED;
2018-01-12 13:51:13 -05:00
Marty Kraimer a405dd7bdb Merge pull request #49 from epics-base/revert-48-master
Revert "Minor changes"
2018-01-09 15:58:58 -05:00
Marty Kraimer 22e260351c Revert "Minor changes" 2018-01-09 15:14:30 -05:00
Marty Kraimer 5a5b8f809d Merge pull request #48 from mrkraimer/master
Minor changes
2018-01-09 11:16:52 -05:00
mrkraimer 9d5f06c11d pull latest from epics-base 2018-01-08 09:20:13 -05:00
mrkraimer 28a23dc5a8 remove a create method from monitor; remove unused channelStateChange methods 2018-01-05 14:38:42 -05:00
Ralph Lange dcda03c9fc jenkins-ci: fix CloudBees doc job 2017-12-19 09:20:11 +01:00
16 changed files with 161 additions and 337 deletions
+2 -13
View File
@@ -1,21 +1,10 @@
#!/bin/sh
set -e -x
# set RTEMS to eg. "4.9" or "4.10"
# requires qemu, bison, flex, texinfo, install-info
if [ -n "$RTEMS" ]
then
# find local qemu-system-i386
export PATH="$HOME/.cache/qemu/usr/bin:$PATH"
echo -n "Using QEMU: "
type qemu-system-i386 || echo "Missing qemu"
EXTRA=RTEMS_QEMU_FIXUPS=YES
fi
make -j2 $EXTRA
if [ "$TEST" != "NO" ]
then
make tapfiles
make -s test-results
make -j2 tapfiles
make -j2 -s test-results
fi
+11 -80
View File
@@ -3,35 +3,6 @@ set -e -x
CURDIR="$PWD"
QDIR="$HOME/.cache/qemu"
if [ -n "$RTEMS" -a "$TEST" = "YES" ]
then
git clone --quiet --branch vme --depth 10 https://github.com/mdavidsaver/qemu.git "$HOME/.build/qemu"
cd "$HOME/.build/qemu"
HEAD=`git log -n1 --pretty=format:%H`
echo "HEAD revision $HEAD"
[ -e "$HOME/.cache/qemu/built" ] && BUILT=`cat "$HOME/.cache/qemu/built"`
echo "Cached revision $BUILT"
if [ "$HEAD" != "$BUILT" ]
then
echo "Building QEMU"
git submodule --quiet update --init
install -d "$HOME/.build/qemu/build"
cd "$HOME/.build/qemu/build"
"$HOME/.build/qemu/configure" --prefix="$HOME/.cache/qemu/usr" --target-list=i386-softmmu --disable-werror
make -j2
make install
echo "$HEAD" > "$HOME/.cache/qemu/built"
fi
fi
cat << EOF > $CURDIR/configure/RELEASE.local
EPICS_BASE=$HOME/.source/epics-base
EOF
@@ -39,24 +10,6 @@ EOF
install -d "$HOME/.source"
cd "$HOME/.source"
add_base_module() {
MODULE=$1
BRANCH=$2
( cd epics-base/modules && \
git clone --quiet --depth 5 --branch $MODULE/$BRANCH https://github.com/${REPOBASE:-epics-base}/epics-base.git $MODULE && \
cd $MODULE && git log -n1 )
}
add_gh_module() {
MODULE=$1
REPOOWNER=$2
REPONAME=$3
BRANCH=$4
( cd epics-base/modules && \
git clone --quiet --depth 5 --branch $BRANCH https://github.com/$REPOOWNER/$REPONAME.git $MODULE && \
cd $MODULE && git log -n1 )
}
add_gh_flat() {
MODULE=$1
REPOOWNER=$2
@@ -71,23 +24,12 @@ ${MODULE_UC}=$HOME/.source/$MODULE
EOF
}
if [ "$BRBASE" ]
then
git clone --quiet --depth 5 --branch "$BRBASE" https://github.com/${REPOBASE:-epics-base}/epics-base.git epics-base
(cd epics-base && git log -n1 )
add_gh_flat pvData ${REPOPVD:-epics-base} pvDataCPP ${BRPVD:-master}
add_gh_flat pvAccess ${REPOPVA:-epics-base} pvAccessCPP ${BRPVA:-master}
add_gh_flat normativeTypes ${REPONT:-epics-base} normativeTypesCPP ${BRNT:-master}
else
git clone --quiet --depth 5 --branch core/"${BRCORE:-master}" https://github.com/${REPOBASE:-epics-base}/epics-base.git epics-base
( cd epics-base && git log -n1 )
add_base_module libcom "${BRLIBCOM:-master}"
add_base_module ca "${BRCA:-master}"
add_base_module database "${BRDATABASE:-master}"
add_gh_module pvData ${REPOPVD:-epics-base} pvDataCPP ${BRPVD:-master}
add_gh_module pvAccess ${REPOPVA:-epics-base} pvAccessCPP ${BRPVA:-master}
add_gh_module normativeTypes ${REPONT:-epics-base} normativeTypesCPP ${BRNT:-master}
fi
# not recursive
git clone --quiet --depth 5 --branch "$BRBASE" https://github.com/${REPOBASE:-epics-base}/epics-base.git epics-base
(cd epics-base && git log -n1 )
add_gh_flat pvData ${REPOPVD:-epics-base} pvDataCPP ${BRPVD:-master}
add_gh_flat pvAccess ${REPOPVA:-epics-base} pvAccessCPP ${BRPVA:-master}
add_gh_flat normativeTypes ${REPONT:-epics-base} normativeTypesCPP ${BRNT:-master}
if [ -e $CURDIR/configure/RELEASE.local ]
then
@@ -150,31 +92,20 @@ EOF
if [ -n "$RTEMS" ]
then
echo "Cross RTEMS${RTEMS} for pc386"
install -d /home/travis/.cache
curl -L "https://github.com/mdavidsaver/rsb/releases/download/travis-20160306-2/rtems${RTEMS}-i386-trusty-20190306-2.tar.gz" \
| tar -C /home/travis/.cache -xj
curl -L "https://github.com/mdavidsaver/rsb/releases/download/20171203-${RTEMS}/i386-rtems${RTEMS}-trusty-20171203-${RTEMS}.tar.bz2" \
| tar -C / -xmj
sed -i -e '/^RTEMS_VERSION/d' -e '/^RTEMS_BASE/d' epics-base/configure/os/CONFIG_SITE.Common.RTEMS
cat << EOF >> epics-base/configure/os/CONFIG_SITE.Common.RTEMS
RTEMS_VERSION=$RTEMS
RTEMS_BASE=/home/travis/.cache/rtems${RTEMS}-i386
RTEMS_BASE=$HOME/.rtems
EOF
cat << EOF >> epics-base/configure/CONFIG_SITE
CROSS_COMPILER_TARGET_ARCHS+=RTEMS-pc386
CROSS_COMPILER_TARGET_ARCHS += RTEMS-pc386-qemu
EOF
# find local qemu-system-i386
export PATH="$HOME/.cache/qemu/usr/bin:$PATH"
echo -n "Using QEMU: "
type qemu-system-i386 || echo "Missing qemu"
EXTRA=RTEMS_QEMU_FIXUPS=YES
fi
make -j2 -C epics-base $EXTRA
if [ "$BRBASE" ]
then
make -j2 -C pvData $EXTRA
make -j2 -C pvAccess $EXTRA
make -j2 -C normativeTypes $EXTRA
fi
make -j2 -C pvAccess $EXTRA
+13 -11
View File
@@ -11,19 +11,21 @@ addons:
- perl
- clang
- g++-mingw-w64-i686
- qemu-system-x86
install:
- ./.ci/travis-prepare.sh
script:
- ./.ci/travis-build.sh
env:
- BRCORE=master BRLIBCOM=master BRPVD=master BRPVA=master BRNT=master TEST=NO
- CMPLR=clang TEST=NO
- USR_CXXFLAGS=-std=c++11 TEST=NO
- CMPLR=clang USR_CXXFLAGS=-std=c++11 TEST=NO
- WINE=32 TEST=NO STATIC=YES
- WINE=32 TEST=NO STATIC=NO
- RTEMS=4.10 TEST=NO
- RTEMS=4.9 TEST=NO
- BRBASE=3.16 TEST=NO
- BRBASE=3.15 TEST=NO
- BRBASE=3.14 TEST=NO
- BRBASE=7.0
- BRBASE=7.0 CMPLR=clang
- BRBASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++98"
- BRBASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11"
- BRBASE=7.0 CMPLR=clang EXTRA="CMD_CXXFLAGS=-std=c++11"
- BRBASE=7.0 WINE=32 TEST=NO STATIC=YES
- BRBASE=7.0 WINE=32 TEST=NO STATIC=NO
- BRBASE=7.0 RTEMS=4.10 TEST=NO
- BRBASE=7.0 RTEMS=4.9 TEST=NO
- BRBASE=3.16
- BRBASE=3.15
- BRBASE=3.14
+11 -17
View File
@@ -1,23 +1,17 @@
pvaClientCPP
============
# pvaClientCPP
pvaClient is a synchronous client interface to pvAccess,
which is callback based.
pvaClient is thus easier to use than pvAccess itself.
The **pvaClient** API provides a synchronous client interface that was designed to be easier to use than the original basic pvAccess client API.
See documentation/pvaClientCPP.html for details.
The pvaClientCPP module implements the pvaClient API for C++ client applications.
Building
--------
## Links
If a proper RELEASE.local file exists one directory level above pvaClientCPP
then just type:
- General information about EPICS can be found at the
[EPICS Controls website](https://epics-controls.org).
- API documentation for this module can be found in its
documentation directory, in particular the file
pvaClientCPP.html
make
It can also be built by:
cp configure/ExampleRELEASE.local configure/RELEASE.local
edit configure/RELEASE.local
make
## Building
This module is included as a submodule of a full EPICS 7 release and will be compiled during builds of that software.
+25 -19
View File
@@ -1,18 +1,30 @@
pvaClientCPP Version 4.3.0
==========================
# pvaClientCPP Module
Works with pvDataCPP-7.0 and pvAccessCPP-6.0 versions
-----------------------------------------------------
This document summarizes the changes to the module between releases.
Will not work with older versions of these modules.
destroy methods removed
-----------------------
## Release 4.4 (EPICS 7.0.2, Dec 2018)
All the destroy methods are removed since implementation is RAII compliant.
### API changes to PvaClientMonitor
API changes to PvaClientMonitor
-------------------------------
The create method that had arguments for stateChangeRequester and monitorRequester no longer exists.
### API changes to PvaClientGet, ..., PvaClientMonitor
Previously the pvaClientGet, ..., pvaClientMonitor classes all implemented PvaClientChannelStateChangeRequester(). This method was never called and has been removed.
## Release 4.3 (EPICS 7.0.1, Dec 2017)
### Requires pvDataCPP-7.0 and pvAccessCPP-6.0 versions
This release will not work with older versions of these modules.
### Destroy methods removed
All the destroy() methods have been removed, implementation is RAII compliant.
### API changes to PvaClientMonitor
The second argument of method
@@ -22,7 +34,7 @@ The second argument of method
epics::pvData::PVStructurePtr const &pvRequest
);
Is now changed to
is now changed to
static PvaClientMonitorPtr create(
PvaClientPtr const &pvaClient,
@@ -42,22 +54,16 @@ A new method is also implemented
);
pvaClientCPP Version 4.2
========================
## Release 4.2 (EPICS V4.6, Aug 2016)
* The examples are moved to exampleCPP.
* Support for channelRPC is now available.
* In PvaClientMultiChannel checkConnected() now throws an exception if connect fails.
pvaClientCPP Version 4.1
========================
## Release 4.1 (EPICS V4.5, Oct 2015)
pvaClient is a synchronous API for pvAccess.
This is the first release of pvaClientCPP.
It provides an API that is similar to pvaClientJava.
+6 -6
View File
@@ -26,13 +26,13 @@
<div class="head">
<h1>EPICS pvaClientCPP</h1>
<h2 class="nocount">Release 4.3.0 - 2017-12-14</h2>
<h2 class="nocount">Release 4.4 - December 2018</h2>
<h2 class="nocount">Abstract</h2>
<p>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
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.</p>
<p>Specifically, pvaClient provides a synchronous interface for pvAccess, which is the
@@ -41,7 +41,7 @@ pvAccess provides a callback based interface, which can be hard to use.
pvaClient provides an interface that does not require callbacks even for monitors.
</p>
<p>
pvaClientChannel provides many "convenience" methods to directly get and put
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.
</p>
@@ -62,11 +62,11 @@ The data for the channels is presented via normative type NTMultiChannel.
</div> <!-- head -->
<div id="contents" class="contents">
<div id="contents" class="contents">
<hr />
<h2>Overview</h2>
<p>
pvaClientCPP is one of the components of
pvaClientCPP is one of the components of
<a href="http://epics-pvdata.sourceforge.net">
EPICS Version 4
</a>
+1 -8
View File
@@ -21,14 +21,7 @@ installE4 () {
local module=$1
local branch=$2
# If microbench version does not exist, try without
if [ "${MB}" = "WITH_MICROBENCH" ]; then
if ! wget -nv https://openepics.ci.cloudbees.com/job/e4-cpp-${module}-${branch}-build/BASE=${BASE},MB=WITH_MICROBENCH/lastSuccessfulBuild/artifact/${module}.CB-dist.tar.gz; then
wget -nv https://openepics.ci.cloudbees.com/job/e4-cpp-${module}-${branch}-build/BASE=${BASE},MB=NO_MICROBENCH/lastSuccessfulBuild/artifact/${module}.CB-dist.tar.gz
fi
else
wget -nv https://openepics.ci.cloudbees.com/job/e4-cpp-${module}-${branch}-build/BASE=${BASE},MB=NO_MICROBENCH/lastSuccessfulBuild/artifact/${module}.CB-dist.tar.gz
fi
wget -nv https://openepics.ci.cloudbees.com/job/e4-cpp-${module}-${branch}-build/BASE=${BASE}/lastSuccessfulBuild/artifact/${module}.CB-dist.tar.gz
tar -xzf ${module}.CB-dist.tar.gz
}
+1 -1
View File
@@ -6,7 +6,7 @@ include $(TOP)/configure/CONFIG
LIBRARY += pvaClient
# shared library ABI version.
SHRLIB_VERSION ?= 4.3.0
SHRLIB_VERSION ?= 4.4.0
INC += pv/pvaClient.h
INC += pv/pvaClientMultiChannel.h
+19 -26
View File
@@ -23,7 +23,6 @@
#include <pv/event.h>
#include <pv/lock.h>
#include <pv/pvData.h>
#include <pv/pvCopy.h>
#include <pv/pvTimeStamp.h>
#include <pv/timeStamp.h>
#include <pv/pvAlarm.h>
@@ -120,6 +119,12 @@ public:
/** @brief Get the requester name.
* @return The name.
*/
/** @brief Create an instance of PvaClient with providerName "pva ca".
* @return shared pointer to the single instance
* @deprecated This method will go away in future versions. Use get instead.
*/
static PvaClientPtr create() EPICS_DEPRECATED;
std::string getRequesterName();
/** @brief A new message.
*
@@ -967,14 +972,13 @@ typedef std::tr1::shared_ptr<ChannelProcessRequesterImpl> ChannelProcessRequeste
* <a href = "../htmldoxygen/pvaClientProcess.html">Overview of PvaClientProcess</a>
*/
class epicsShareClass PvaClientProcess :
public PvaClientChannelStateChangeRequester,
public std::tr1::enable_shared_from_this<PvaClientProcess>
{
public:
POINTER_DEFINITIONS(PvaClientProcess);
/** @brief Create a PvaClientProcess.
* @param &pvaClient Interface to PvaClient
* @param channel Interface to Channel
* @param pvaClient Interface to PvaClient
* @param pvaClientChannel Interface to Channel
* @param pvRequest The request structure.
* @return The interface to the PvaClientProcess.
*/
@@ -1054,13 +1058,11 @@ private:
ProcessConnectState connectState;
PvaClientChannelStateChangeRequesterWPtr pvaClientChannelStateChangeRequester;
PvaClientProcessRequesterWPtr pvaClientProcessRequester;
enum ProcessState {processIdle,processActive,processComplete};
ProcessState processState;
ChannelProcessRequesterImplPtr channelProcessRequester;
public:
void channelStateChange(PvaClientChannelPtr const & pvaClientChannel, bool isConnected);
friend class ChannelProcessRequesterImpl;
};
@@ -1104,7 +1106,6 @@ public:
* <a href = "../htmldoxygen/pvaClientGet.html">Overview of PvaClientGet</a>
*/
class epicsShareClass PvaClientGet :
public PvaClientChannelStateChangeRequester,
public std::tr1::enable_shared_from_this<PvaClientGet>
{
public:
@@ -1183,7 +1184,7 @@ private:
PvaClientChannelPtr const & pvaClientChannel,
epics::pvData::PVStructurePtr const &pvRequest);
void checkGetState();
void checkConnectState();
enum GetConnectState {connectIdle,connectActive,connected};
PvaClient::weak_pointer pvaClient;
@@ -1200,14 +1201,12 @@ private:
GetConnectState connectState;
PvaClientChannelStateChangeRequesterWPtr pvaClientChannelStateChangeRequester;
PvaClientGetRequesterWPtr pvaClientGetRequester;
enum GetState {getIdle,getActive,getComplete};
GetState getState;
ChannelGetRequesterImplPtr channelGetRequester;
public:
void channelStateChange(PvaClientChannelPtr const & pvaClientChannel, bool isConnected);
friend class ChannelGetRequesterImpl;
};
@@ -1263,14 +1262,13 @@ public:
* <a href = "../htmldoxygen/pvaClientPut.html">Overview of PvaClientPut</a>
*/
class epicsShareClass PvaClientPut :
public PvaClientChannelStateChangeRequester,
public std::tr1::enable_shared_from_this<PvaClientPut>
{
public:
POINTER_DEFINITIONS(PvaClientPut);
/** @brief Create a PvaClientPut.
* @param &pvaClient Interface to PvaClient
* @param channel Interface to Channel
* @param pvaClient Interface to PvaClient
* @param pvaClientChannel Interface to Channel
* @param pvRequest The request structure.
* @return The interface to the PvaClientPut.
*/
@@ -1355,7 +1353,7 @@ private :
PvaClientChannelPtr const & pvaClientChannel,
epics::pvData::PVStructurePtr const &pvRequest);
void checkPutState();
void checkConnectState();
enum PutConnectState {connectIdle,connectActive,connected};
PvaClient::weak_pointer pvaClient;
@@ -1374,10 +1372,8 @@ private :
enum PutState {putIdle,getActive,putActive,putComplete};
PutState putState;
ChannelPutRequesterImplPtr channelPutRequester;
PvaClientChannelStateChangeRequesterWPtr pvaClientChannelStateChangeRequester;
PvaClientPutRequesterWPtr pvaClientPutRequester;
public:
void channelStateChange(PvaClientChannelPtr const & pvaClientChannel, bool isConnected);
friend class ChannelPutRequesterImpl;
};
@@ -1444,14 +1440,13 @@ public:
* <a href = "../htmldoxygen/pvaClientPutGet.html">Overview of PvaClientPutGet</a>
*/
class epicsShareClass PvaClientPutGet :
public PvaClientChannelStateChangeRequester,
public std::tr1::enable_shared_from_this<PvaClientPutGet>
{
public:
POINTER_DEFINITIONS(PvaClientPutGet);
/** @brief Create a PvaClientPutGet.
* @param &pvaClient Interface to PvaClient
* @param channel Interface to Channel
* @param pvaClient Interface to PvaClient
* @param pvaClientChannel Interface to Channel
* @param pvRequest The request structure.
* @return The interface to the PvaClientPutGet.
*/
@@ -1584,10 +1579,8 @@ private :
enum PutGetState {putGetIdle,putGetActive,putGetComplete};
PutGetState putGetState;
ChannelPutGetRequesterImplPtr channelPutGetRequester;
PvaClientChannelStateChangeRequesterWPtr pvaClientChannelStateChangeRequester;
PvaClientPutGetRequesterWPtr pvaClientPutGetRequester;
public:
void channelStateChange(PvaClientChannelPtr const & pvaClientChannel, bool isConnected);
friend class ChannelPutGetRequesterImpl;
};
@@ -1639,7 +1632,7 @@ typedef std::tr1::shared_ptr<MonitorRequesterImpl> MonitorRequesterImplPtr;
* <a href = "../htmldoxygen/pvaClientMonitor.html">Overview of PvaClientMonitor</a>
*/
class epicsShareClass PvaClientMonitor :
public PvaClientChannelStateChangeRequester,
public PvaClientChannelStateChangeRequester, // remove when deprecated create removed
public PvaClientMonitorRequester,
public std::tr1::enable_shared_from_this<PvaClientMonitor>
{
@@ -1664,6 +1657,7 @@ public:
* @param stateChangeRequester The state change requester. Can be null.
* @param monitorRequester The monitor requester. Can be null;
* @return The new instance.
* @deprecated client can create PvaClientMonitor on first channel connect.
*/
static PvaClientMonitorPtr create(
PvaClientPtr const &pvaClient,
@@ -1674,7 +1668,7 @@ public:
= PvaClientChannelStateChangeRequesterPtr(),
PvaClientMonitorRequesterPtr const & monitorRequester
= PvaClientMonitorRequesterPtr()
);
) EPICS_DEPRECATED;
/** @brief Destructor
*/
~PvaClientMonitor();
@@ -1767,15 +1761,14 @@ private:
epics::pvData::MonitorPtr monitor;
epics::pvData::MonitorElementPtr monitorElement;
PvaClientChannelStateChangeRequesterWPtr pvaClientChannelStateChangeRequester;
PvaClientMonitorRequesterWPtr pvaClientMonitorRequester;
MonitorConnectState connectState;
bool userPoll;
bool userWait;
MonitorRequesterImplPtr monitorRequester;
PvaClientChannelStateChangeRequesterWPtr pvaClientChannelStateChangeRequester; //deprecate
public:
void channelStateChange(PvaClientChannelPtr const & channel, bool isConnected);
void channelStateChange(PvaClientChannelPtr const & channel, bool isConnected); //deprecate
void event(PvaClientMonitorPtr const & monitor);
friend class MonitorRequesterImpl;
};
+2 -1
View File
@@ -111,6 +111,7 @@ PvaClientPtr PvaClient::get(std::string const & providerNames)
return master;
}
PvaClientPtr PvaClient::create() {return get();}
PvaClient::PvaClient(std::string const & providerNames)
: pvaClientChannelCache(new PvaClientChannelCache()),
@@ -231,4 +232,4 @@ size_t PvaClient::cacheSize()
}
}}
+4 -1
View File
@@ -170,6 +170,7 @@ void PvaClientChannel::channelCreated(const Status& status, Channel::shared_poin
<< endl;
}
Lock xx(mutex);
this->channel = channel;
if(connectState==connected) return;
if(connectState!=connectActive) {
string message("PvaClientChannel::channelCreated");
@@ -198,15 +199,17 @@ void PvaClientChannel::channelStateChange(
<< " " << Channel::ConnectionStateNames[connectionState]
<< endl;
}
bool waitingForConnect = false;
if(connectState==connectActive) waitingForConnect = true;
if(connectionState!=Channel::CONNECTED) {
Lock xx(mutex);
string mess(channelName +
" connection state " + Channel::ConnectionStateNames[connectionState]);
message(mess,errorMessage);
connectState = notConnected;
} else {
Lock xx(mutex);
this->channel = channel;
connectState = connected;
}
if(waitingForConnect) {
+4 -22
View File
@@ -114,35 +114,17 @@ PvaClientGet::~PvaClientGet()
}
}
void PvaClientGet::channelStateChange(PvaClientChannelPtr const & pvaClientChannel, bool isConnected)
{
if(PvaClient::getDebug()) {
cout<< "PvaClientGet::channelStateChange"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< " isConnected " << (isConnected ? "true" : "false")
<< endl;
}
if(isConnected&&!channelGet)
{
connectState = connectActive;
channelGet = pvaClientChannel->getChannel()->createChannelGet(channelGetRequester,pvRequest);
}
PvaClientChannelStateChangeRequesterPtr req(pvaClientChannelStateChangeRequester.lock());
if(req) {
req->channelStateChange(pvaClientChannel,isConnected);
}
}
void PvaClientGet::checkGetState()
void PvaClientGet::checkConnectState()
{
if(PvaClient::getDebug()) {
cout << "PvaClientGet::checkGetState"
cout << "PvaClientGet::checkConnectState"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
if(!pvaClientChannel->getChannel()->isConnected()) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientGet::checkGetState channel not connected ";
+ " PvaClientGet::checkConnectState channel not connected ";
throw std::runtime_error(message);
}
if(connectState==connectIdle) {
@@ -352,7 +334,7 @@ PvaClientGetDataPtr PvaClientGet::getData()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
checkGetState();
checkConnectState();
if(getState==getIdle) get();
return pvaClientData;
}
+8 -21
View File
@@ -83,11 +83,6 @@ PvaClientMonitorPtr PvaClientMonitor::create(
PvaClientChannelPtr const & pvaClientChannel,
PVStructurePtr const &pvRequest)
{
if(PvaClient::getDebug()) {
cout<< "PvaClientMonitor::create(pvaClient,pvaClientChannel,pvRequest)\n"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
PvaClientMonitorPtr clientMonitor(new PvaClientMonitor(pvaClient,pvaClientChannel,pvRequest));
clientMonitor->monitorRequester = MonitorRequesterImplPtr(
new MonitorRequesterImpl(clientMonitor,pvaClient));
@@ -137,7 +132,9 @@ PvaClientMonitor::PvaClientMonitor(
userWait(false)
{
if(PvaClient::getDebug()) {
cout<< "PvaClientMonitor::PvaClientMonitor()" << endl;
cout<< "PvaClientMonitor::PvaClientMonitor\n"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
}
@@ -174,6 +171,11 @@ void PvaClientMonitor::channelStateChange(PvaClientChannelPtr const & channel, b
void PvaClientMonitor::event(PvaClientMonitorPtr const & monitor)
{
if(PvaClient::getDebug()) {
cout << "PvaClientMonitor::event"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
PvaClientMonitorRequesterPtr req(pvaClientMonitorRequester.lock());
if(req) req->event(monitor);
}
@@ -434,16 +436,6 @@ bool PvaClientMonitor::poll()
<< endl;
}
checkMonitorState();
if(!isStarted) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientMonitor::poll illegal state ";
throw std::runtime_error(message);
}
if(userPoll) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientMonitor::poll did not release last";
throw std::runtime_error(message);
}
monitorElement = monitor->poll();
if(!monitorElement) return false;
userPoll = true;
@@ -481,11 +473,6 @@ void PvaClientMonitor::releaseEvent()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
if(!isStarted) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientMonitor::releaseEvent monitor not started ";
throw std::runtime_error(message);
}
if(!userPoll) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientMonitor::releaseEvent did not call poll";
+2 -45
View File
@@ -112,50 +112,6 @@ PvaClientProcess::~PvaClientProcess()
}
}
void PvaClientProcess::channelStateChange(PvaClientChannelPtr const & pvaClientChannel, bool isConnected)
{
if(PvaClient::getDebug()) {
cout<< "PvaClientProcess::channelStateChange"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< " isConnected " << (isConnected ? "true" : "false")
<< endl;
}
if(isConnected)
{
connectState = connectActive;
channelProcess = pvaClientChannel->getChannel()->createChannelProcess(channelProcessRequester,pvRequest);
}
PvaClientChannelStateChangeRequesterPtr req(pvaClientChannelStateChangeRequester.lock());
if(req) {
req->channelStateChange(pvaClientChannel,isConnected);
}
}
void PvaClientProcess::checkProcessState()
{
if(PvaClient::getDebug()) {
cout << "PvaClientProcess::checkProcessState"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
if(!pvaClientChannel->getChannel()->isConnected()) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientProcess::checkProcessState channel not connected ";
throw std::runtime_error(message);
}
if(connectState==connectIdle) {
connect();
}
if(connectState==connectActive){
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " "
+ channelProcessConnectStatus.getMessage();
throw std::runtime_error(message);
}
if(processState==processIdle) process();
}
// from ChannelProcessRequester
string PvaClientProcess::getRequesterName()
{
@@ -255,6 +211,7 @@ void PvaClientProcess::issueConnect()
throw std::runtime_error(message);
}
connectState = connectActive;
channelProcessConnectStatus = Status(Status::STATUSTYPE_ERROR, "connect active");
channelProcess = pvaClientChannel->getChannel()->createChannelProcess(channelProcessRequester,pvRequest);
}
@@ -302,7 +259,7 @@ void PvaClientProcess::issueProcess()
<< endl;
}
if(connectState==connectIdle) connect();
if(processState!=processIdle) {
if(processState==processActive) {
string message = string("channel ") + pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientProcess::issueProcess process aleady active ";
throw std::runtime_error(message);
+38 -42
View File
@@ -118,29 +118,11 @@ PvaClientPut::~PvaClientPut()
}
}
void PvaClientPut::channelStateChange(PvaClientChannelPtr const & pvaClientChannel, bool isConnected)
{
if(PvaClient::getDebug()) {
cout<< "PvaClientPut::channelStateChange"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< " isConnected " << (isConnected ? "true" : "false")
<< endl;
}
if(isConnected&&!channelPut)
{
connectState = connectActive;
channelPut = pvaClientChannel->getChannel()->createChannelPut(channelPutRequester,pvRequest);
}
PvaClientChannelStateChangeRequesterPtr req(pvaClientChannelStateChangeRequester.lock());
if(req) {
req->channelStateChange(pvaClientChannel,isConnected);
}
}
void PvaClientPut::checkPutState()
void PvaClientPut::checkConnectState()
{
if(PvaClient::getDebug()) {
cout << "PvaClientPut::checkPutState"
cout << "PvaClientPut::checkConnectState"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
@@ -217,13 +199,17 @@ void PvaClientPut::getDone(
<< " status.isOK " << (status.isOK() ? "true" : "false")
<< endl;
}
channelGetPutStatus = status;
if(status.isOK()) {
PVStructurePtr pvs = pvaClientData->getPVStructure();
pvs->copyUnchecked(*pvStructure,*bitSet);
BitSetPtr bs = pvaClientData->getChangedBitSet();
bs->clear();
*bs |= *bitSet;
{
Lock xx(mutex);
channelGetPutStatus = status;
if(status.isOK()) {
PVStructurePtr pvs = pvaClientData->getPVStructure();
pvs->copyUnchecked(*pvStructure,*bitSet);
BitSetPtr bs = pvaClientData->getChangedBitSet();
bs->clear();
*bs |= *bitSet;
putState = putComplete;
}
}
PvaClientPutRequesterPtr req(pvaClientPutRequester.lock());
if(req) {
@@ -242,7 +228,11 @@ void PvaClientPut::putDone(
<< " status.isOK " << (status.isOK() ? "true" : "false")
<< endl;
}
channelGetPutStatus = status;
{
Lock xx(mutex);
channelGetPutStatus = status;
putState = putComplete;
}
PvaClientPutRequesterPtr req(pvaClientPutRequester.lock());
if(req) {
req->putDone(status,shared_from_this());
@@ -351,14 +341,17 @@ Status PvaClientPut::waitGet()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
if(putState!=getActive){
string message = string("channel ")
+ pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientPut::waitGet illegal put state";
throw std::runtime_error(message);
{
Lock xx(mutex);
if(putState==putComplete) return channelGetPutStatus;
if(putState!=getActive){
string message = string("channel ")
+ pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientPut::waitGet illegal put state";
throw std::runtime_error(message);
}
}
waitForGetPut.wait();
putState = putComplete;
return channelGetPutStatus;
}
@@ -392,7 +385,7 @@ void PvaClientPut::issuePut()
if(putState==getActive || putState==putActive) {
string message = string("channel ")
+ pvaClientChannel->getChannel()->getChannelName()
+ "PvaClientPut::issueGet get or put aleady active ";
+ "PvaClientPut::issuePut get or put aleady active ";
throw std::runtime_error(message);
}
putState = putActive;
@@ -406,14 +399,17 @@ Status PvaClientPut::waitPut()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
if(putState!=putActive){
string message = string("channel ")
+ pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientPut::waitPut illegal put state";
throw std::runtime_error(message);
{
Lock xx(mutex);
if(putState==putComplete) return channelGetPutStatus;
if(putState!=putActive){
string message = string("channel ")
+ pvaClientChannel->getChannel()->getChannelName()
+ " PvaClientPut::waitPut illegal put state";
throw std::runtime_error(message);
}
}
waitForGetPut.wait();
putState = putComplete;
if(channelGetPutStatus.isOK()) pvaClientData->getChangedBitSet()->clear();
return channelGetPutStatus;
}
@@ -425,7 +421,7 @@ PvaClientPutDataPtr PvaClientPut::getData()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
checkPutState();
checkConnectState();
if(putState==putIdle) get();
return pvaClientData;
}
+14 -24
View File
@@ -131,25 +131,6 @@ PvaClientPutGet::~PvaClientPutGet()
}
}
void PvaClientPutGet::channelStateChange(PvaClientChannelPtr const & pvaClientChannel, bool isConnected)
{
if(PvaClient::getDebug()) {
cout<< "PvaClientPutGet::channelStateChange"
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< " isConnected " << (isConnected ? "true" : "false")
<< endl;
}
if(isConnected&&!channelPutGet)
{
connectState = connectActive;
channelPutGet = pvaClientChannel->getChannel()->createChannelPutGet(channelPutGetRequester,pvRequest);
}
PvaClientChannelStateChangeRequesterPtr req(pvaClientChannelStateChangeRequester.lock());
if(req) {
req->channelStateChange(pvaClientChannel,isConnected);
}
}
void PvaClientPutGet::checkPutGetState()
{
if(PvaClient::getDebug()) {
@@ -235,6 +216,7 @@ void PvaClientPutGet::putGetDone(
<< endl;
}
channelPutGetStatus = status;
putGetState = putGetComplete;
if(status.isOK()) {
PVStructurePtr pvs = pvaClientGetData->getPVStructure();
pvs->copyUnchecked(*getPVStructure,*getChangedBitSet);
@@ -262,6 +244,7 @@ void PvaClientPutGet::getPutDone(
<< endl;
}
channelPutGetStatus = status;
putGetState = putGetComplete;
if(status.isOK()) {
PVStructurePtr pvs = pvaClientPutData->getPVStructure();
pvs->copyUnchecked(*putPVStructure,*putBitSet);
@@ -289,6 +272,7 @@ void PvaClientPutGet::getGetDone(
<< endl;
}
channelPutGetStatus = status;
putGetState = putGetComplete;
if(status.isOK()) {
PVStructurePtr pvs = pvaClientGetData->getPVStructure();
pvs->copyUnchecked(*getPVStructure,*getChangedBitSet);
@@ -407,6 +391,7 @@ Status PvaClientPutGet::waitPutGet()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
if(putGetState==putGetComplete) return channelPutGetStatus;
if(putGetState!=putGetActive){
string message = string("channel ")
+ pvaClientChannel->getChannel()->getChannelName()
@@ -414,7 +399,6 @@ Status PvaClientPutGet::waitPutGet()
throw std::runtime_error(message);
}
waitForPutGet.wait();
putGetState = putGetComplete;
if(channelPutGetStatus.isOK()) pvaClientPutData->getChangedBitSet()->clear();
return channelPutGetStatus;
}
@@ -461,6 +445,7 @@ Status PvaClientPutGet::waitGetGet()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
if(putGetState==putGetComplete) return channelPutGetStatus;
if(putGetState!=putGetActive){
string message = string("channel ")
+ pvaClientChannel->getChannel()->getChannelName()
@@ -468,7 +453,6 @@ Status PvaClientPutGet::waitGetGet()
throw std::runtime_error(message);
}
waitForPutGet.wait();
putGetState = putGetComplete;
return channelPutGetStatus;
}
@@ -514,6 +498,7 @@ Status PvaClientPutGet::waitGetPut()
<< " channelName " << pvaClientChannel->getChannel()->getChannelName()
<< endl;
}
if(putGetState==putGetComplete) return channelPutGetStatus;
if(putGetState!=putGetActive){
string message = string("channel ")
+ pvaClientChannel->getChannel()->getChannelName()
@@ -521,7 +506,6 @@ Status PvaClientPutGet::waitGetPut()
throw std::runtime_error(message);
}
waitForPutGet.wait();
putGetState = putGetComplete;
return channelPutGetStatus;
}
@@ -533,7 +517,10 @@ PvaClientGetDataPtr PvaClientPutGet::getGetData()
<< endl;
}
checkPutGetState();
if(putGetState==putGetIdle) getGet();
if(putGetState==putGetIdle){
getGet();
getPut();
}
return pvaClientGetData;
}
@@ -545,7 +532,10 @@ PvaClientPutDataPtr PvaClientPutGet::getPutData()
<< endl;
}
checkPutGetState();
if(putGetState==putGetIdle) getPut();
if(putGetState==putGetIdle){
getGet();
getPut();
}
return pvaClientPutData;
}