40 Commits

Author SHA1 Message Date
Marty Kraimer
fa7a44f5b3 update links in .html files 2013-09-10 16:53:21 -04:00
Andrew Johnson
fb0329c0b5 APS Jenkins adjustment 2013-09-05 12:24:38 -05:00
Andrew Johnson
c3d04fdd08 Fix VxWorks builds 2013-09-05 10:26:56 -05:00
Marty Kraimer
ebb0c97c51 Added tag 3.0.1 for changeset 2a289ff41e2e 2013-09-03 08:37:28 -04:00
Marty Kraimer
aabe0f3594 update links on .html files 2013-09-03 08:37:08 -04:00
dhickin
7c21bf7aa1 Added tag 3.0.0 for changeset 4cecd4b200f8 2013-08-21 12:03:42 +01:00
Marty Kraimer
b518efd196 Added tag 3.0-pre1 for changeset 4cecd4b200f8 2013-07-16 14:47:34 -04:00
Ralph Lange
5f8fa26bf3 jenkins: Fix CloudBees hgweb job 2013-06-19 18:11:04 +02:00
Ralph Lange
a5c835cfeb jenkins: add CloudBees hgweb job to sync repo to SF webspace 2013-06-19 10:59:29 +02:00
Andrew Johnson
d2a649f5fa Fixed compiler warning, 2013-06-12 21:21:44 -05:00
Matej Sekoranja
476f18332a valueAlarm for numeric scalar arrays support 2013-05-31 21:15:54 +02:00
Andrew Johnson
a964e3668d Added jenkins/aps_build script 2013-05-30 17:32:15 -05:00
Marty Kraimer
69be072a07 added test 2013-05-17 19:33:16 -04:00
Marty Kraimer
a2ca21a1a6 changes to queue and to bitSetUtil. 2013-05-16 09:04:42 -04:00
Matej Sekoranja
0dd6f01ef6 direct, i.e. no-copy, de/serialization support 2013-04-12 21:54:11 +02:00
Matej Sekoranja
cd95b75563 gcc 4.7+ compiler warnings removed 2013-02-27 11:44:00 +01:00
Ralph Lange
4122e772c1 merge SF changes 2013-02-26 17:22:16 +01:00
Ralph Lange
2fbe99909c documentation: update Doxyfile 2013-02-26 17:21:28 +01:00
Ralph Lange
d4f3d6209c jenkins: fix URLs for dependencies 2013-02-26 17:20:52 +01:00
Ralph Lange
641a51aa4f Fix .hgignore to use patterns 2013-02-26 17:20:28 +01:00
Matej Sekoranja
67afe84593 mb moved to pvCommonCPP 2013-02-25 10:29:34 +01:00
Matej Sekoranja
66f7c90c51 merge 2013-02-22 21:30:01 +01:00
Matej Sekoranja
959117c391 mb portability, still to be ported to boost atomic 2013-02-22 21:27:26 +01:00
5e810c704f Missing library reference in Makefile 2013-02-21 15:50:57 +01:00
Matej Sekoranja
675243061d -Wextra compiler warnings fixed 2013-02-16 12:50:36 +01:00
Matej Sekoranja
246825d672 base 3.14 fix 2013-02-13 14:29:38 +01:00
Matej Sekoranja
aa1a67d6c1 added micro-benchmark 2013-02-13 14:18:42 +01:00
Matej Sekoranja
97b1848ba3 added array_at manip test 2013-02-11 10:30:30 +01:00
Matej Sekoranja
c4f6132aca added simple operators 'test', added <<= >>= operators to PVScalar 2013-02-08 22:45:04 +01:00
Matej Sekoranja
a0de4f126f operator<< for all PVField, indent and array_at manipulator 2013-02-07 22:52:16 +01:00
Ralph Lange
a8a96def97 jenkins: Publish documentation to .../tip in CloudBees build 2013-01-18 15:19:37 +01:00
Ralph Lange
eaddc30def Add doxygen to Cloudbees build (as local dependency) 2013-01-14 12:22:15 +01:00
Ralph Lange
aa17639e20 Comment out doxygen (which does not work on CloudBees) 2013-01-13 18:32:09 +01:00
Ralph Lange
58d7ad494b Add doxygen run to jenkins build job 2013-01-13 18:20:43 +01:00
Ralph Lange
2895f48bd6 Add build script for Jenkins on Cloudbees 2013-01-13 18:11:55 +01:00
Ralph Lange
8f6ea47501 configure: improved generic RELEASE file 2013-01-11 19:12:50 +01:00
Marty Kraimer
3eb6237343 missing '.' in "This version" and "Previous version" 2012-12-12 15:25:18 -05:00
Marty Kraimer
cb19940fa7 I forget to do an hg add on documentation/pvDataCPP_20121212.html 2012-12-12 15:17:44 -05:00
Marty Kraimer
4bc7e9c8fe several minor problems found while developing pvDatabaseCPP 2012-12-12 14:59:33 -05:00
dhickin
18ba24156c Added tag 2.0-BETA for changeset d70c5ad29163 2012-11-22 15:23:15 +00:00
50 changed files with 9374 additions and 858 deletions

View File

@@ -1,9 +1,11 @@
QtC-pvData.creator.user
bin
lib
doc
include
documentation/html
./O.*
configure/RELEASE.local
configure/CONFIG_SITE.local
^QtC-
^bin/
^lib/
^doc/
^include/
^db/
^dbd/
^documentation/html
envPaths
configure/.*\.local
/O\..*

View File

@@ -4,3 +4,7 @@ d29d84f4c3f389f2accd497185b106c8541f95c9 1.1-SNAPSHOT
a29729ca0ecd60b66f2d997031d97911377e44a7 marchtest
9c59737f56e71aef641b70d0f72aa768fd7f8414 1.0.1-BETA
4559c3de0cb4e3420e26272817f58bab005063ec 1.1-BETA
d70c5ad29163306f50979a95b5aebbe9a93cfe76 2.0-BETA
4cecd4b200f88ab57bbb81978c45df2a67bbece1 3.0-pre1
4cecd4b200f88ab57bbb81978c45df2a67bbece1 3.0.0
2a289ff41e2ed3a0247877306c2db7b266f3b6b8 3.0.1

1694
Doxyfile

File diff suppressed because it is too large Load Diff

View File

@@ -1,27 +1,25 @@
#RELEASE Location of external products
# pvDataCPP RELEASE - Location of external support modules
#
# IF YOU MAKE ANY CHANGES to this file you MUST at least run
# "gnumake" in this directory afterwards; you usually need
# to run "gnumake rebuild" in the application's top level
# directory each time this file is changed.
# IF YOU CHANGE this file or any file it includes you must
# subsequently do a "gnumake rebuild" in the application's
# top level directory.
#
# NOTE: The build does not check dependencies against files
# that are outside this application, thus you should run
# "gnumake distclean install" in the top directory each time
# EPICS_BASE, SNCSEQ, or any other external module defined
# in the RELEASE file is rebuilt.
# 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/target specific settings can be specified in files named
# 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)
TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top
EPICS_BASE=/home/install/epics/base
# Create a file RELEASE.local containing the
# location of your EPICS_BASE, e.g.
# EPICS_BASE=/home/install/epics/base
# EPICS V4 Developers: Do not edit the locations in this file!
#
# Create a file RELEASE.local pointing to your EPICS_BASE
# and PVCOMMON build directories, e.g.
# EPICS_BASE = /home/install/epics/base
# PVCOMMON = /home/install/epicsV4/pvCommonCPP
-include $(TOP)/configure/RELEASE.local
-include $(TOP)/../RELEASE.local

View File

@@ -37,20 +37,20 @@
<h1>EPICS pvDataCPP</h1>
<!-- Maturity: Working Draft or Request for Comments, or Recommendation, and date. -->
<h2 class="nocount">EPICS v4 Working Group, Working Draft, 01-Oct-2012</h2>
<h2 class="nocount">EPICS v4 Working Group, Working Draft, 16-May-2013</h2>
<dl>
<dt>Latest version:</dt>
<dd><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP.html">pvDataCPP.html</a>
href="pvDataCPP.html">pvDataCPP.html</a>
</dd>
<dt>This version:</dt>
<dd><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP_20121026html">pvDataCPP_20121026html</a>
href="pvDataCPP_20130516.html">pvDataCPP_20130516.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP_20121001.html">pvDataCPP_20121001.html</a>
href="pvDataCPP_20121212.html">pvDataCPP_20121212.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>
@@ -67,37 +67,16 @@ license.</a></p>
<p>pvDataCPP is a computer software package for the efficient
storage, access, and communication, of structured data. It is specifically the
C++ implementation of pvData, which is one part of the set of related products in the EPICS
V4 control system programming environment:</p>
<dl>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP.html">pvData</a></dt>
<dd>pvData (Process Variable Data) defines and implements an efficent way
to store, access, and communicate memory resident structured data</dd>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvAccessCPP/raw-file/tip/documentation/pvAccessCPP.html">pvAccess</a></dt>
<dd>pvAccess is a software library for high speed controls network communications,
optimized for pvData</dd>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvIOCCPP/raw-file/tip/documentation/pvIOCCPP.html">pvIOC</a></dt>
<dd>pvIOC is a software framework for building network accessable "smart" real time
databases, suitable for interfacing devices in a distributed control system,
that can exchange pvData over pvAccess.
</dd>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvServiceCPP/raw-file/tip/documentation/pvAccessCPP.html">pvService</a></dt>
<dd>A middle layer for implementing efficient data services.</dd>
</dl>
V4 control system programming environment:<br />
<a href="http://epics-pvdata.sourceforge.net/relatedDocumentsV4.html">relatedDocumentsV4.html</a>
</p>
<p>Each of these products has a Java and a C++ implementation.</p>
<p>The products are all part of the <a
href="http://epics-pvdata.sourceforge.net/">V4</a> implementation of <a
href="http://www.aps.anl.gov/epics/">Experimental Physics and Industrial
Control System (EPICS).</a></p>
<h2 class="nocount">Status of this Document</h2>
<p>This is the 01-Oct-2012 version of the C++ implementation of pvData.</p>
<p>This is the 16-May-2013 version of the C++ implementation of pvData.
Since the last version changes were made to queue and to bitSetUtil.
</p>
<p> The text describes software which is a complete implementation of pvData as
currently planned by the EPICS V4 Working Group. </p> </p>
@@ -865,8 +844,7 @@ typedef std::tr1::shared_ptr&lt;PostHandler&gt; PostHandlerPtr</pre>
<p>PostHandler is a class that must be implemented by any code that calls
setPostHandler. It's single virtual method. postPut is called whenever
PVField::postPut is called.</p>
<pre>class PostHandler :
public std::tr1::enable_shared_from_this&lt;PostHandler&gt;
<pre>class PostHandler
{
public:
POINTER_DEFINITIONS(PostHandler);
@@ -3037,6 +3015,7 @@ public:
~Lock();
void lock();
void unlock();
bool tryLock();
bool ownsLock() ;
...
};</pre>
@@ -3179,9 +3158,9 @@ public:
int getNumberFree();
int getNumberUsed();
queueElementPtr &amp; getFree();
void setUsed(queueElementPtr &amp;element);
void setUsed(queueElementPtr const &amp;element);
queueElementPtr &amp; getUsed();
void releaseUsed(queueElementPtr &amp;element);
void releaseUsed(queueElementPtr const &amp;element);
...
};</pre>
@@ -3619,7 +3598,7 @@ be used to schedule multiple callbacks. It has the methods:</p>
<p>The following is also provided:</p>
<pre>class BitSetUtil : private NoDefaultMethods {
public:
static bool compress(BitSet *bitSet,PVStructure *pvStructure);
static bool compress(BitSet const &amp;bitSet,PVStructure const &amp;pvStructure);
};</pre>
<p>This provides functions that operate on a BitSet for a PVStructure. It

View File

@@ -42,11 +42,11 @@
<dl>
<dt>Latest version:</dt>
<dd><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP.html">pvDataCPP.html</a>
href="pvDataCPP.html">pvDataCPP.html</a>
</dd>
<dt>This version:</dt>
<dd><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP_20120927.html">pvDataCPP_20120927.html</a>
href="pvDataCPP_20120927.html">pvDataCPP_20120927.html</a>
</dd>
<dt>Previous version:</dt>
<dd>None.</dd>
@@ -65,33 +65,9 @@ license.</a></p>
<p>pvDataCPP is a computer software package for the efficient
storage, access, and communication, of structured data. It is specifically the
C++ implementation of pvData, which is one part of the set of related products in the EPICS
V4 control system programming environment:</p>
<dl>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP.html">pvData</a></dt>
<dd>pvData (Process Variable Data) defines and implements an efficent way
to store, access, and communicate memory resident structured data</dd>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvAccessCPP/raw-file/tip/documentation/pvAccessCPP.html">pvAccess</a></dt>
<dd>pvAccess is a software library for high speed controls network communications,
optimized for pvData</dd>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvIOCCPP/raw-file/tip/documentation/pvIOCCPP.html">pvIOC</a></dt>
<dd>pvIOC is a software framework for building network accessable "smart" real time
databases, suitable for interfacing devices in a distributed control system,
that can exchange pvData over pvAccess.
</dd>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvServiceCPP/raw-file/tip/documentation/pvAccessCPP.html">pvService</a></dt>
<dd>A middle layer for implementing efficient data services.</dd>
</dl>
<p>Each of these products has a Java and a C++ implementation.</p>
<p>The products are all part of the <a
href="http://epics-pvdata.sourceforge.net/">V4</a> implementation of <a
href="http://www.aps.anl.gov/epics/">Experimental Physics and Industrial
Control System (EPICS).</a></p>
V4 control system programming environment:<br />
<a href="http://epics-pvdata.sourceforge.net/relatedDocumentsV4.html">relatedDocumentsV4.html</a>
</p>
<h2 class="nocount">Status of this Document</h2>

View File

@@ -42,15 +42,15 @@
<dl>
<dt>Latest version:</dt>
<dd><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP.html">pvDataCPP.html</a>
href="pvDataCPP.html">pvDataCPP.html</a>
</dd>
<dt>This version:</dt>
<dd><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP_20121001.html">pvDataCPP_20121001.html</a>
href="pvDataCPP_20121001.html">pvDataCPP_20121001.html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP_20120927.html">pvDataCPP_20120927.html</a>
href="pvDataCPP_20120927.html">pvDataCPP_20120927.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>
@@ -67,33 +67,9 @@ license.</a></p>
<p>pvDataCPP is a computer software package for the efficient
storage, access, and communication, of structured data. It is specifically the
C++ implementation of pvData, which is one part of the set of related products in the EPICS
V4 control system programming environment:</p>
<dl>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP.html">pvData</a></dt>
<dd>pvData (Process Variable Data) defines and implements an efficent way
to store, access, and communicate memory resident structured data</dd>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvAccessCPP/raw-file/tip/documentation/pvAccessCPP.html">pvAccess</a></dt>
<dd>pvAccess is a software library for high speed controls network communications,
optimized for pvData</dd>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvIOCCPP/raw-file/tip/documentation/pvIOCCPP.html">pvIOC</a></dt>
<dd>pvIOC is a software framework for building network accessable "smart" real time
databases, suitable for interfacing devices in a distributed control system,
that can exchange pvData over pvAccess.
</dd>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvServiceCPP/raw-file/tip/documentation/pvAccessCPP.html">pvService</a></dt>
<dd>A middle layer for implementing efficient data services.</dd>
</dl>
<p>Each of these products has a Java and a C++ implementation.</p>
<p>The products are all part of the <a
href="http://epics-pvdata.sourceforge.net/">V4</a> implementation of <a
href="http://www.aps.anl.gov/epics/">Experimental Physics and Industrial
Control System (EPICS).</a></p>
V4 control system programming environment:<br />
<a href="http://epics-pvdata.sourceforge.net/relatedDocumentsV4.html">relatedDocumentsV4.html</a>
</p>
<h2 class="nocount">Status of this Document</h2>

View File

@@ -42,15 +42,15 @@
<dl>
<dt>Latest version:</dt>
<dd><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP.html">pvDataCPP.html</a>
href="pvDataCPP.html">pvDataCPP.html</a>
</dd>
<dt>This version:</dt>
<dd><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP_20121026html">pvDataCPP_20121026html</a>
href="pvDataCPP_20121026html">pvDataCPP_20121026html</a>
</dd>
<dt>Previous version:</dt>
<dd><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP_20121001.html">pvDataCPP_20121001.html</a>
href="pvDataCPP_20121001.html">pvDataCPP_20121001.html</a>
</dd>
<dt>Editors:</dt>
<dd>Marty Kraimer, BNL</dd>
@@ -67,33 +67,9 @@ license.</a></p>
<p>pvDataCPP is a computer software package for the efficient
storage, access, and communication, of structured data. It is specifically the
C++ implementation of pvData, which is one part of the set of related products in the EPICS
V4 control system programming environment:</p>
<dl>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvDataCPP/raw-file/tip/documentation/pvDataCPP.html">pvData</a></dt>
<dd>pvData (Process Variable Data) defines and implements an efficent way
to store, access, and communicate memory resident structured data</dd>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvAccessCPP/raw-file/tip/documentation/pvAccessCPP.html">pvAccess</a></dt>
<dd>pvAccess is a software library for high speed controls network communications,
optimized for pvData</dd>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvIOCCPP/raw-file/tip/documentation/pvIOCCPP.html">pvIOC</a></dt>
<dd>pvIOC is a software framework for building network accessable "smart" real time
databases, suitable for interfacing devices in a distributed control system,
that can exchange pvData over pvAccess.
</dd>
<dt><a
href="http://epics-pvdata.hg.sourceforge.net/hgweb/epics-pvdata/pvServiceCPP/raw-file/tip/documentation/pvAccessCPP.html">pvService</a></dt>
<dd>A middle layer for implementing efficient data services.</dd>
</dl>
<p>Each of these products has a Java and a C++ implementation.</p>
<p>The products are all part of the <a
href="http://epics-pvdata.sourceforge.net/">V4</a> implementation of <a
href="http://www.aps.anl.gov/epics/">Experimental Physics and Industrial
Control System (EPICS).</a></p>
V4 control system programming environment:<br />
<a href="http://epics-pvdata.sourceforge.net/relatedDocumentsV4.html">relatedDocumentsV4.html</a>
</p>
<h2 class="nocount">Status of this Document</h2>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

29
jenkins/aps_build Normal file
View File

@@ -0,0 +1,29 @@
# pvData C++ implementation
# Jenkins @ APS build script
#
# Jenkins invokes scripts with the "-ex" option. So the build is considered a failure
# if any of the commands exits with a non-zero exit code.
#
# Authors: Ralph Lange <Ralph.Lange@gmx.de> and Andrew Johnson <anj@aps.anl.gov>
# Copyright (C) 2013 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
# All rights reserved. Use is subject to license terms.
###########################################
# Build
export EPICS_BASE=${HOME}/jobs/epics-base-3.14/workspace
export EPICS_HOST_ARCH=$(${EPICS_BASE}/startup/EpicsHostArch)
cat > configure/RELEASE.local << EOF
PVCOMMON=${HOME}/jobs/epics-pvCommon/workspace
EPICS_BASE=${EPICS_BASE}
EOF
make
###########################################
# Test
for t in bin/linux-x86_64/test*; do
$t
done

57
jenkins/cloudbees_build Normal file
View File

@@ -0,0 +1,57 @@
# pvData C++ implementation
# Jenkins @ Cloudbees build script
#
# Jenkins invokes scripts with the "-ex" option. So the build is considered a failure
# if any of the commands exits with a non-zero exit code.
#
# Author: Ralph Lange <Ralph.Lange@gmx.de>
# Copyright (C) 2013 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
# All rights reserved. Use is subject to license terms.
###########################################
# Fetch and unpack dependencies
export STUFF=/tmp/stuff
rm -fr ${STUFF}
mkdir -p ${STUFF}
cd ${STUFF}
wget -nv https://openepics.ci.cloudbees.com/job/Base-3.14.12.3_Build/lastSuccessfulBuild/artifact/baseR3.14.12.3.CB-dist.tar.gz
wget -nv https://openepics.ci.cloudbees.com/job/Doxygen-1.8.3_Build/lastSuccessfulBuild/artifact/doxygen-1.8.3.CB-dist.tar.gz
tar -xzf baseR3.14.12.3.CB-dist.tar.gz
tar -xzf doxygen-1.8.3.CB-dist.tar.gz
###########################################
# Build
cd ${WORKSPACE}
export EPICS_BASE=${STUFF}
export EPICS_HOST_ARCH=$(${EPICS_BASE}/startup/EpicsHostArch)
export LD_LIBRARY_PATH=${EPICS_BASE}/lib/${EPICS_HOST_ARCH}
export PATH=${STUFF}/bin:${PATH}
cat > configure/RELEASE.local << EOF
EPICS_BASE=${EPICS_BASE}
EOF
make distclean all
doxygen
###########################################
# Test
for t in bin/linux-x86_64/test*; do
$t
done
###########################################
# Create distribution
tar czf pvData.CB-dist.tar.gz lib include COPYRIGHT LICENSE
###########################################
# Publish documentation
rsync -aP --delete -e ssh documentation epics-jenkins@web.sourceforge.net:/home/project-web/epics-pvdata/htdocs/docbuild/pvDataCPP/tip

20
jenkins/cloudbees_hgweb Normal file
View File

@@ -0,0 +1,20 @@
# pvData C++ implementation
# Jenkins @ Cloudbees hgweb sync script
#
# Jenkins invokes scripts with the "-ex" option. So the build is considered a failure
# if any of the commands exits with a non-zero exit code.
#
# Author: Ralph Lange <Ralph.Lange@gmx.de>
# Copyright (C) 2013 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
# All rights reserved. Use is subject to license terms.
###########################################
# Fetch complete repo
rm -fr hgweb
hg clone -U http://hg.code.sf.net/p/epics-pvdata/pvDataCPP hgweb
###########################################
# Sync into SF webspace
rsync -aqP --delete --exclude=\.hg/hgrc -e ssh hgweb/.hg epics-jenkins@web.sourceforge.net:/home/project-web/epics-pvdata/repos/pvDataCPP

View File

@@ -92,9 +92,7 @@ LIBSRCS += bitSetUtil.cpp
SRC_DIRS += $(PVDATA)/monitor
INC += monitor.h
LIBRARY=pvData
LIBRARY = pvData
pvData_LIBS += Com
include $(TOP)/configure/RULES

View File

@@ -2721,7 +2721,7 @@ void convertStructure(StringBuilder buffer,PVStructure const *data,int indentLev
}
}
void convertArray(StringBuilder buffer,PVScalarArray const * xxx,int indentLevel)
void convertArray(StringBuilder buffer,PVScalarArray const * xxx,int /*indentLevel*/)
{
PVScalarArray *pv = const_cast<PVScalarArray *>(xxx);
ScalarArrayConstPtr array = pv->getScalarArray();

View File

@@ -39,7 +39,7 @@ Field::~Field() {
}
void Field::toString(StringBuilder buffer,int indentLevel) const{
void Field::toString(StringBuilder /*buffer*/,int /*indentLevel*/) const{
}
@@ -54,7 +54,7 @@ struct ScalarArrayHashFunction {
};
struct StructureHashFunction {
size_t operator() (const Structure& structure) const { return 0; }
size_t operator() (const Structure& /*structure*/) const { return 0; }
// TODO
// final int PRIME = 31;
// return PRIME * Arrays.hashCode(fieldNames) + Arrays.hashCode(fields);
@@ -70,7 +70,7 @@ Scalar::Scalar(ScalarType scalarType)
Scalar::~Scalar(){}
void Scalar::toString(StringBuilder buffer,int indentLevel) const{
void Scalar::toString(StringBuilder buffer,int /*indentLevel*/) const{
*buffer += getID();
}
@@ -94,7 +94,7 @@ String Scalar::getID() const
return idScalarLUT[scalarType];
}
const int8 Scalar::getTypeCodeLUT() const
int8 Scalar::getTypeCodeLUT() const
{
static const int8 typeCodeLUT[] = {
0x00, // pvBoolean
@@ -119,7 +119,7 @@ void Scalar::serialize(ByteBuffer *buffer, SerializableControl *control) const {
buffer->putByte(getTypeCodeLUT());
}
void Scalar::deserialize(ByteBuffer *buffer, DeserializableControl *control) {
void Scalar::deserialize(ByteBuffer */*buffer*/, DeserializableControl */*control*/) {
// must be done via FieldCreate
throw std::runtime_error("not valid operation, use FieldCreate::deserialize instead");
}
@@ -170,7 +170,7 @@ ScalarArray::ScalarArray(ScalarType elementType)
ScalarArray::~ScalarArray() {}
const int8 ScalarArray::getTypeCodeLUT() const
int8 ScalarArray::getTypeCodeLUT() const
{
static const int8 typeCodeLUT[] = {
0x00, // pvBoolean
@@ -213,7 +213,7 @@ String ScalarArray::getID() const
return getIDScalarArrayLUT();
}
void ScalarArray::toString(StringBuilder buffer,int indentLevel) const{
void ScalarArray::toString(StringBuilder buffer,int /*indentLevel*/) const{
*buffer += getID();
}
@@ -222,7 +222,7 @@ void ScalarArray::serialize(ByteBuffer *buffer, SerializableControl *control) co
buffer->putByte(0x10 | getTypeCodeLUT());
}
void ScalarArray::deserialize(ByteBuffer *buffer, DeserializableControl *control) {
void ScalarArray::deserialize(ByteBuffer */*buffer*/, DeserializableControl */*control*/) {
throw std::runtime_error("not valid operation, use FieldCreate::deserialize instead");
}
@@ -252,7 +252,7 @@ void StructureArray::serialize(ByteBuffer *buffer, SerializableControl *control)
control->cachedSerialize(pstructure, buffer);
}
void StructureArray::deserialize(ByteBuffer *buffer, DeserializableControl *control) {
void StructureArray::deserialize(ByteBuffer */*buffer*/, DeserializableControl */*control*/) {
throw std::runtime_error("not valid operation, use FieldCreate::deserialize instead");
}
@@ -357,7 +357,7 @@ void Structure::serialize(ByteBuffer *buffer, SerializableControl *control) cons
serializeStructureField(this, buffer, control);
}
void Structure::deserialize(ByteBuffer *buffer, DeserializableControl *control) {
void Structure::deserialize(ByteBuffer */*buffer*/, DeserializableControl */*control*/) {
throw std::runtime_error("not valid operation, use FieldCreate::deserialize instead");
}

View File

@@ -97,4 +97,9 @@ PVArray::~PVArray()
pImpl->capacity = capacity;
}
std::ostream& operator<<(format::array_at_internal const& manip, const PVArray& array)
{
return array.dumpValue(manip.stream, manip.index);
}
}}

View File

@@ -62,7 +62,11 @@ template<typename T>
T BasePVScalar<T>::get() const { return value;}
template<typename T>
void BasePVScalar<T>::put(T val){value = val;}
void BasePVScalar<T>::put(T val)
{
value = val;
PVField::postPut();
}
template<typename T>
void BasePVScalar<T>::serialize(ByteBuffer *pbuffer,
@@ -120,7 +124,11 @@ BasePVString::~BasePVString() {}
String BasePVString::get() const { return value;}
void BasePVString::put(String val){value = val;}
void BasePVString::put(String val)
{
value = val;
postPut();
}
void BasePVString::serialize(ByteBuffer *pbuffer,
SerializableControl *pflusher) const
@@ -139,9 +147,9 @@ void BasePVString::serialize(ByteBuffer *pbuffer,
{
// check bounds
const size_t length = /*(value == null) ? 0 :*/ value.length();
if (offset < 0) offset = 0;
else if (offset > length) offset = length;
if (count < 0) count = length;
/*if (offset < 0) offset = 0;
else*/ if (offset > length) offset = length;
//if (count < 0) count = length;
const size_t maxCount = length - offset;
if (count > maxCount)
@@ -263,7 +271,7 @@ size_t DefaultPVArray<T>::get(size_t offset, size_t len, PVArrayData<T> &data)
size_t length = this->getLength();
if(offset+len > length) {
n = length-offset;
if(n<0) n = 0;
//if(n<0) n = 0;
}
data.data = *value.get();
data.offset = offset;
@@ -323,14 +331,26 @@ template<typename T>
void DefaultPVArray<T>::deserialize(ByteBuffer *pbuffer,
DeserializableControl *pcontrol) {
size_t size = SerializeHelper::readSize(pbuffer, pcontrol);
// if (size>0) { pcontrol->ensureData(sizeof(T)-1); pbuffer->align(sizeof(T)); }
if(size>=0) {
// alignment if (size>0) { pcontrol->ensureData(sizeof(T)-1); pbuffer->align(sizeof(T)); }
//if(size>=0) {
// prepare array, if necessary
if(size>this->getCapacity()) this->setCapacity(size);
// set new length
this->setLength(size);
// try to avoid deserializing from the buffer
// this is only possible if we do not need to do endian-swapping
if (!pbuffer->reverse<T>())
if (pcontrol->directDeserialize(pbuffer, (char*)(get()), size, sizeof(T)))
{
// inform about the change?
PVField::postPut();
return;
}
// retrieve value from the buffer
size_t i = 0;
T * pvalue = get();
while(true) {
/*
size_t maxIndex = min(size-i, (int)(pbuffer->getRemaining()/sizeof(T)))+i;
@@ -338,7 +358,7 @@ void DefaultPVArray<T>::deserialize(ByteBuffer *pbuffer,
value[i] = pbuffer->get<T>();
*/
size_t maxCount = min(size-i, (pbuffer->getRemaining()/sizeof(T)));
pbuffer->getArray(get()+i, maxCount);
pbuffer->getArray(pvalue+i, maxCount);
i += maxCount;
if(i<size)
@@ -348,7 +368,7 @@ void DefaultPVArray<T>::deserialize(ByteBuffer *pbuffer,
}
// inform about the change?
PVField::postPut();
}
//}
// TODO null arrays (size == -1) not supported
}
@@ -359,10 +379,10 @@ void DefaultPVArray<T>::serialize(ByteBuffer *pbuffer,
size_t length = this->getLength();
// check bounds
if(offset<0)
/*if(offset<0)
offset = 0;
else if(offset>length) offset = length;
if(count<0) count = length;
else*/ if(offset>length) offset = length;
//if(count<0) count = length;
size_t maxCount = length-offset;
if(count>maxCount) count = maxCount;
@@ -370,8 +390,17 @@ void DefaultPVArray<T>::serialize(ByteBuffer *pbuffer,
// write
SerializeHelper::writeSize(count, pbuffer, pflusher);
//if (count == 0) return; pcontrol->ensureData(sizeof(T)-1); pbuffer->align(sizeof(T));
// try to avoid copying into the buffer
// this is only possible if we do not need to do endian-swapping
if (!pbuffer->reverse<T>())
if (pflusher->directSerialize(pbuffer, (const char*)(get()+offset), count, sizeof(T)))
return;
size_t end = offset+count;
size_t i = offset;
T * pvalue = const_cast<T *>(get());
while(true) {
/*
@@ -381,7 +410,6 @@ void DefaultPVArray<T>::serialize(ByteBuffer *pbuffer,
*/
size_t maxCount = min<int>(end-i, (int)(pbuffer->getRemaining()/sizeof(T)));
T * pvalue = const_cast<T *>(get());
pbuffer->putArray(pvalue+i, maxCount);
i += maxCount;
@@ -398,7 +426,7 @@ template<>
void DefaultPVArray<String>::deserialize(ByteBuffer *pbuffer,
DeserializableControl *pcontrol) {
size_t size = SerializeHelper::readSize(pbuffer, pcontrol);
if(size>=0) {
//if(size>=0) {
// prepare array, if necessary
if(size>getCapacity()) setCapacity(size);
// set new length
@@ -411,7 +439,7 @@ void DefaultPVArray<String>::deserialize(ByteBuffer *pbuffer,
}
// inform about the change?
postPut();
}
//}
// TODO null arrays (size == -1) not supported
}
@@ -421,10 +449,10 @@ void DefaultPVArray<String>::serialize(ByteBuffer *pbuffer,
size_t length = getLength();
// check bounds
if(offset<0)
/*if(offset<0)
offset = 0;
else if(offset>length) offset = length;
if(count<0) count = length;
else*/ if(offset>length) offset = length;
//if(count<0) count = length;
size_t maxCount = length-offset;
if(count>maxCount) count = maxCount;

View File

@@ -158,7 +158,7 @@ void PVField::renameField(String const & newName)
void PVField::postPut()
{
if(postHandler!=NULL) postHandler->postPut();
if(postHandler.get()!=NULL) postHandler->postPut();
}
void PVField::setPostHandler(PostHandlerPtr const &handler)
@@ -194,17 +194,34 @@ void PVField::toString(StringBuilder buf,int indentLevel)
if(pvAuxInfo.get()!=NULL) pvAuxInfo->toString(buf,indentLevel);
}
std::ostream& PVField::dumpValue(std::ostream& o) const
std::ostream& operator<<(std::ostream& o, const PVField& f)
{
// default implementation
// each PVField class should implement it to avoid switch statement
// and string reallocation
String tmp;
convert->getString(&tmp,this,0);
return o << tmp;
}
std::ostream& ro = f.dumpValue(o);
// TODO I do not want to call getPVAuxInfo() since it lazily creates a new instance of it
//if (f.pvAuxInfo.get()!=NULL) ro << *(f.pvAuxInfo.get());
return ro;
};
std::ostream& operator<<(std::ostream& o, const PVField& f) { return f.dumpValue(o); };
namespace format
{
std::ostream& operator<<(std::ostream& os, indent_level const& indent)
{
indent_value(os) = indent.level;
return os;
}
std::ostream& operator<<(std::ostream& os, indent const&)
{
long il = indent_value(os);
std::size_t spaces = static_cast<std::size_t>(il) * 4;
return os << std::string(spaces, ' ');
}
array_at_internal operator<<(std::ostream& str, array_at const& manip)
{
return array_at_internal(manip.index, str);
}
};
void PVField::computeOffset(const PVField * pvField) {
const PVStructure * pvTop = pvField->getParent();

View File

@@ -702,4 +702,31 @@ static PVFieldPtr findSubField(
return PVFieldPtr();
}
std::ostream& PVStructure::dumpValue(std::ostream& o) const
{
o << format::indent() << getStructure()->getID() << ' ' << getFieldName();
String extendsName = getExtendsStructureName();
if(extendsName.length()>0) {
o << " extends " << extendsName;
}
o << std::endl;
{
format::indent_scope s(o);
PVFieldPtrArray const & fieldsData = getPVFields();
if (fieldsData.size() != 0) {
size_t length = getStructure()->getNumberFields();
for(size_t i=0; i<length; i++) {
PVFieldPtr fieldField = fieldsData[i];
Type type = fieldField->getField()->getType();
if (type == scalar || type == scalarArray)
o << format::indent() << fieldField->getField()->getID() << ' ' << fieldField->getFieldName() << ' ' << *(fieldField.get()) << std::endl;
else
o << *(fieldField.get());
}
}
}
return o;
}
}}

View File

@@ -133,7 +133,7 @@ size_t PVStructureArray::get(
size_t length = getLength();
if(offset+len > length) {
n = length - offset;
if(n<0) n = 0;
//if(n<0) n = 0;
}
data.data = *value.get();
data.offset = offset;
@@ -197,7 +197,7 @@ void PVStructureArray::serialize(ByteBuffer *pbuffer,
void PVStructureArray::deserialize(ByteBuffer *pbuffer,
DeserializableControl *pcontrol) {
size_t size = SerializeHelper::readSize(pbuffer, pcontrol);
if(size>=0) {
//if(size>=0) {
// prepare array, if necessary
if(size>getCapacity()) setCapacity(size);
setLength(size);
@@ -217,7 +217,7 @@ void PVStructureArray::deserialize(ByteBuffer *pbuffer,
}
}
postPut();
}
//}
}
void PVStructureArray::serialize(ByteBuffer *pbuffer,
@@ -226,10 +226,10 @@ void PVStructureArray::serialize(ByteBuffer *pbuffer,
size_t length = getLength();
// check bounds
if(offset<0)
/*if(offset<0)
offset = 0;
else if(offset>length) offset = length;
if(count<0) count = length;
else*/ if(offset>length) offset = length;
//if(count<0) count = length;
size_t maxCount = length-offset;
if(count>maxCount) count = maxCount;
@@ -250,4 +250,27 @@ void PVStructureArray::serialize(ByteBuffer *pbuffer,
}
}
std::ostream& PVStructureArray::dumpValue(std::ostream& o) const
{
o << format::indent() << getStructureArray()->getID() << ' ' << getFieldName() << std::endl;
size_t length = getLength();
if (length > 0)
{
format::indent_scope s(o);
for (size_t i = 0; i < length; i++)
dumpValue(o, i);
}
return o;
}
std::ostream& PVStructureArray::dumpValue(std::ostream& o, std::size_t index) const
{
PVStructurePtrArray pvArray = *value.get();
PVStructurePtr pvStructure = pvArray[index];
return o << *(pvStructure.get());
return o;
}
}}

View File

@@ -65,9 +65,10 @@ StructureConstPtr StandardField::createProperties(String id,FieldConstPtr field,
StructureConstPtr valueAlarm;
Type type= field->getType();
while(gotValueAlarm) {
if(type==epics::pvData::scalar) {
ScalarConstPtr scalar = static_pointer_cast<const Scalar>(field);
ScalarType scalarType = scalar->getScalarType();
if(type==epics::pvData::scalar || type==epics::pvData::scalarArray) {
ScalarType scalarType = (type==epics::pvData::scalar) ?
static_pointer_cast<const Scalar>(field)->getScalarType() :
static_pointer_cast<const ScalarArray>(field)->getElementType();
switch(scalarType) {
case pvBoolean: valueAlarm = booleanAlarmField; break;
case pvByte: valueAlarm = byteAlarmField; break;

View File

@@ -331,7 +331,7 @@ namespace epics { namespace pvData {
return !(*this == set);
}
void BitSet::toString(StringBuilder buffer, int indentLevel) const
void BitSet::toString(StringBuilder buffer, int /*indentLevel*/) const
{
*buffer += '{';
int32 i = nextSetBit(0);

View File

@@ -608,6 +608,24 @@ private:
bool _reverseFloatEndianess;
};
template<>
inline bool ByteBuffer::reverse<bool>()
{
return false;
}
template<>
inline bool ByteBuffer::reverse<int8>()
{
return false;
}
template<>
inline bool ByteBuffer::reverse<uint8>()
{
return false;
}
template<>
inline bool ByteBuffer::reverse<float>()
{

View File

@@ -44,6 +44,15 @@ public:
locked=false;
}
}
bool tryLock()
{
if(locked) return true;
if(mutexPtr.tryLock()) {
locked = true;
return true;
}
return false;
}
bool ownsLock() const{return locked;}
private:
Mutex &mutexPtr;

View File

@@ -29,9 +29,9 @@ public:
int getNumberFree();
int getNumberUsed();
queueElementPtr & getFree();
void setUsed(queueElementPtr &element);
void setUsed(queueElementPtr const &element);
queueElementPtr & getUsed();
void releaseUsed(queueElementPtr &element);
void releaseUsed(queueElementPtr const &element);
private:
queueElementPtr nullElement;
queueElementPtrArray elements;
@@ -92,7 +92,7 @@ std::tr1::shared_ptr<T> & Queue<T>::getFree()
}
template <typename T>
void Queue<T>::setUsed(std::tr1::shared_ptr<T> &element)
void Queue<T>::setUsed(std::tr1::shared_ptr<T> const &element)
{
if(element!=elements[nextSetUsed++]) {
throw std::logic_error("not correct queueElement");
@@ -112,7 +112,7 @@ std::tr1::shared_ptr<T> & Queue<T>::getUsed()
}
template <typename T>
void Queue<T>::releaseUsed(std::tr1::shared_ptr<T> &element)
void Queue<T>::releaseUsed(std::tr1::shared_ptr<T> const &element)
{
if(element!=elements[nextReleaseUsed++]) {
throw std::logic_error(

View File

@@ -27,6 +27,8 @@ namespace epics { namespace pvData {
virtual void flushSerializeBuffer() =0;
virtual void ensureBuffer(std::size_t size) =0;
virtual void alignBuffer(std::size_t alignment) =0;
virtual bool directSerialize(ByteBuffer *existingBuffer, const char* toSerialize,
std::size_t elementCount, std::size_t elementSize) = 0;
virtual void cachedSerialize(std::tr1::shared_ptr<const Field> const & field, ByteBuffer* buffer) = 0;
};
@@ -35,6 +37,8 @@ namespace epics { namespace pvData {
virtual ~DeserializableControl(){}
virtual void ensureData(std::size_t size) =0;
virtual void alignData(std::size_t alignment) =0;
virtual bool directDeserialize(ByteBuffer *existingBuffer, char* deserializeTo,
std::size_t elementCount, std::size_t elementSize) = 0;
virtual std::tr1::shared_ptr<const Field> cachedDeserialize(ByteBuffer* buffer) = 0;
};

View File

@@ -77,14 +77,14 @@ namespace epics {
void SerializeHelper::serializeSubstring(const String& value,
std::size_t offset, std::size_t count, ByteBuffer* buffer,
SerializableControl* flusher) {
if(offset<0)
/*if(offset<0)
offset = 0;
else if(offset>(std::size_t)value.length()) offset = value.length();
else*/ if(offset>value.length()) offset = value.length();
if(offset+count>(std::size_t)value.length()) count = value.length()-offset;
if(offset+count>value.length()) count = value.length()-offset;
SerializeHelper::writeSize(count, buffer, flusher);
if (count<=0) return;
/*if (count<=0)*/ return;
std::size_t i = 0;
while(true) {
std::size_t maxToWrite = min(count-i, buffer->getRemaining());

View File

@@ -117,7 +117,7 @@ String Status::toString() const
return str;
}
void Status::toString(StringBuilder buffer, int indentLevel) const
void Status::toString(StringBuilder buffer, int /*indentLevel*/) const
{
*buffer += "Status [type=";
*buffer += StatusTypeName[m_statusType];

View File

@@ -14,10 +14,79 @@
#include <stdexcept>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <iomanip>
#include <pv/pvIntrospect.h>
#include <pv/requester.h>
#if defined(__vxworks) && !defined(_WRS_VXWORKS_MAJOR)
typedef class std::ios std::ios_base;
#endif
namespace epics { namespace pvData {
namespace format {
struct indent_level
{
long level;
indent_level(long l) : level(l) {}
};
inline long& indent_value(std::ios_base& ios)
{
static int indent_index = std::ios_base::xalloc();
return ios.iword(indent_index);
}
std::ostream& operator<<(std::ostream& os, indent_level const& indent);
struct indent_scope
{
long saved_level;
std::ios_base& stream;
indent_scope(std::ios_base& ios) :
stream(ios)
{
long& l = indent_value(ios);
saved_level = l;
l = saved_level + 1;
}
~indent_scope()
{
indent_value(stream) = saved_level;
}
};
struct indent
{
};
std::ostream& operator<<(std::ostream& os, indent const&);
struct array_at
{
std::size_t index;
array_at(std::size_t ix) : index(ix) {}
};
struct array_at_internal
{
std::size_t index;
std::ostream& stream;
array_at_internal(std::size_t ix, std::ostream& str) : index(ix), stream(str) {}
};
array_at_internal operator<<(std::ostream& str, array_at const& manip);
};
class PVAuxInfo;
class PostHandler;
@@ -75,6 +144,8 @@ typedef std::vector<PVStructurePtr>::const_iterator PVStructurePtrArray_const__i
* typedef for a pointer to a PVStructureArray.
*/
typedef std::tr1::shared_ptr<PVStructureArray> PVStructureArrayPtr;
typedef std::vector<PVStructureArrayPtr> PVStructureArrayPtrArray;
typedef std::tr1::shared_ptr<PVStructureArrayPtrArray> PVStructureArrayPtrArrayPtr;
/**
* This class provides auxillary information about a PVField.
@@ -140,8 +211,7 @@ private:
/**
* This class is implemented by code that calls setPostHander
*/
class PostHandler :
public std::tr1::enable_shared_from_this<PostHandler>
class PostHandler
{
public:
POINTER_DEFINITIONS(PostHandler);
@@ -276,7 +346,7 @@ public:
* @param o output stream.
* @return The output stream.
*/
virtual std::ostream& dumpValue(std::ostream& o) const;
virtual std::ostream& dumpValue(std::ostream& o) const = 0;
protected:
PVField::shared_pointer getPtrSelf()
@@ -358,6 +428,20 @@ public:
return o << get();
}
// get operator
// double value; doubleField >>= value;
void operator>>=(T& value) const
{
value = get();
}
// put operator
// double value = 12.8; doubleField <<= value;
void operator<<=(T value)
{
put(value);
}
protected:
PVScalarValue(ScalarConstPtr const & scalar)
: PVScalar(scalar) {}
@@ -452,6 +536,9 @@ public:
* @param The capacity.
*/
virtual void setCapacity(std::size_t capacity) = 0;
virtual std::ostream& dumpValue(std::ostream& o, std::size_t index) const = 0;
protected:
PVArray(FieldConstPtr const & field);
void setCapacityLength(std::size_t capacity,std::size_t length);
@@ -460,6 +547,8 @@ private:
friend class PVDataCreate;
};
std::ostream& operator<<(format::array_at_internal const& manip, const PVArray& array);
/**
* Class provided by caller of get
*/
@@ -504,8 +593,6 @@ public:
*/
const ScalarArrayConstPtr getScalarArray() const ;
virtual std::ostream& dumpValue(std::ostream& o, size_t index) const = 0;
protected:
PVScalarArray(ScalarArrayConstPtr const & scalarArray);
private:
@@ -607,6 +694,10 @@ public:
virtual pointer get() const { return &((*value.get())[0]); }
virtual vector const & getVector() {return *value;}
virtual shared_vector const & getSharedVector() {return value;}
virtual std::ostream& dumpValue(std::ostream& o) const;
virtual std::ostream& dumpValue(std::ostream& o, std::size_t index) const;
protected:
PVStructureArray(StructureArrayConstPtr const & structureArray);
private:
@@ -815,6 +906,9 @@ public:
* @param pvFields The array of fields for the structure.
*/
PVStructure(StructureConstPtr const & structure,PVFieldPtrArray const & pvFields);
virtual std::ostream& dumpValue(std::ostream& o) const;
private:
void fixParentStructure();
static PVFieldPtr nullPVField;
@@ -895,7 +989,7 @@ public:
std::ostream& dumpValue(std::ostream& o) const
{
o << "[";
o << '[';
std::size_t len = getLength();
bool first = true;
for (std::size_t i = 0; i < len; i++)
@@ -903,10 +997,10 @@ public:
if (first)
first = false;
else
o << ",";
o << ',';
dumpValue(o, i);
}
return o << "]";
return o << ']';
}
std::ostream& dumpValue(std::ostream& o, size_t index) const

View File

@@ -283,7 +283,7 @@ public:
protected:
Scalar(ScalarType scalarType);
private:
const int8 getTypeCodeLUT() const;
int8 getTypeCodeLUT() const;
ScalarType scalarType;
friend class FieldCreate;
};
@@ -330,7 +330,7 @@ protected:
*/
virtual ~ScalarArray();
private:
const int8 getTypeCodeLUT() const;
int8 getTypeCodeLUT() const;
const String getIDScalarArrayLUT() const;
ScalarType elementType;
friend class FieldCreate;

View File

@@ -17,7 +17,8 @@
#include <string>
#include <vector>
#ifdef __vxworks
#if defined(__vxworks) && \
(_WRS_VXWORKS_MAJOR+0 <= 6) && (_WRS_VXWORKS_MINOR+0 < 9)
typedef int intptr_t;
typedef unsigned int uintptr_t;
#define INT64_MAX (0x7fffffffffffffffLL)

View File

@@ -13,25 +13,31 @@
namespace epics { namespace pvData {
using std::tr1::static_pointer_cast;
using std::size_t;
static bool checkBitSetPVField(
PVField *pvField,BitSet *bitSet,int32 initialOffset)
PVFieldPtr const &pvField,BitSetPtr const &bitSet,int32 initialOffset)
{
bool atLeastOneBitSet = false;
bool allBitsSet = true;
int32 offset = initialOffset;
int32 nbits = pvField->getNumberFields();
if(nbits==1) return bitSet->get(offset);
int32 nextSetBit = bitSet->nextSetBit(offset);
if(nextSetBit>=(offset+nbits)) return false;
if(nextSetBit<0) return false;
if(bitSet->get(offset)) {
if(nbits>1) {
for(int32 i=offset+1; i<offset+nbits; i++) bitSet->clear(i);
}
return true;
}
PVStructure *pvStructure = static_cast<PVStructure *>(pvField);
bool atLeastOneBitSet = false;
bool allBitsSet = true;
PVStructurePtr pvStructure = static_pointer_cast<PVStructure>(pvField);
offset = pvStructure->getFieldOffset() + 1;
while(offset<initialOffset + nbits) {
PVField *pvSubField = pvStructure->getSubField(offset).get();
PVFieldPtr pvSubField = pvStructure->getSubField(offset);
int32 nbitsNow = pvSubField->getNumberFields();
if(nbitsNow==1) {
if(bitSet->get(offset)) {
@@ -41,24 +47,16 @@ static bool checkBitSetPVField(
}
offset++;
} else {
offset++;
PVStructure *pvSubStructure = static_cast<PVStructure*>(pvField);
PVFieldPtrArray pvSubStructureFields =
pvSubStructure->getPVFields();
int num = pvSubStructure->getStructure()->getNumberFields();
for(int32 i=0; i<num; i++) {
PVField *pvSubSubField = pvSubStructureFields[i].get();
bool result = checkBitSetPVField(pvSubSubField,bitSet,offset);
if(result) {
atLeastOneBitSet = true;
if(!bitSet->get(offset)) {
allBitsSet = false;
}
} else {
bool result = checkBitSetPVField(pvSubField,bitSet,offset);
if(result) {
atLeastOneBitSet = true;
if(!bitSet->get(offset)) {
allBitsSet = false;
}
offset += pvSubSubField->getNumberFields();
} else {
allBitsSet = false;
}
offset += pvSubField->getNumberFields();
}
}
if(allBitsSet) {
@@ -72,7 +70,7 @@ static bool checkBitSetPVField(
return atLeastOneBitSet;
}
bool BitSetUtil::compress(BitSet *bitSet,PVStructure *pvStructure)
bool BitSetUtil::compress(BitSetPtr const &bitSet,PVStructurePtr const &pvStructure)
{
return checkBitSetPVField(pvStructure,bitSet,0);
}

View File

@@ -17,7 +17,7 @@ namespace epics { namespace pvData {
class BitSetUtil : private NoDefaultMethods {
public:
static bool compress(BitSet *bitSet,PVStructure *pvStructure);
static bool compress(BitSetPtr const &bitSet,PVStructurePtr const &pvStructure);
};
}}

1
pvDataCPP.config Normal file
View File

@@ -0,0 +1 @@
// ADD PREDEFINED MACROS HERE!

1
pvDataCPP.creator Normal file
View File

@@ -0,0 +1 @@
[General]

211
pvDataCPP.files Normal file
View File

@@ -0,0 +1,211 @@
configure/CONFIG
configure/CONFIG_SITE
configure/RELEASE
configure/RELEASE.local
configure/RULES
configure/RULES.ioc
configure/RULES_DIRS
configure/RULES_TOP
documentation/pvDataCPP.html
documentation/pvDataCPP_20120927.html
documentation/pvDataCPP_20121001.html
documentation/pvDataCPP_20121026.html
documentation/pvDataCPP_20121212.html
jenkins/cloudbees_build
pvDataApp/factory/Compare.cpp
pvDataApp/factory/Convert.cpp
pvDataApp/factory/factory.h
pvDataApp/factory/FieldCreateFactory.cpp
pvDataApp/factory/PVArray.cpp
pvDataApp/factory/PVAuxInfoImpl.cpp
pvDataApp/factory/PVDataCreateFactory.cpp
pvDataApp/factory/PVDataCreateFactory.cpp.orig
pvDataApp/factory/PVField.cpp
pvDataApp/factory/PVScalar.cpp
pvDataApp/factory/PVScalarArray.cpp
pvDataApp/factory/PVStructure.cpp
pvDataApp/factory/PVStructureArray.cpp
pvDataApp/factory/StandardField.cpp
pvDataApp/factory/StandardPVField.cpp
pvDataApp/factory/TypeFunc.cpp
pvDataApp/misc/bitSet.cpp
pvDataApp/misc/bitSet.h
pvDataApp/misc/byteBuffer.cpp
pvDataApp/misc/byteBuffer.h
pvDataApp/misc/destroyable.h
pvDataApp/misc/epicsException.cpp
pvDataApp/misc/epicsException.h
pvDataApp/misc/event.cpp
pvDataApp/misc/event.h
pvDataApp/misc/executor.cpp
pvDataApp/misc/executor.h
pvDataApp/misc/localStaticLock.cpp
pvDataApp/misc/localStaticLock.h
pvDataApp/misc/localStaticLock.h.orig
pvDataApp/misc/lock.h
pvDataApp/misc/messageQueue.cpp
pvDataApp/misc/messageQueue.h
pvDataApp/misc/noDefaultMethods.h
pvDataApp/misc/queue.h
pvDataApp/misc/requester.cpp
pvDataApp/misc/requester.h
pvDataApp/misc/requester.h.orig
pvDataApp/misc/serialize.h
pvDataApp/misc/serializeHelper.cpp
pvDataApp/misc/serializeHelper.h
pvDataApp/misc/sharedPtr.h
pvDataApp/misc/status.cpp
pvDataApp/misc/status.h
pvDataApp/misc/thread.h
pvDataApp/misc/timeFunction.cpp
pvDataApp/misc/timeFunction.h
pvDataApp/misc/timer.cpp
pvDataApp/misc/timer.h
pvDataApp/monitor/monitor.h
pvDataApp/O.linux-x86_64/alarm.d
pvDataApp/O.linux-x86_64/bitSet.d
pvDataApp/O.linux-x86_64/bitSetUtil.d
pvDataApp/O.linux-x86_64/byteBuffer.d
pvDataApp/O.linux-x86_64/Compare.d
pvDataApp/O.linux-x86_64/Convert.d
pvDataApp/O.linux-x86_64/epicsException.d
pvDataApp/O.linux-x86_64/event.d
pvDataApp/O.linux-x86_64/executor.d
pvDataApp/O.linux-x86_64/FieldCreateFactory.d
pvDataApp/O.linux-x86_64/libpvData.a
pvDataApp/O.linux-x86_64/libpvData.so
pvDataApp/O.linux-x86_64/localStaticLock.d
pvDataApp/O.linux-x86_64/messageQueue.d
pvDataApp/O.linux-x86_64/pvAlarm.d
pvDataApp/O.linux-x86_64/PVArray.d
pvDataApp/O.linux-x86_64/PVAuxInfoImpl.d
pvDataApp/O.linux-x86_64/pvControl.d
pvDataApp/O.linux-x86_64/PVDataCreateFactory.d
pvDataApp/O.linux-x86_64/pvDisplay.d
pvDataApp/O.linux-x86_64/pvEnumerated.d
pvDataApp/O.linux-x86_64/PVField.d
pvDataApp/O.linux-x86_64/PVScalar.d
pvDataApp/O.linux-x86_64/PVScalarArray.d
pvDataApp/O.linux-x86_64/PVStructure.d
pvDataApp/O.linux-x86_64/PVStructureArray.d
pvDataApp/O.linux-x86_64/pvTimeStamp.d
pvDataApp/O.linux-x86_64/requester.d
pvDataApp/O.linux-x86_64/serializeHelper.d
pvDataApp/O.linux-x86_64/StandardField.d
pvDataApp/O.linux-x86_64/StandardPVField.d
pvDataApp/O.linux-x86_64/status.d
pvDataApp/O.linux-x86_64/timeFunction.d
pvDataApp/O.linux-x86_64/timer.d
pvDataApp/O.linux-x86_64/timeStamp.d
pvDataApp/O.linux-x86_64/TypeFunc.d
pvDataApp/property/alarm.cpp
pvDataApp/property/alarm.h
pvDataApp/property/alarm.h.orig
pvDataApp/property/control.h
pvDataApp/property/display.h
pvDataApp/property/pvAlarm.cpp
pvDataApp/property/pvAlarm.h
pvDataApp/property/pvControl.cpp
pvDataApp/property/pvControl.h
pvDataApp/property/pvDisplay.cpp
pvDataApp/property/pvDisplay.h
pvDataApp/property/pvEnumerated.cpp
pvDataApp/property/pvEnumerated.h
pvDataApp/property/pvTimeStamp.cpp
pvDataApp/property/pvTimeStamp.h
pvDataApp/property/timeStamp.cpp
pvDataApp/property/timeStamp.h
pvDataApp/property/timeStamp.h.orig
pvDataApp/pv/convert.h
pvDataApp/pv/convert.h.orig
pvDataApp/pv/pvData.h
pvDataApp/pv/pvData.h.orig
pvDataApp/pv/pvIntrospect.h
pvDataApp/pv/pvIntrospect.h.orig
pvDataApp/pv/pvType.h
pvDataApp/pv/standardField.h
pvDataApp/pv/standardField.h.orig
pvDataApp/pv/standardPVField.h
pvDataApp/pv/standardPVField.h.orig
pvDataApp/pvMisc/bitSetUtil.cpp
pvDataApp/pvMisc/bitSetUtil.h
testApp/capi/O.linux-x86_64/libtestc.a
testApp/capi/O.linux-x86_64/libtestc.so
testApp/capi/O.linux-x86_64/testc.d
testApp/capi/testc.cpp
testApp/capi/testc.py
testApp/mb/O.linux-x86_64/mb_test
testApp/mb/O.linux-x86_64/mb_test.d
testApp/misc/O.linux-x86_64/testBaseException
testApp/misc/O.linux-x86_64/testBaseException.d
testApp/misc/O.linux-x86_64/testBitSet
testApp/misc/O.linux-x86_64/testBitSet.d
testApp/misc/O.linux-x86_64/testByteBuffer
testApp/misc/O.linux-x86_64/testByteBuffer.d
testApp/misc/O.linux-x86_64/testByteOrder
testApp/misc/O.linux-x86_64/testByteOrder.d
testApp/misc/O.linux-x86_64/testMessageQueue
testApp/misc/O.linux-x86_64/testMessageQueue.d
testApp/misc/O.linux-x86_64/testQueue
testApp/misc/O.linux-x86_64/testQueue.d
testApp/misc/O.linux-x86_64/testSerialization
testApp/misc/O.linux-x86_64/testSerialization.d
testApp/misc/O.linux-x86_64/testThread
testApp/misc/O.linux-x86_64/testThread.d
testApp/misc/O.linux-x86_64/testTimer
testApp/misc/O.linux-x86_64/testTimer.d
testApp/misc/O.linux-x86_64/testTimeStamp
testApp/misc/O.linux-x86_64/testTimeStamp.d
testApp/misc/testBaseException.cpp
testApp/misc/testBitSet.cpp
testApp/misc/testByteBuffer.cpp
testApp/misc/testByteOrder.cpp
testApp/misc/testMessageQueue.cpp
testApp/misc/testQueue.cpp
testApp/misc/testSerialization.cpp
testApp/misc/testThread.cpp
testApp/misc/testTimer.cpp
testApp/misc/testTimeStamp.cpp
testApp/monitor/O.linux-x86_64/testMonitor
testApp/monitor/O.linux-x86_64/testMonitor.d
testApp/monitor/testMonitor.cpp
testApp/property/O.linux-x86_64/testProperty
testApp/property/O.linux-x86_64/testProperty.d
testApp/property/testProperty.cpp
testApp/pv/O.linux-x86_64/testConvert
testApp/pv/O.linux-x86_64/testConvert.d
testApp/pv/O.linux-x86_64/testIntrospect
testApp/pv/O.linux-x86_64/testIntrospect.d
testApp/pv/O.linux-x86_64/testOperators
testApp/pv/O.linux-x86_64/testOperators.d
testApp/pv/O.linux-x86_64/testPVAppend
testApp/pv/O.linux-x86_64/testPVAppend.d
testApp/pv/O.linux-x86_64/testPVAuxInfo
testApp/pv/O.linux-x86_64/testPVAuxInfo.d
testApp/pv/O.linux-x86_64/testPVData
testApp/pv/O.linux-x86_64/testPVData.d
testApp/pv/O.linux-x86_64/testPVScalarArray
testApp/pv/O.linux-x86_64/testPVScalarArray.d
testApp/pv/O.linux-x86_64/testPVStructureArray
testApp/pv/O.linux-x86_64/testPVStructureArray.d
testApp/pv/O.linux-x86_64/testPVType
testApp/pv/O.linux-x86_64/testPVType.d
testApp/pv/O.linux-x86_64/testStandardField
testApp/pv/O.linux-x86_64/testStandardField.d
testApp/pv/O.linux-x86_64/testStandardPVField
testApp/pv/O.linux-x86_64/testStandardPVField.d
testApp/pv/testConvert.cpp
testApp/pv/testIntrospect.cpp
testApp/pv/testOperators.cpp
testApp/pv/testPVAppend.cpp
testApp/pv/testPVAuxInfo.cpp
testApp/pv/testPVData.cpp
testApp/pv/testPVScalarArray.cpp
testApp/pv/testPVStructureArray.cpp
testApp/pv/testPVType.cpp
testApp/pv/testStandardField.cpp
testApp/pv/testStandardPVField.cpp
COPYRIGHT
Doxyfile
LICENSE
README.html

6
pvDataCPP.includes Normal file
View File

@@ -0,0 +1,6 @@
/home/msekoranja/epicsV4/pvDataCPP/pvDataApp/factory
/home/msekoranja/epicsV4/pvDataCPP/pvDataApp/misc
/home/msekoranja/epicsV4/pvDataCPP/pvDataApp/monitor
/home/msekoranja/epicsV4/pvDataCPP/pvDataApp/property
/home/msekoranja/epicsV4/pvDataCPP/pvDataApp/pv
/home/msekoranja/epicsV4/pvDataCPP/pvDataApp/pvMisc

View File

@@ -24,7 +24,7 @@ testByteBuffer_LIBS += pvData Com
PROD_HOST += testBaseException
testBaseException_SRCS += testBaseException.cpp
testBaseException_LIBS += pvData
testBaseException_LIBS += pvData Com
PROD_HOST += testSerialization
testSerialization_SRCS += testSerialization.cpp

View File

@@ -27,11 +27,11 @@ struct Unroller
};
template<>
void Unroller::unroll<0>(double d) {
void Unroller::unroll<0>(double /*d*/) {
THROW_BASE_EXCEPTION("the root cause");
}
void internalTestBaseException(int unused = 0)
void internalTestBaseException(int /*unused*/ = 0)
{
try {
// NOTE: 5, 4, 3, 2, 1 calls will be optimized and not shown

View File

@@ -30,7 +30,7 @@
using namespace epics::pvData;
static void testBasic(FILE * fd,FILE *auxfd ) {
static void testBasic(FILE * fd,FILE */*auxfd*/) {
int queueSize = 3;
StringArray messages;
messages.reserve(5);

View File

@@ -24,22 +24,24 @@
#include <pv/standardField.h>
#define BYTE_MAX_VALUE 127
#define BYTE_MIN_VALUE -128
#define UBYTE_MAX_VALUE 255
#define SHORT_MAX_VALUE 32767
#define SHORT_MIN_VALUE -32768
#define USHORT_MAX_VALUE 65535
#define INT_MAX_VALUE 2147483647
#define INT_MIN_VALUE (-INT_MAX_VALUE - 1)
#define UINT_MAX_VALUE 4294967295ULL
#define LONG_MAX_VALUE 9223372036854775807LL
#define LONG_MIN_VALUE (-LONG_MAX_VALUE - 1LL)
#define ULONG_MAX_VALUE 18446744073709549999ULL
#define FLOAT_MAX_VALUE 3.4028235E38
#define FLOAT_MIN_VALUE 1.4E-45
#define DOUBLE_MAX_VALUE 1.7976931348623157E308
#define DOUBLE_MIN_VALUE 4.9E-324
#include <limits>
#define BYTE_MAX_VALUE std::numeric_limits<int8>::max()
#define BYTE_MIN_VALUE std::numeric_limits<int8>::min()
#define UBYTE_MAX_VALUE std::numeric_limits<uint8>::max()
#define SHORT_MAX_VALUE std::numeric_limits<int16>::max()
#define SHORT_MIN_VALUE std::numeric_limits<int16>::min()
#define USHORT_MAX_VALUE std::numeric_limits<uint16>::max()
#define INT_MAX_VALUE std::numeric_limits<int32>::max()
#define INT_MIN_VALUE std::numeric_limits<int32>::min()
#define UINT_MAX_VALUE std::numeric_limits<uint32>::max()
#define LONG_MAX_VALUE std::numeric_limits<int64>::max()
#define LONG_MIN_VALUE std::numeric_limits<int64>::min()
#define ULONG_MAX_VALUE std::numeric_limits<uint64>::max()
#define FLOAT_MAX_VALUE std::numeric_limits<float>::max()
#define FLOAT_MIN_VALUE std::numeric_limits<float>::min()
#define DOUBLE_MAX_VALUE std::numeric_limits<double>::max()
#define DOUBLE_MIN_VALUE std::numeric_limits<double>::min()
using namespace epics::pvData;
@@ -54,13 +56,19 @@ public:
virtual void flushSerializeBuffer() {
}
virtual void ensureBuffer(std::size_t size) {
virtual void ensureBuffer(std::size_t /*size*/) {
}
virtual void alignBuffer(std::size_t alignment) {
buffer->align(alignment);
}
virtual bool directSerialize(ByteBuffer */*existingBuffer*/, const char* /*toSerialize*/,
std::size_t /*elementCount*/, std::size_t /*elementSize*/)
{
return false;
}
virtual void cachedSerialize(std::tr1::shared_ptr<const Field> const & field, ByteBuffer* buffer)
{
field->serialize(buffer, this);
@@ -76,13 +84,19 @@ public:
class DeserializableControlImpl : public DeserializableControl,
public NoDefaultMethods {
public:
virtual void ensureData(size_t size) {
virtual void ensureData(size_t /*size*/) {
}
virtual void alignData(size_t alignment) {
buffer->align(alignment);
}
virtual bool directDeserialize(ByteBuffer */*existingBuffer*/, char* /*deserializeTo*/,
std::size_t /*elementCount*/, std::size_t /*elementSize*/)
{
return false;
}
virtual std::tr1::shared_ptr<const Field> cachedDeserialize(ByteBuffer* buffer)
{
return getFieldCreate()->deserialize(buffer, this);

View File

@@ -50,7 +50,7 @@ public:
printf("poll called\n");
return emptyElement;
}
virtual void release(MonitorElementPtr const & monitorElement)
virtual void release(MonitorElementPtr const & /*monitorElement*/)
{
printf("release called\n");
}
@@ -70,7 +70,7 @@ static void testMonitor()
}
int main(int argc,char *argv[])
int main(int, char **)
{
testMonitor();
return(0);

View File

@@ -48,7 +48,7 @@ static String allProperties("alarm,timeStamp,display,control");
static PVStructurePtr doubleRecord;
static PVStructurePtr enumeratedRecord;
static void createRecords(FILE * fd,FILE *auxfd)
static void createRecords(FILE * fd,FILE */*auxfd*/)
{
doubleRecord = standardPVField->scalar(pvDouble,allProperties);
if(debug) {
@@ -70,7 +70,7 @@ static void createRecords(FILE * fd,FILE *auxfd)
}
}
static void printRecords(FILE * fd,FILE *auxfd)
static void printRecords(FILE * fd,FILE */*auxfd*/)
{
fprintf(fd,"doubleRecord\n");
builder.clear();
@@ -82,7 +82,7 @@ static void printRecords(FILE * fd,FILE *auxfd)
fprintf(fd,"%s\n",builder.c_str());
}
static void testAlarm(FILE * fd,FILE *auxfd)
static void testAlarm(FILE * fd,FILE */*auxfd*/)
{
if(debug) fprintf(fd,"testAlarm\n");
Alarm alarm;
@@ -155,7 +155,7 @@ static void testTimeStamp(FILE * fd,FILE *auxfd)
fprintf(fd,"testTimeStamp PASSED\n");
}
static void testControl(FILE * fd,FILE *auxfd)
static void testControl(FILE * fd,FILE */*auxfd*/)
{
if(debug) fprintf(fd,"testControl\n");
Control control;
@@ -182,7 +182,7 @@ static void testControl(FILE * fd,FILE *auxfd)
fprintf(fd,"testControl PASSED\n");
}
static void testDisplay(FILE * fd,FILE *auxfd)
static void testDisplay(FILE * fd,FILE */*auxfd*/)
{
if(debug) fprintf(fd,"testDisplay\n");
Display display;
@@ -215,7 +215,7 @@ static void testDisplay(FILE * fd,FILE *auxfd)
fprintf(fd,"testDisplay PASSED\n");
}
static void testEnumerated(FILE * fd,FILE *auxfd)
static void testEnumerated(FILE * fd,FILE */*auxfd*/)
{
if(debug) fprintf(fd,"testEnumerated\n");
PVEnumerated pvEnumerated;

View File

@@ -2,6 +2,10 @@ TOP=../..
include $(TOP)/configure/CONFIG
PROD_HOST += testBitSetUtil
testBitSetUtil_SRCS += testBitSetUtil.cpp
testBitSetUtil_LIBS += pvData Com
PROD_HOST += testIntrospect
testIntrospect_SRCS += testIntrospect.cpp
testIntrospect_LIBS += pvData Com
@@ -42,6 +46,10 @@ PROD_HOST += testPVStructureArray
testPVStructureArray_SRCS += testPVStructureArray.cpp
testPVStructureArray_LIBS += pvData Com
PROD_HOST += testOperators
testOperators_SRCS += testOperators.cpp
testOperators_LIBS += pvData Com
include $(TOP)/configure/RULES
#----------------------------------------
# ADD RULES AFTER THIS LINE

View File

@@ -0,0 +1,157 @@
/* testBitSetUtil.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: Marty Kraimer Date: 2013.05 */
#include <cstddef>
#include <cstdlib>
#include <cstddef>
#include <string>
#include <cstdio>
#include <epicsAssert.h>
#include <epicsExit.h>
#include <pv/requester.h>
#include <pv/bitSetUtil.h>
#include <pv/convert.h>
#include <pv/standardField.h>
#include <pv/standardPVField.h>
using namespace epics::pvData;
using std::tr1::static_pointer_cast;
static bool debug = false;
static FieldCreatePtr fieldCreate;
static PVDataCreatePtr pvDataCreate;
static StandardFieldPtr standardField;
static StandardPVFieldPtr standardPVField;
static ConvertPtr convert;
static String builder("");
static void test(FILE * fd)
{
if(debug) fprintf(fd,"\ntestBitSetUtil\n");
StringArray fieldNames;
PVFieldPtrArray pvFields;
fieldNames.reserve(5);
pvFields.reserve(5);
fieldNames.push_back("timeStamp");
fieldNames.push_back("alarm");
fieldNames.push_back("voltage");
fieldNames.push_back("power");
fieldNames.push_back("current");
pvFields.push_back(
pvDataCreate->createPVStructure(standardField->timeStamp()));
pvFields.push_back(
pvDataCreate->createPVStructure(standardField->alarm()));
pvFields.push_back(
pvDataCreate->createPVStructure(
standardField->scalar(pvDouble,"alarm")));
pvFields.push_back(
pvDataCreate->createPVStructure(
standardField->scalar(pvDouble,"alarm")));
pvFields.push_back(
pvDataCreate->createPVStructure(
standardField->scalar(pvDouble,"alarm")));
PVStructurePtr pvs = pvDataCreate->createPVStructure(
fieldNames,pvFields);
builder.clear();
pvs->toString(&builder);
if(debug) fprintf(fd,"pvs\n%s\n",builder.c_str());
int32 nfields = pvs->getNumberFields();
BitSetPtr bitSet = BitSet::create(nfields);
for(int32 i=0; i<nfields; i++) bitSet->set(i);
builder.clear();
bitSet->toString(&builder);
if(debug) fprintf(fd,"bitSet\n%s\n",builder.c_str());
BitSetUtil::compress(bitSet,pvs);
builder.clear();
bitSet->toString(&builder);
if(debug) fprintf(fd,"bitSet\n%s\n",builder.c_str());
bitSet->clear();
PVFieldPtr pvField = pvs->getSubField("timeStamp");
int32 offsetTimeStamp = pvField->getFieldOffset();
pvField = pvs->getSubField("timeStamp.secondsPastEpoch");
int32 offsetSeconds = pvField->getFieldOffset();
pvField = pvs->getSubField("timeStamp.nanoSeconds");
int32 offsetNano = pvField->getFieldOffset();
pvField = pvs->getSubField("timeStamp.userTag");
int32 offsetUserTag = pvField->getFieldOffset();
bitSet->set(offsetSeconds);
BitSetUtil::compress(bitSet,pvs);
assert(bitSet->get(offsetSeconds)==true);
bitSet->set(offsetNano);
bitSet->set(offsetUserTag);
builder.clear();
bitSet->toString(&builder);
if(debug) fprintf(fd,"bitSet\n%s\n",builder.c_str());
BitSetUtil::compress(bitSet,pvs);
assert(bitSet->get(offsetSeconds)==false);
assert(bitSet->get(offsetTimeStamp)==true);
builder.clear();
bitSet->toString(&builder);
if(debug) fprintf(fd,"bitSet\n%s\n",builder.c_str());
bitSet->clear();
pvField = pvs->getSubField("current");
int32 offsetCurrent = pvField->getFieldOffset();
pvField = pvs->getSubField("current.value");
int32 offsetValue = pvField->getFieldOffset();
pvField = pvs->getSubField("current.alarm");
int32 offsetAlarm = pvField->getFieldOffset();
pvField = pvs->getSubField("current.alarm.severity");
int32 offsetSeverity = pvField->getFieldOffset();
pvField = pvs->getSubField("current.alarm.status");
int32 offsetStatus = pvField->getFieldOffset();
pvField = pvs->getSubField("current.alarm.message");
int32 offsetMessage = pvField->getFieldOffset();
bitSet->set(offsetValue);
bitSet->set(offsetSeverity);
bitSet->set(offsetStatus);
bitSet->set(offsetMessage);
builder.clear();
bitSet->toString(&builder);
if(debug) fprintf(fd,"bitSet\n%s\n",builder.c_str());
BitSetUtil::compress(bitSet,pvs);
builder.clear();
bitSet->toString(&builder);
if(debug) fprintf(fd,"bitSet\n%s\n",builder.c_str());
assert(bitSet->get(offsetCurrent)==true);
bitSet->clear();
bitSet->set(offsetSeverity);
bitSet->set(offsetStatus);
bitSet->set(offsetMessage);
builder.clear();
bitSet->toString(&builder);
if(debug) fprintf(fd,"bitSet\n%s\n",builder.c_str());
BitSetUtil::compress(bitSet,pvs);
builder.clear();
bitSet->toString(&builder);
if(debug) fprintf(fd,"bitSet\n%s\n",builder.c_str());
assert(bitSet->get(offsetAlarm)==true);
bitSet->clear();
fprintf(fd,"testBitSetUtil PASSED\n");
}
int main(int argc,char *argv[])
{
char *fileName = 0;
if(argc>1) fileName = argv[1];
FILE * fd = stdout;
if(fileName!=0 && fileName[0]!=0) {
fd = fopen(fileName,"w+");
}
fieldCreate = getFieldCreate();
pvDataCreate = getPVDataCreate();
standardField = getStandardField();
standardPVField = getStandardPVField();
convert = getConvert();
test(fd);
return(0);
}

View File

@@ -0,0 +1,91 @@
/* testOperators.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: Matej Sekoranja Date: 2013.02 */
#include <iostream>
#include <pv/pvData.h>
#include <pv/standardField.h>
#include <pv/standardPVField.h>
#include <epicsAssert.h>
using namespace epics::pvData;
static PVDataCreatePtr pvDataCreate = getPVDataCreate();
static StandardFieldPtr standardField = getStandardField();
static StandardPVFieldPtr standardPVField = getStandardPVField();
int main(int, char **)
{
PVStructurePtr pvStructure = standardPVField->scalar(pvDouble,
"alarm,timeStamp,display,control,valueAlarm");
const double testDV = 12.8;
PVDoublePtr pvValue = pvStructure->getDoubleField("value");
*pvValue <<= testDV;
double dv;
*pvValue >>= dv;
assert(testDV == dv);
const std::string testSV = "test message";
PVStringPtr pvMessage = pvStructure->getStringField("alarm.message");
*pvMessage <<= testSV;
std::string sv;
*pvMessage >>= sv;
assert(testSV == sv);
//
// to stream tests
//
std::cout << *pvValue << std::endl;
std::cout << *pvMessage << std::endl;
std::cout << *pvStructure << std::endl;
StringArray choices;
choices.reserve(3);
choices.push_back("one");
choices.push_back("two");
choices.push_back("three");
pvStructure = standardPVField->enumerated(choices, "alarm,timeStamp,valueAlarm");
std::cout << *pvStructure << std::endl;
pvStructure = standardPVField->scalarArray(pvDouble,"alarm,timeStamp");
std::cout << *pvStructure << std::endl;
double values[] = { 1.1, 2.2, 3.3 };
PVDoubleArrayPtr darray = std::tr1::dynamic_pointer_cast<PVDoubleArray>(pvStructure->getScalarArrayField("value", pvDouble));
darray->put(0, 3, values, 0);
std::cout << *darray << std::endl;
std::cout << format::array_at(1) << *darray << std::endl;
StructureConstPtr structure = standardField->scalar(pvDouble, "alarm,timeStamp");
pvStructure = standardPVField->structureArray(structure,"alarm,timeStamp");
size_t num = 2;
PVStructurePtrArray pvStructures;
pvStructures.reserve(num);
for(size_t i=0; i<num; i++) {
pvStructures.push_back(
pvDataCreate->createPVStructure(structure));
}
PVStructureArrayPtr pvStructureArray = pvStructure->getStructureArrayField("value");
pvStructureArray->put(0, num, pvStructures, 0);
std::cout << *pvStructure << std::endl;
return 0;
}

View File

@@ -77,7 +77,7 @@ static void testCreatePVStructure(FILE * fd)
fprintf(fd,"testCreatePVStructure PASSED\n");
}
static void testPVScalarCommon(FILE * fd,String fieldName,ScalarType stype)
static void testPVScalarCommon(FILE * fd,String /*fieldName*/,ScalarType stype)
{
PVScalarPtr pvScalar = pvDataCreate->createPVScalar(stype);
if(stype==pvBoolean) {
@@ -91,7 +91,7 @@ static void testPVScalarCommon(FILE * fd,String fieldName,ScalarType stype)
}
static void testPVScalarWithProperties(
FILE * fd,String fieldName,ScalarType stype)
FILE * fd,String /*fieldName*/,ScalarType stype)
{
PVStructurePtr pvStructure;
bool hasValueAlarm = false;
@@ -335,7 +335,7 @@ static void testPVScalar(FILE * fd) {
}
static void testScalarArrayCommon(FILE * fd,String fieldName,ScalarType stype)
static void testScalarArrayCommon(FILE * fd,String /*fieldName*/,ScalarType stype)
{
PVStructurePtr pvStructure = standardPVField->scalarArray(
stype,alarmTimeStamp);

View File

@@ -35,7 +35,7 @@ static void print(String name)
if(debug) printf("\n%s\n%s\n",name.c_str(),builder.c_str());
}
int main(int argc,char *argv[])
int main(int, char **)
{
StructureConstPtr doubleValue = standardField->scalar(pvDouble,
"alarm,timeStamp,display,control,valueAlarm");

View File

@@ -37,7 +37,7 @@ static void print(String name)
if(debug) printf("\n%s\n%s\n",name.c_str(),builder.c_str());
}
int main(int argc,char *argv[])
int main(int, char **)
{
PVStructurePtr pvStructure = standardPVField->scalar(pvDouble,
"alarm,timeStamp,display,control,valueAlarm");