Compare commits
110 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0367a2dd7 | ||
|
|
1e0f1119e2 | ||
|
|
6d6314a924 | ||
|
|
e0b881d036 | ||
|
|
d24ff6c3d2 | ||
|
|
ef17aac046 | ||
|
|
83b63a9138 | ||
|
|
0a5ab8625d | ||
|
|
a115c9cd15 | ||
|
|
6ba40803d8 | ||
|
|
8d6094c55a | ||
|
|
d258acfc49 | ||
|
|
d9072402db | ||
|
|
1a706e3842 | ||
|
|
a227897504 | ||
|
|
0833d68e91 | ||
|
|
99bab6796c | ||
|
|
0544187057 | ||
|
|
e12e7b4d76 | ||
|
|
7609ac6f1e | ||
|
|
3c946a91e8 | ||
|
|
2389ebd87e | ||
|
|
90ad497a6f | ||
|
|
1bb0b6fe03 | ||
|
|
c16c1df6fd | ||
|
|
e460641711 | ||
|
|
1e980651a9 | ||
|
|
028076e79c | ||
|
|
e5b6a88551 | ||
|
|
b18b4f236f | ||
|
|
605d4e99b9 | ||
|
|
ad00b6465a | ||
|
|
537ebd05f2 | ||
|
|
2ee8769752 | ||
|
|
8d7f534d54 | ||
|
|
47bb62b051 | ||
|
|
50b8213781 | ||
|
|
fd1fe53b49 | ||
|
|
378def0a58 | ||
|
|
ed5f48b353 | ||
|
|
fa6c2c7683 | ||
|
|
3fadc9b481 | ||
|
|
c3d7fa0d26 | ||
|
|
5c16357fe2 | ||
|
|
ef2e6079ba | ||
|
|
18633288fb | ||
|
|
67daef7bcc | ||
|
|
5eb29dcfc4 | ||
|
|
d2fc922ee7 | ||
|
|
d35010c1cb | ||
|
|
bd4b65225c | ||
|
|
be95a62965 | ||
|
|
4336d524af | ||
|
|
ae7976fc01 | ||
|
|
72f9dc4c7c | ||
|
|
84760648fe | ||
|
|
b0df40d9a6 | ||
|
|
139217914d | ||
|
|
efa5795193 | ||
|
|
4f499aed01 | ||
|
|
a8ba831f5e | ||
|
|
a90405c25a | ||
|
|
4546fda8e9 | ||
|
|
b02f771146 | ||
|
|
dc94b26e50 | ||
|
|
4c32f37ede | ||
|
|
336a8b3bc2 | ||
|
|
faecea39c8 | ||
|
|
d08d5362be | ||
|
|
d4292d81f2 | ||
|
|
62893e33e9 | ||
|
|
5b07ecbd01 | ||
|
|
b5c1b9178d | ||
|
|
65ff7ab1c3 | ||
|
|
35fd991fdc | ||
|
|
57e1acba79 | ||
|
|
620d351946 | ||
|
|
de3c2656ef | ||
|
|
3b2e9b2485 | ||
|
|
75a3005d74 | ||
|
|
448f606054 | ||
|
|
e35c6f29fb | ||
|
|
85a1a48b00 | ||
|
|
45427d3202 | ||
|
|
93c7a05dac | ||
|
|
a34c38c9b9 | ||
|
|
3100b77a1a | ||
|
|
c8429069a3 | ||
|
|
01172217dc | ||
|
|
14b0e409f2 | ||
|
|
2107bae8dd | ||
|
|
433676226c | ||
|
|
f0c88234a0 | ||
|
|
393d711e5f | ||
|
|
cb24bd9c2c | ||
|
|
abc5c5a374 | ||
|
|
54c94f181a | ||
|
|
6641e7f5d1 | ||
|
|
f4a00f2b0f | ||
|
|
05d41f81e4 | ||
|
|
fdc289d888 | ||
|
|
0a2243e033 | ||
|
|
9d877d764f | ||
|
|
f5df29cf34 | ||
|
|
8008823ea5 | ||
|
|
6515de4bc0 | ||
|
|
8c5f535b79 | ||
|
|
3714be4f16 | ||
|
|
f24f565e58 | ||
|
|
036186fc12 |
31
COPYRIGHT
31
COPYRIGHT
@@ -1,31 +0,0 @@
|
|||||||
This software is in part copyrighted by the various organizations and
|
|
||||||
individuals listed below. Permission to use it is set out in the file
|
|
||||||
LICENSE that accompanies the software.
|
|
||||||
|
|
||||||
In no event shall any copyright holder be liable to any party for
|
|
||||||
direct, indirect, special, incidental, or consequential damages arising
|
|
||||||
out of the use of this software, its documentation, or any derivatives
|
|
||||||
thereof, even if they have been advised of the possibility of such
|
|
||||||
damage.
|
|
||||||
|
|
||||||
The copyright holders specifically disclaim any warranties, including,
|
|
||||||
but not limited to, the implied warranties of merchantability, fitness
|
|
||||||
for a particular purpose, and non-infringement. This software is
|
|
||||||
provided on an "as is" basis, and the copyright holders have no
|
|
||||||
obligation either collectively or individually to provide maintenance,
|
|
||||||
support, updates, enhancements, or modifications.
|
|
||||||
|
|
||||||
Copyright (c) 2006 - 2015 All rights reserved
|
|
||||||
|
|
||||||
Martin R. Kraimer
|
|
||||||
The University of Chicago, as Operator of Argonne National Laboratory.
|
|
||||||
Deutsches Elektronen-Synchroton, Member of the Helmholtz Association,
|
|
||||||
(DESY), HAMBURG, GERMANY,
|
|
||||||
BERLINER SPEICHERRING GESELLSCHAFT FUER SYNCHROTRONSTRAHLUNG M.B.H.
|
|
||||||
(BESSY), BERLIN, GERMANY.
|
|
||||||
COSYLAB (Control System Laboratory), Ljubljana, Slovenia.
|
|
||||||
Brookhaven Science Associates, as Operator of Brookhaven
|
|
||||||
National Laboratory.
|
|
||||||
Diamond Light Source Ltd., Didcot, United Kingdom.
|
|
||||||
|
|
||||||
|
|
||||||
109
LICENSE
109
LICENSE
@@ -1,14 +1,16 @@
|
|||||||
|
Copyright and License Terms
|
||||||
|
---------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2015 Martin R. Kraimer
|
Copyright (c) 2006-2016 Martin R. Kraimer
|
||||||
Copyright (c) 2006 The University of Chicago, as Operator of Argonne
|
Copyright (c) 2006-2016 UChicago Argonne LLC, as Operator of Argonne
|
||||||
National Laboratory.
|
National Laboratory.
|
||||||
Copyright (c) 2006 Deutsches Elektronen-Synchrotron,
|
Copyright (c) 2006 Deutsches Elektronen-Synchrotron,
|
||||||
Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY.
|
Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY.
|
||||||
Copyright (c) 2007-2015 Control System Laboratory,
|
Copyright (c) 2007-2016 Control System Laboratory,
|
||||||
(COSYLAB) Ljubljana Slovenia
|
(COSYLAB) Ljubljana Slovenia
|
||||||
Copyright (c) 2010-2015 Brookhaven Science Associates, as Operator of Brookhaven
|
Copyright (c) 2010-2016 Brookhaven Science Associates, as Operator
|
||||||
National Laboratory
|
of Brookhaven National Laboratory
|
||||||
Copyright (c) 2011-2015 Diamond Light Source Limited,
|
Copyright (c) 2011-2016 Diamond Light Source Limited,
|
||||||
(DLS) Didcot, United Kingdom
|
(DLS) Didcot, United Kingdom
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person
|
Permission is hereby granted, free of charge, to any person
|
||||||
@@ -34,81 +36,30 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
|
|
||||||
________________________________________________________________________
|
________________________________________________________________________
|
||||||
|
|
||||||
This software is in part copyrighted by the University of Chicago (UofC)
|
Additional Disclaimers
|
||||||
|
----------------------
|
||||||
|
|
||||||
In no event shall UofC be liable to any party for direct, indirect,
|
This software is copyright in part by these institutions:
|
||||||
special, incidental, or consequential damages arising out of the use of
|
|
||||||
this software, its documentation, or any derivatives thereof, even if
|
|
||||||
UofC has been advised of the possibility of such damage.
|
|
||||||
|
|
||||||
UofC specifically disclaims any warranties, including, but not limited
|
* Brookhaven Science Associates, as Operator of Brookhaven
|
||||||
to, the implied warranties of merchantability, fitness for a particular
|
National Laboratory, New York, USA
|
||||||
purpose, and non-infringement. This software is provided on an "as is"
|
* Control System Laboratory, Ljubljana, Slovenia
|
||||||
basis, and UofC has no obligation to provide maintenance, support,
|
* Deutsches Elektronen-Synchroton, Member of the Helmholtz
|
||||||
updates, enhancements, or modifications.
|
Association, Hamburg, Germany
|
||||||
|
* Diamond Light Source Limited, Didcot, United Kingdom
|
||||||
|
* Helmholtz-Zentrum Berlin fuer Materialien und Energie m.b.H.,
|
||||||
|
Berlin, Germany.
|
||||||
|
* UChicage Argonne LLC, as Operator of Argonne National Laboratory,
|
||||||
|
Illinois, USA
|
||||||
|
|
||||||
________________________________________________________________________
|
In no event shall these institutions be liable to any party for direct,
|
||||||
|
indirect, special, incidental, or consequential damages arising out of
|
||||||
|
the use of this software, its documentation, or any derivatives thereof,
|
||||||
|
even if advised of the possibility of such damage.
|
||||||
|
|
||||||
This software is in part copyrighted by the BERLINER SPEICHERRING
|
These institutions specifically disclaim any warranties, including, but
|
||||||
GESELLSCHAFT FUER SYNCHROTRONSTRAHLUNG M.B.H. (BESSY), BERLIN, GERMANY.
|
not limited to, the implied warranties of merchantability, fitness for a
|
||||||
|
particular purpose, and non-infringement. This software is provided on
|
||||||
In no event shall BESSY be liable to any party for direct, indirect,
|
an "as is" basis, and these institutions have no obligation to provide
|
||||||
special, incidental, or consequential damages arising out of the use of
|
maintenance, support, updates, enhancements, or modifications.
|
||||||
this software, its documentation, or any derivatives thereof, even if
|
|
||||||
BESSY has been advised of the possibility of such damage.
|
|
||||||
|
|
||||||
BESSY specifically disclaims any warranties, including, but not limited
|
|
||||||
to, the implied warranties of merchantability, fitness for a particular
|
|
||||||
purpose, and non-infringement. This software is provided on an "as is"
|
|
||||||
basis, and BESSY has no obligation to provide maintenance, support,
|
|
||||||
updates, enhancements, or modifications.
|
|
||||||
|
|
||||||
________________________________________________________________________
|
|
||||||
|
|
||||||
This software is in part copyrighted by the Deutsches Elektronen-Synchroton,
|
|
||||||
Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY.
|
|
||||||
|
|
||||||
In no event shall DESY be liable to any party for direct, indirect,
|
|
||||||
special, incidental, or consequential damages arising out of the use of
|
|
||||||
this software, its documentation, or any derivatives thereof, even if
|
|
||||||
DESY has been advised of the possibility of such damage.
|
|
||||||
|
|
||||||
DESY specifically disclaims any warranties, including, but not limited
|
|
||||||
to, the implied warranties of merchantability, fitness for a particular
|
|
||||||
purpose, and non-infringement. This software is provided on an "as is"
|
|
||||||
basis, and DESY has no obligation to provide maintenance, support,
|
|
||||||
updates, enhancements, or modifications.
|
|
||||||
|
|
||||||
______________________________________________________________________
|
|
||||||
|
|
||||||
This software is in part copyrighted by the Brookhaven
|
|
||||||
National Laboratory (BNL).
|
|
||||||
|
|
||||||
In no event shall BNL be liable to any party for direct, indirect,
|
|
||||||
special, incidental, or consequential damages arising out of the use of
|
|
||||||
this software, its documentation, or any derivatives thereof, even if
|
|
||||||
BNL has been advised of the possibility of such damage.
|
|
||||||
|
|
||||||
BNL specifically disclaims any warranties, including, but not limited
|
|
||||||
to, the implied warranties of merchantability, fitness for a particular
|
|
||||||
purpose, and non-infringement. This software is provided on an "as is"
|
|
||||||
basis, and BNL has no obligation to provide maintenance, support,
|
|
||||||
updates, enhancements, or modifications.
|
|
||||||
|
|
||||||
________________________________________________________________________
|
|
||||||
|
|
||||||
This software is in part copyrighted by Diamond Light Source Limited (DLS)
|
|
||||||
|
|
||||||
In no event shall DLS be liable to any party for direct, indirect,
|
|
||||||
special, incidental, or consequential damages arising out of the use of
|
|
||||||
this software, its documentation, or any derivatives thereof, even if
|
|
||||||
DLS has been advised of the possibility of such damage.
|
|
||||||
|
|
||||||
DLS specifically disclaims any warranties, including, but not limited
|
|
||||||
to, the implied warranties of merchantability, fitness for a particular
|
|
||||||
purpose, and non-infringement. This software is provided on an "as is"
|
|
||||||
basis, and DLS has no obligation to provide maintenance, support,
|
|
||||||
updates, enhancements, or modifications.
|
|
||||||
|
|
||||||
________________________________________________________________________
|
|
||||||
|
|
||||||
|
|||||||
82
README.html
82
README.html
@@ -1,82 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
|
|
||||||
<title>EPICS pvData C++</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<h1 style="text-align: center">EPICS pvData C++<br />
|
|
||||||
Overview<br />
|
|
||||||
2010.08.10</h1>
|
|
||||||
CONTENTS
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<h2 style="text-align: center">Introduction</h2>
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<p>This project has the begining of the C++ implementation of pvData. The
|
|
||||||
following is done:</p>
|
|
||||||
<dl>
|
|
||||||
<dt>introspection interfaces</dt>
|
|
||||||
<dd>The introspection interfaces for clients are described.</dd>
|
|
||||||
<dt>introspection implementation</dt>
|
|
||||||
<dd>The following have been implemented: Type, ScalarType, Field,
|
|
||||||
Scalar</dd>
|
|
||||||
<dt>test</dt>
|
|
||||||
<dd>A test of Scalar.</dd>
|
|
||||||
<dt>As mentioned below there are problems with the current
|
|
||||||
implementation.</dt>
|
|
||||||
</dl>
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<h2 style="text-align: center">Building</h2>
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<p>The project is structured as an epics base client application. Edit
|
|
||||||
configure/RELEASE so that it references your EPICS base and then just
|
|
||||||
type:</p>
|
|
||||||
<pre> make</pre>
|
|
||||||
|
|
||||||
<p>At the top. Then execute the test in the bin directory.</p>
|
|
||||||
|
|
||||||
<p>pvDataApp has the following sub directories:</p>
|
|
||||||
<dl>
|
|
||||||
<dt>pv</dt>
|
|
||||||
<dd>pvData.h has the interface descriptions for client code.</dd>
|
|
||||||
<dt>factory</dt>
|
|
||||||
<dd>FieldCreateFactory.cpp has the current implementation</dd>
|
|
||||||
<dt>test</dt>
|
|
||||||
<dd>Has a test for the current implementation.</dd>
|
|
||||||
</dl>
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<h2 style="text-align: center">Questions about Classes</h2>
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<p>The pure virtual classes defined in pvData.h now work. But there are still
|
|
||||||
some things that are not so nice. Amoung these are:</p>
|
|
||||||
<ul>
|
|
||||||
<li>In FieldCreateFactory.cpp look for "WHY DO I". It asks why the derived
|
|
||||||
class must also define methods defined in the base class. If it does not
|
|
||||||
then a compilation error occurs. WHY??? </li>
|
|
||||||
<li>The toString methods have an argument of "std::string &buf" instead
|
|
||||||
of "std::string *". Does this seem correct?</li>
|
|
||||||
<li>Can arguments and return descriptions be defined better?</li>
|
|
||||||
<li>Is const present everywhere it should be? Remember that introspection
|
|
||||||
classes are immutable.</li>
|
|
||||||
<li>The code is NOT thread safe. When we decide for sure what thread/lock
|
|
||||||
support to choose I will fix this.</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>HELP WILL BE GREATLY APPRECIATED. because I am still coming up to speed
|
|
||||||
with c++</p>
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<h2 style="text-align: center">Garbage Collection</h2>
|
|
||||||
<hr />
|
|
||||||
<p>Not yet implemented. Lets get class structure correct first.</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
57
README.md
Normal file
57
README.md
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
pvaDataCPP
|
||||||
|
==========
|
||||||
|
|
||||||
|
pvDataCPP is a set of data types and utilities that form part of the EPICS V4 project.
|
||||||
|
|
||||||
|
|
||||||
|
Further Info
|
||||||
|
------------
|
||||||
|
|
||||||
|
Consult the documents in the documentation directory, in particular
|
||||||
|
|
||||||
|
* pvDataCPP.html
|
||||||
|
* RELEASE_NOTES.md
|
||||||
|
|
||||||
|
Also see the [EPICS Version 4 website](http://epics-pvdata.sourceforge.net)
|
||||||
|
|
||||||
|
Prerequisites
|
||||||
|
-------------
|
||||||
|
|
||||||
|
The pvDataCPP requires recent versions of the following software:
|
||||||
|
|
||||||
|
1. EPICS Base (v3.14.12.3 or later)
|
||||||
|
2. EPICS4 pvCommonCPP (4.1.0 or later)
|
||||||
|
|
||||||
|
(pvCommonCPP may not be needed depending on host/compiler.)
|
||||||
|
|
||||||
|
|
||||||
|
Building
|
||||||
|
--------
|
||||||
|
|
||||||
|
Building uses the make utility and the EPICS base build system.
|
||||||
|
|
||||||
|
The build system needs the location of the prerequisites, e.g. by placing the
|
||||||
|
lines of the form
|
||||||
|
|
||||||
|
PVCOMMON = /home/install/epicsV4/pvCommonCPP
|
||||||
|
EPICS_BASE = /home/install/epics/base
|
||||||
|
|
||||||
|
pointing to the locations in a file called RELEASE.local
|
||||||
|
in the configure directory or the parent directory of pvDataCPP.
|
||||||
|
|
||||||
|
With this in place, to build type make
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
To perform a clean build type
|
||||||
|
|
||||||
|
make clean uninstall
|
||||||
|
|
||||||
|
To run the unit tests type
|
||||||
|
|
||||||
|
make runtests
|
||||||
|
|
||||||
|
For more information on the EPICS build system consult the
|
||||||
|
[Application Development guide](http://www.aps.anl.gov/epics/base/R3-14/12-docs/AppDevGuide.pdf).
|
||||||
|
|
||||||
|
|
||||||
@@ -1,66 +1,265 @@
|
|||||||
<h1>Release 4.1 IN DEVELOPMENT</h1>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<p>The main changes since release 4.0 are:</p>
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html;" />
|
||||||
|
<meta name="keywords" content="EPICS, EPICSv4" />
|
||||||
|
<title>EPICS V4 pvData C++ Release Notes</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../base.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../epicsv4.css" />
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Release 6.0.1</h1>
|
||||||
|
|
||||||
|
<p>The changes since release 6.0.0 are:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>Fix "Problem building pvDataCPP for win32-x86-mingw" (issue #42)</li>
|
||||||
|
<li>In src/misc/bitSet.cpp #include <algorithm> required for MSVS 2015</li>
|
||||||
|
<li>In testApp/misc/testTypeCast.cpp print (u)int8 values as integers</li>
|
||||||
|
<li>Minor documentation updates</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h1>Release 6.0.0</h1>
|
||||||
|
|
||||||
|
<p>The main changes since release 5.0.4 are:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Linux shared library version added</li>
|
||||||
|
<li>Headers have been moved into pv directories</li>
|
||||||
|
<li>Bitset functions declared const where possible</li>
|
||||||
|
<li>Bitset::swap added</li>
|
||||||
|
<li>Requester::message has default implementation</li>
|
||||||
|
<li>Serialization/deserialization helpers added</li>
|
||||||
|
<li>Non-template getSubField char* overload added</li>
|
||||||
|
<li>MonitorPlugin deprecated</li>
|
||||||
|
<li>Field name validation performed</li>
|
||||||
|
<li>Now builds for Cygwin and MinGW targets</li>
|
||||||
|
<li>Fix for debug build issue.</li>
|
||||||
|
<li>New license file replaces LICENSE and COPYRIGHT</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Shared library version added</h2>
|
||||||
|
|
||||||
|
<p>Linux shared library version numbers have been added by setting SHRLIB_VERSION
|
||||||
|
(to 6.0 in this case). So shared object will be libpvData.so.6.0 instead of
|
||||||
|
libpvData.so.</p>
|
||||||
|
|
||||||
|
<h2>Headers have been moved into pv directories</h2>
|
||||||
|
|
||||||
|
<p>E.g. src/property/alarm.h -> src/property/pv/alarm.h</p>
|
||||||
|
|
||||||
|
<p>This facilitates using some IDEs such as Qt Creator.</p>
|
||||||
|
|
||||||
|
<h2>Requester::message has default implementation</h2>
|
||||||
|
|
||||||
|
<p>Requester::message is no longer pure virtual. Default implementation sends
|
||||||
|
string to std::cerr.</p>
|
||||||
|
|
||||||
|
<h2>Serialization/deserialization helpers added</h2>
|
||||||
|
|
||||||
|
<p>A helper function, serializeToVector, has been added which serializes a
|
||||||
|
Serializable object into a standard vector of UInt8s.</p>
|
||||||
|
|
||||||
|
<p>Similarly a function deserializeFromVector deserializes a standard vector into
|
||||||
|
a Deserializable object.</p>
|
||||||
|
|
||||||
|
<p>A function deserializeFromBuffer deserializes a ByteBuffer into a
|
||||||
|
Deserializable object.</p>
|
||||||
|
|
||||||
|
<h2>Field name validation performed</h2>
|
||||||
|
|
||||||
|
<p>On creating a Structure or Union the field names are now validated.</p>
|
||||||
|
|
||||||
|
<p>Valid characters for a field name are upper or lowercase letters, numbers and
|
||||||
|
underscores and intial numbers are invalid, i.e. names must be of the form
|
||||||
|
[A-Za-z<em>][A-Za-z0-9</em>]*.</p>
|
||||||
|
|
||||||
|
<h2>Now builds for Cygwin and MinGW targets</h2>
|
||||||
|
|
||||||
|
<p>Includes cross-compiling MinGW on Linux.</p>
|
||||||
|
|
||||||
|
<h1>Release 5.0.4</h1>
|
||||||
|
|
||||||
|
<p>The changes since release 5.0.3 are:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Fixed bitset serialization (issue #24)</li>
|
||||||
|
<li>Fixed truncation in BitSet::or_and (issue #27)</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Fixed bitset serialization (issue #24)</h2>
|
||||||
|
|
||||||
|
<p>C++ bitset serialization was not consistent with the C++ deserialization and
|
||||||
|
Java code in some instances (depending on the endianness of the serializer and
|
||||||
|
deserializer) when the number of bits was 56-63 modulo 64. C++ serialization
|
||||||
|
has been fixed.</p>
|
||||||
|
|
||||||
|
<p>Fix exposed issue in deserialization on 32-bit platforms which
|
||||||
|
has also been corrected. </p>
|
||||||
|
|
||||||
|
<h2>Fixed truncation in BitSet::or_and (issue #27)</h2>
|
||||||
|
|
||||||
|
<p>If n, n1 and n2 words are used to store the values of the bitsets bitset,
|
||||||
|
bitset1 and bitset2 respectively then max(n, min(n1,n2)) words are needed
|
||||||
|
to store bitset.or_(bitset1, bitset2).</p>
|
||||||
|
|
||||||
|
<p>Previously min(n1,n2) words were used and the result would be truncated in
|
||||||
|
some instances. This has been fixed.</p>
|
||||||
|
|
||||||
|
<h1>Release 5.0.3</h1>
|
||||||
|
|
||||||
|
<p>The only change since release 5.0.2 is:</p>
|
||||||
|
|
||||||
|
<h2>Fixed buffer overflow in PVUnion::serialize() (issue #20)</h2>
|
||||||
|
|
||||||
|
<p>A PVUnion whose stored value was null was serialized without checking
|
||||||
|
whether the buffer had sufficient capacity. This has been fixed by calling
|
||||||
|
ensureBuffer().</p>
|
||||||
|
|
||||||
|
<h1>Release 5.0.2</h1>
|
||||||
|
|
||||||
|
<p>The main changes since release 4.0.3 are:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Deprecated getXXXField() methods have been removed from PVStructure</li>
|
||||||
<li>Convert copy methods and equals operators (re)moved</li>
|
<li>Convert copy methods and equals operators (re)moved</li>
|
||||||
<li>Convert::copyUnion now always copies between subfields.</li>
|
<li>Convert::copyUnion now always copies between subfields.</li>
|
||||||
<li>CreateRequest prevents a possible SEGFAULT.</li>
|
<li>New method getSubFieldT, like getSubField except it throws an exception</li>
|
||||||
<li>New stream operators for Field and PVField are provided.</li>
|
<li>findSubField method removed from PVStructure</li>
|
||||||
<li>New method getAs that is like getSubField except that it throws exception</li>
|
<li>New stream operators for Field and PVField are provided</li>
|
||||||
|
<li>New template versions of Structure::getField</li>
|
||||||
|
<li>Fixes for static initialisation order issues</li>
|
||||||
|
<li>CreateRequest prevents a possible SEGFAULT</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<h2>Deprecated getXXXField methods have been removed from PVStructure</h2>
|
||||||
|
|
||||||
|
<p>The following methods have been removed from PVStructure</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>getBooleanField</li>
|
||||||
|
<li>getByteField, getShortField, getIntField, getLongField</li>
|
||||||
|
<li>getUByteField, getUShortField, getUIntField, getULongField</li>
|
||||||
|
<li>getStringField</li>
|
||||||
|
<li>getStructureField, getUnionField</li>
|
||||||
|
<li>getScalarArrayField, getStructureArrayField, getUnionArrayField</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Use template getSubField instead, e.g. use</p>
|
||||||
|
|
||||||
|
<pre><code>getSubField< PVInt >(fieldName)
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>in place of</p>
|
||||||
|
|
||||||
|
<pre><code>getIntField(fieldName)
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
<h2>Convert copy methods and equals operators</h2>
|
<h2>Convert copy methods and equals operators</h2>
|
||||||
|
|
||||||
<p>Convert copy methods where moved and replaced with methods
|
<p>Convert copy methods where moved and replaced with methods
|
||||||
on PVField classes, i.e.</p>
|
on PVField classes, i.e.</p>
|
||||||
|
|
||||||
<pre><code>PVField::copy(const PVField& from)
|
<pre><code>PVField::copy(const PVField& from)
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Methods</p>
|
<p>Methods</p>
|
||||||
|
|
||||||
<pre><code>PVField::copyUnchecked(const PVField& from)
|
<pre><code>PVField::copyUnchecked(const PVField& from)
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>where added to allow unchecked copies, to gain performance
|
|
||||||
|
<p>were added to allow unchecked copies, to gain performance
|
||||||
where checked are not needed (anymore).</p>
|
where checked are not needed (anymore).</p>
|
||||||
|
|
||||||
<p>In addition:
|
<p>In addition:
|
||||||
- isCompatibleXXX methods were removed in favour of Field::operator==.
|
- isCompatibleXXX methods were removed in favour of Field::operator==.
|
||||||
- equals methods were remove in favour of PVField::operator==.
|
- equals methods were remove in favour of PVField::operator==.
|
||||||
- operator== methods where moved to pvIntrospect.h and pvData.h</p>
|
- operator== methods where moved to pvIntrospect.h and pvData.h</p>
|
||||||
|
|
||||||
<h2>Convert::copyUnion</h2>
|
<h2>Convert::copyUnion</h2>
|
||||||
|
|
||||||
<p>Before this method, depending on types for to and from,
|
<p>Before this method, depending on types for to and from,
|
||||||
sometimes did a shallow cppy, i. e. just made to shared_ptr for to
|
sometimes did a shallow copy, i.e. just made to shared_ptr for to
|
||||||
share the same data as from.
|
share the same data as from.
|
||||||
Now it always copies between the subfield of to and from.</p>
|
Now it always copies between the subfield of to and from.</p>
|
||||||
<h2>CreateRequest change</h2>
|
|
||||||
<p>createRequest could cause a SEGFAULT if passed a bad argument.
|
<h2>New method getSubFieldT, like getSubField except it throws an exception</h2>
|
||||||
This has been changed so the it returns a null pvStructure
|
|
||||||
and provies an error.</p>
|
<p>PVStructure has a new template member</p>
|
||||||
|
|
||||||
|
<pre><code>getSubFieldT(std::string const &fieldName)
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>that is like <b>getSubField</b> except that it throws a runtime_error
|
||||||
|
instead of returning null.</p>
|
||||||
|
|
||||||
|
<h2>findSubField method removed from PVStructure</h2>
|
||||||
|
|
||||||
|
<p>This was mainly used in the implementation of getSubField. With a change to
|
||||||
|
the latter, findSubField was removed.</p>
|
||||||
|
|
||||||
<h2>New stream operators</h2>
|
<h2>New stream operators</h2>
|
||||||
|
|
||||||
<p>New steam operators are available for Field and PVField.
|
<p>New steam operators are available for Field and PVField.
|
||||||
Before to print a Field (or any extension) or a PVField (or any extension)
|
Before to print a Field (or any extension) or a PVField (or any extension)
|
||||||
it was necessary to have code like:</p>
|
it was necessary to have code like:</p>
|
||||||
<pre><code> void print(StructureConstPtr struct, PVStructurePtr pv)
|
|
||||||
|
<pre><code> void print(StructureConstPtr struc, PVStructurePtr pv)
|
||||||
{
|
{
|
||||||
if(struct) {
|
if(struc) {
|
||||||
cout << *struct << endl;
|
cout << *struc << endl;
|
||||||
} else {
|
} else {
|
||||||
cout << "nullptr\n"
|
cout << "nullptr\n"
|
||||||
}
|
}
|
||||||
if(pv) {
|
if(pv) {
|
||||||
cout << *.struct << endl;
|
cout << *.struc << endl;
|
||||||
} else {
|
} else {
|
||||||
cout << "nullptr\n"
|
cout << "nullptr\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Now it can be done as follows:</p>
|
<p>Now it can be done as follows:</p>
|
||||||
<pre><code> void print(StructureConstPtr struct, PVStructurePtr pv)
|
|
||||||
|
<pre><code> void print(StructureConstPtr struc, PVStructurePtr pv)
|
||||||
{
|
{
|
||||||
cout << struct << endl;
|
cout << struc << endl;
|
||||||
cout << pv << endl;
|
cout << pv << endl;
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h2>New method getAs that is like getSubField except that it throws exception</h2>
|
|
||||||
<p><b>PVStructure</b> has a new template member <b>getAs(const char *name)</b>
|
<h2>New template version of Structure::getField</h2>
|
||||||
that is like <b>getSubField</b> except that it throws a runtime_error
|
|
||||||
instead of returning null.</p>
|
<p>A new template getField method has been added to Structure</p>
|
||||||
<h1>Release 4.0</h1>
|
|
||||||
|
<p>template<typename FT->
|
||||||
|
std::tr1::shared_ptr< const FT-> getField(std::string const &fieldName) const </p>
|
||||||
|
|
||||||
|
<p>Can be used, for example, as follows:</p>
|
||||||
|
|
||||||
|
<pre><code>StructurePtr tsStruc = struc->getField<Structure>("timeStamp");
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<h2>Fixes for static initialisation order issues</h2>
|
||||||
|
|
||||||
|
<p>Certain static builds (in particular Windows builds) of applications using
|
||||||
|
pvData had issues due to PVStructure::DEFAULT_ID being used before being initialised. This has been fixed.</p>
|
||||||
|
|
||||||
|
<h2>CreateRequest change</h2>
|
||||||
|
|
||||||
|
<p>createRequest could cause a SEGFAULT if passed a bad argument.
|
||||||
|
This has been changed so the it returns a null pvStructure
|
||||||
|
and provides an error.</p>
|
||||||
|
|
||||||
|
<h1>Release 4.0.3</h1>
|
||||||
|
|
||||||
<p>The main changes since release 3.0.2 are:</p>
|
<p>The main changes since release 3.0.2 are:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>array semantics now enforce Copy On Write.</li>
|
<li>array semantics now enforce Copy On Write.</li>
|
||||||
<li>String no longer defined.</li>
|
<li>String no longer defined.</li>
|
||||||
@@ -70,21 +269,31 @@ instead of returning null.</p>
|
|||||||
<li>copy is new.</li>
|
<li>copy is new.</li>
|
||||||
<li>monitorPlugin is new.</li>
|
<li>monitorPlugin is new.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2>New Semantics for Arrays</h2>
|
<h2>New Semantics for Arrays</h2>
|
||||||
|
|
||||||
<p>PVScalarArray, PVStructureArray, and PVUnionArray all enforce COW (Copy On Write) Semantics.
|
<p>PVScalarArray, PVStructureArray, and PVUnionArray all enforce COW (Copy On Write) Semantics.
|
||||||
In order to limit memory usage the storage for raw data is managed via a new shared_vector facility.
|
In order to limit memory usage the storage for raw data is managed via a new shared<em>vector facility.
|
||||||
This allows multiple instances of array data to use the shared raw data.
|
This allows multiple instances of array data to use the shared raw data.
|
||||||
COW is implemented via shared_vectors of const data, i. e. data that can not be modified.</p>
|
COW is implemented via shared</em>vectors of const data, i. e. data that can not be modified.</p>
|
||||||
|
|
||||||
<h2>String no longer defined</h2>
|
<h2>String no longer defined</h2>
|
||||||
|
|
||||||
<p>This is replaced by std::string.</p>
|
<p>This is replaced by std::string.</p>
|
||||||
|
|
||||||
<h2>timeStamp and valueAlarm name changes</h2>
|
<h2>timeStamp and valueAlarm name changes</h2>
|
||||||
|
|
||||||
<p>In timeStamp nanoSeconds is changed to nanoseconds.</p>
|
<p>In timeStamp nanoSeconds is changed to nanoseconds.</p>
|
||||||
<p>In valueAlarm hystersis is changed to hysteresis</p>
|
|
||||||
|
<p>In valueAlarm hysteresis is changed to hysteresis</p>
|
||||||
|
|
||||||
<h2>toString replaced by stream I/O</h2>
|
<h2>toString replaced by stream I/O</h2>
|
||||||
|
|
||||||
<p>pvData.h and pvIntrospect no longer defines toString
|
<p>pvData.h and pvIntrospect no longer defines toString
|
||||||
Instead they have stream support.
|
Instead they have stream support.
|
||||||
pvIntrospect uses method dump and pvData uses dumpValue.
|
pvIntrospect uses method dump and pvData uses dumpValue.
|
||||||
For example:</p>
|
For example:</p>
|
||||||
|
|
||||||
<pre><code> PVDoublePtr pvValue;
|
<pre><code> PVDoublePtr pvValue;
|
||||||
String buffer;
|
String buffer;
|
||||||
pvValue->toString(&buffer);
|
pvValue->toString(&buffer);
|
||||||
@@ -93,27 +302,44 @@ For example:</p>
|
|||||||
pvValue->getField()->toString(&buffer);
|
pvValue->getField()->toString(&buffer);
|
||||||
cout << buffer << evdl;
|
cout << buffer << evdl;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>is replaced by</p>
|
<p>is replaced by</p>
|
||||||
|
|
||||||
<pre><code> PVDoublePtr pvValue;
|
<pre><code> PVDoublePtr pvValue;
|
||||||
cout << *pvValue << endl
|
cout << *pvValue << endl
|
||||||
cout << *pvValue->getField() << endl;
|
cout << *pvValue->getField() << endl;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<h2>union is a new basic type.</h2>
|
<h2>union is a new basic type.</h2>
|
||||||
|
|
||||||
<p>There are two new basic types: union_t and unionArray.</p>
|
<p>There are two new basic types: union_t and unionArray.</p>
|
||||||
|
|
||||||
<p>A union is like a structure that has a single subfield.
|
<p>A union is like a structure that has a single subfield.
|
||||||
There are two flavors:</p>
|
There are two flavors:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>varient union</b> The field can have any type.</li>
|
<li><b>variant union</b> The field can have any type.</li>
|
||||||
<li><b>union</b> The field can any of specified set of types.</li>
|
<li><b>union</b> The field can any of specified set of types.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>The field type can be dynamically changed.</p>
|
<p>The field type can be dynamically changed.</p>
|
||||||
<h2>copy</h2>
|
|
||||||
|
<h2>copy </h2>
|
||||||
|
|
||||||
<p>This consists of createRequest and pvCopy.
|
<p>This consists of createRequest and pvCopy.
|
||||||
createRequest was moved from pvAccess to here.
|
createRequest was moved from pvAccess to here.
|
||||||
pvCopy is moved from pvDatabaseCPP and now depends
|
pvCopy is moved from pvDatabaseCPP and now depends
|
||||||
only on pvData, i. e. it no longer has any knowledge of PVRecord.</p>
|
only on pvData, i.e. it no longer has any knowledge of PVRecord.</p>
|
||||||
|
|
||||||
<h2>monitorPlugin</h2>
|
<h2>monitorPlugin</h2>
|
||||||
|
|
||||||
<p>This is for is for use by code that implements pvAccess monitors.
|
<p>This is for is for use by code that implements pvAccess monitors.
|
||||||
This is prototype and is subject to debate.</p>
|
This is prototype and is subject to debate.</p>
|
||||||
|
|
||||||
<h1>Release 3.0.2</h1>
|
<h1>Release 3.0.2</h1>
|
||||||
<p>This was the starting point for RELEASE_NOTES</p>
|
|
||||||
|
<p>This was the starting point for RELEASE_NOTES</p>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|||||||
@@ -1,13 +1,157 @@
|
|||||||
Release 4.1 IN DEVELOPMENT
|
Release 6.0.1
|
||||||
===========
|
=============
|
||||||
|
|
||||||
The main changes since release 4.0 are:
|
The changes since release 6.0.0 are:
|
||||||
|
|
||||||
|
* Fix "Problem building pvDataCPP for win32-x86-mingw" (issue #42)
|
||||||
|
* In src/misc/bitSet.cpp #include <algorithm> required for MSVS 2015
|
||||||
|
* In testApp/misc/testTypeCast.cpp print (u)int8 values as integers
|
||||||
|
* Minor documentation updates
|
||||||
|
|
||||||
|
Release 6.0.0
|
||||||
|
=============
|
||||||
|
|
||||||
|
The main changes since release 5.0.4 are:
|
||||||
|
|
||||||
|
* Linux shared library version added
|
||||||
|
* Headers have been moved into pv directories
|
||||||
|
* Bitset functions declared const where possible
|
||||||
|
* Bitset::swap added
|
||||||
|
* Requester::message has default implementation
|
||||||
|
* Serialization/deserialization helpers added
|
||||||
|
* Non-template getSubField char* overload added
|
||||||
|
* MonitorPlugin deprecated
|
||||||
|
* Field name validation performed
|
||||||
|
* Now builds for Cygwin and MinGW targets
|
||||||
|
* Fix for debug build issue.
|
||||||
|
* New license file replaces LICENSE and COPYRIGHT
|
||||||
|
|
||||||
|
Shared library version added
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
Linux shared library version numbers have been added by setting SHRLIB_VERSION
|
||||||
|
(to 6.0 in this case). So shared object will be libpvData.so.6.0 instead of
|
||||||
|
libpvData.so.
|
||||||
|
|
||||||
|
Headers have been moved into pv directories
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
|
E.g. src/property/alarm.h -> src/property/pv/alarm.h
|
||||||
|
|
||||||
|
This facilitates using some IDEs such as Qt Creator.
|
||||||
|
|
||||||
|
Requester::message has default implementation
|
||||||
|
---------------------------------------------
|
||||||
|
|
||||||
|
Requester::message is no longer pure virtual. Default implementation sends
|
||||||
|
string to std::cerr.
|
||||||
|
|
||||||
|
Serialization/deserialization helpers added
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
|
A helper function, serializeToVector, has been added which serializes a
|
||||||
|
Serializable object into a standard vector of UInt8s.
|
||||||
|
|
||||||
|
Similarly a function deserializeFromVector deserializes a standard vector into
|
||||||
|
a Deserializable object.
|
||||||
|
|
||||||
|
A function deserializeFromBuffer deserializes a ByteBuffer into a
|
||||||
|
Deserializable object.
|
||||||
|
|
||||||
|
Field name validation performed
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
On creating a Structure or Union the field names are now validated.
|
||||||
|
|
||||||
|
Valid characters for a field name are upper or lowercase letters, numbers and
|
||||||
|
underscores and intial numbers are invalid, i.e. names must be of the form
|
||||||
|
[A-Za-z_][A-Za-z0-9_]*.
|
||||||
|
|
||||||
|
Now builds for Cygwin and MinGW targets
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
Includes cross-compiling MinGW on Linux.
|
||||||
|
|
||||||
|
|
||||||
|
Release 5.0.4
|
||||||
|
=============
|
||||||
|
|
||||||
|
The changes since release 5.0.3 are:
|
||||||
|
|
||||||
|
* Fixed bitset serialization (issue #24)
|
||||||
|
* Fixed truncation in BitSet::or_and (issue #27)
|
||||||
|
|
||||||
|
Fixed bitset serialization (issue #24)
|
||||||
|
--------------------------------------
|
||||||
|
|
||||||
|
C++ bitset serialization was not consistent with the C++ deserialization and
|
||||||
|
Java code in some instances (depending on the endianness of the serializer and
|
||||||
|
deserializer) when the number of bits was 56-63 modulo 64. C++ serialization
|
||||||
|
has been fixed.
|
||||||
|
|
||||||
|
Fix exposed issue in deserialization on 32-bit platforms which
|
||||||
|
has also been corrected.
|
||||||
|
|
||||||
|
Fixed truncation in BitSet::or_and (issue #27)
|
||||||
|
----------------------------------------------
|
||||||
|
|
||||||
|
If n, n1 and n2 words are used to store the values of the bitsets bitset,
|
||||||
|
bitset1 and bitset2 respectively then max(n, min(n1,n2)) words are needed
|
||||||
|
to store bitset.or_(bitset1, bitset2).
|
||||||
|
|
||||||
|
Previously min(n1,n2) words were used and the result would be truncated in
|
||||||
|
some instances. This has been fixed.
|
||||||
|
|
||||||
|
|
||||||
|
Release 5.0.3
|
||||||
|
=============
|
||||||
|
|
||||||
|
The only change since release 5.0.2 is:
|
||||||
|
|
||||||
|
Fixed buffer overflow in PVUnion::serialize() (issue #20)
|
||||||
|
---------------------------------------------------------
|
||||||
|
|
||||||
|
A PVUnion whose stored value was null was serialized without checking
|
||||||
|
whether the buffer had sufficient capacity. This has been fixed by calling
|
||||||
|
ensureBuffer().
|
||||||
|
|
||||||
|
|
||||||
|
Release 5.0.2
|
||||||
|
=============
|
||||||
|
|
||||||
|
The main changes since release 4.0.3 are:
|
||||||
|
|
||||||
|
* Deprecated getXXXField() methods have been removed from PVStructure
|
||||||
* Convert copy methods and equals operators (re)moved
|
* Convert copy methods and equals operators (re)moved
|
||||||
* Convert::copyUnion now always copies between subfields.
|
* Convert::copyUnion now always copies between subfields.
|
||||||
* CreateRequest prevents a possible SEGFAULT.
|
* New method getSubFieldT, like getSubField except it throws an exception
|
||||||
* New stream operators for Field and PVField are provided.
|
* findSubField method removed from PVStructure
|
||||||
* New method getSubFieldT that is like getSubField except that it throws exception
|
* New stream operators for Field and PVField are provided
|
||||||
|
* New template versions of Structure::getField
|
||||||
|
* Fixes for static initialisation order issues
|
||||||
|
* CreateRequest prevents a possible SEGFAULT
|
||||||
|
|
||||||
|
|
||||||
|
Deprecated getXXXField methods have been removed from PVStructure
|
||||||
|
-----------------------------------------------------------------
|
||||||
|
|
||||||
|
The following methods have been removed from PVStructure
|
||||||
|
|
||||||
|
* getBooleanField
|
||||||
|
* getByteField, getShortField, getIntField, getLongField
|
||||||
|
* getUByteField, getUShortField, getUIntField, getULongField
|
||||||
|
* getStringField
|
||||||
|
* getStructureField, getUnionField
|
||||||
|
* getScalarArrayField, getStructureArrayField, getUnionArrayField
|
||||||
|
|
||||||
|
Use template getSubField instead, e.g. use
|
||||||
|
|
||||||
|
getSubField< PVInt >(fieldName)
|
||||||
|
|
||||||
|
in place of
|
||||||
|
|
||||||
|
getIntField(fieldName)
|
||||||
|
|
||||||
|
|
||||||
Convert copy methods and equals operators
|
Convert copy methods and equals operators
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
@@ -21,7 +165,7 @@ Methods
|
|||||||
|
|
||||||
PVField::copyUnchecked(const PVField& from)
|
PVField::copyUnchecked(const PVField& from)
|
||||||
|
|
||||||
where added to allow unchecked copies, to gain performance
|
were added to allow unchecked copies, to gain performance
|
||||||
where checked are not needed (anymore).
|
where checked are not needed (anymore).
|
||||||
|
|
||||||
In addition:
|
In addition:
|
||||||
@@ -29,20 +173,33 @@ In addition:
|
|||||||
- equals methods were remove in favour of PVField::operator==.
|
- equals methods were remove in favour of PVField::operator==.
|
||||||
- operator== methods where moved to pvIntrospect.h and pvData.h
|
- operator== methods where moved to pvIntrospect.h and pvData.h
|
||||||
|
|
||||||
|
|
||||||
Convert::copyUnion
|
Convert::copyUnion
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
Before this method, depending on types for to and from,
|
Before this method, depending on types for to and from,
|
||||||
sometimes did a shallow cppy, i. e. just made to shared_ptr for to
|
sometimes did a shallow copy, i.e. just made to shared_ptr for to
|
||||||
share the same data as from.
|
share the same data as from.
|
||||||
Now it always copies between the subfield of to and from.
|
Now it always copies between the subfield of to and from.
|
||||||
|
|
||||||
CreateRequest change
|
|
||||||
|
New method getSubFieldT, like getSubField except it throws an exception
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
createRequest could cause a SEGFAULT if passed a bad argument.
|
PVStructure has a new template member
|
||||||
This has been changed so the it returns a null pvStructure
|
|
||||||
and provies an error.
|
getSubFieldT(std::string const &fieldName)
|
||||||
|
|
||||||
|
that is like <b>getSubField</b> except that it throws a runtime_error
|
||||||
|
instead of returning null.
|
||||||
|
|
||||||
|
|
||||||
|
findSubField method removed from PVStructure
|
||||||
|
--------------------------------------------
|
||||||
|
|
||||||
|
This was mainly used in the implementation of getSubField. With a change to
|
||||||
|
the latter, findSubField was removed.
|
||||||
|
|
||||||
|
|
||||||
New stream operators
|
New stream operators
|
||||||
--------------------
|
--------------------
|
||||||
@@ -51,15 +208,15 @@ New steam operators are available for Field and PVField.
|
|||||||
Before to print a Field (or any extension) or a PVField (or any extension)
|
Before to print a Field (or any extension) or a PVField (or any extension)
|
||||||
it was necessary to have code like:
|
it was necessary to have code like:
|
||||||
|
|
||||||
void print(StructureConstPtr struct, PVStructurePtr pv)
|
void print(StructureConstPtr struc, PVStructurePtr pv)
|
||||||
{
|
{
|
||||||
if(struct) {
|
if(struc) {
|
||||||
cout << *struct << endl;
|
cout << *struc << endl;
|
||||||
} else {
|
} else {
|
||||||
cout << "nullptr\n"
|
cout << "nullptr\n"
|
||||||
}
|
}
|
||||||
if(pv) {
|
if(pv) {
|
||||||
cout << *.struct << endl;
|
cout << *.struc << endl;
|
||||||
} else {
|
} else {
|
||||||
cout << "nullptr\n"
|
cout << "nullptr\n"
|
||||||
}
|
}
|
||||||
@@ -67,21 +224,43 @@ it was necessary to have code like:
|
|||||||
|
|
||||||
Now it can be done as follows:
|
Now it can be done as follows:
|
||||||
|
|
||||||
void print(StructureConstPtr struct, PVStructurePtr pv)
|
void print(StructureConstPtr struc, PVStructurePtr pv)
|
||||||
{
|
{
|
||||||
cout << struct << endl;
|
cout << struc << endl;
|
||||||
cout << pv << endl;
|
cout << pv << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
New method getSubFieldT that is like getSubField except that it throws exception
|
|
||||||
|
New template version of Structure::getField
|
||||||
|
--------------------------------------------
|
||||||
|
|
||||||
|
A new template getField method has been added to Structure
|
||||||
|
|
||||||
|
template<typename FT >
|
||||||
|
std::tr1::shared_ptr< const FT > getField(std::string const &fieldName) const
|
||||||
|
|
||||||
|
Can be used, for example, as follows:
|
||||||
|
|
||||||
|
StructurePtr tsStruc = struc->getField<Structure>("timeStamp");
|
||||||
|
|
||||||
|
|
||||||
|
Fixes for static initialisation order issues
|
||||||
|
--------------------------------------------
|
||||||
|
|
||||||
|
Certain static builds (in particular Windows builds) of applications using
|
||||||
|
pvData had issues due to PVStructure::DEFAULT_ID being used before being initialised. This has been fixed.
|
||||||
|
|
||||||
|
|
||||||
|
CreateRequest change
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
<b>PVStructure</b> has a new template member <b>getSubFieldT(std::string const &fieldName)</b>
|
createRequest could cause a SEGFAULT if passed a bad argument.
|
||||||
that is like <b>getSubField</b> except that it throws a runtime_error
|
This has been changed so the it returns a null pvStructure
|
||||||
instead of returning null.
|
and provides an error.
|
||||||
|
|
||||||
Release 4.0
|
|
||||||
===========
|
Release 4.0.3
|
||||||
|
=============
|
||||||
|
|
||||||
The main changes since release 3.0.2 are:
|
The main changes since release 3.0.2 are:
|
||||||
|
|
||||||
@@ -113,7 +292,7 @@ timeStamp and valueAlarm name changes
|
|||||||
|
|
||||||
In timeStamp nanoSeconds is changed to nanoseconds.
|
In timeStamp nanoSeconds is changed to nanoseconds.
|
||||||
|
|
||||||
In valueAlarm hystersis is changed to hysteresis
|
In valueAlarm hysteresis is changed to hysteresis
|
||||||
|
|
||||||
|
|
||||||
toString replaced by stream I/O
|
toString replaced by stream I/O
|
||||||
@@ -147,7 +326,7 @@ There are two new basic types: union_t and unionArray.
|
|||||||
A union is like a structure that has a single subfield.
|
A union is like a structure that has a single subfield.
|
||||||
There are two flavors:
|
There are two flavors:
|
||||||
|
|
||||||
* <b>varient union</b> The field can have any type.
|
* <b>variant union</b> The field can have any type.
|
||||||
* <b>union</b> The field can any of specified set of types.
|
* <b>union</b> The field can any of specified set of types.
|
||||||
|
|
||||||
The field type can be dynamically changed.
|
The field type can be dynamically changed.
|
||||||
@@ -158,7 +337,7 @@ copy
|
|||||||
This consists of createRequest and pvCopy.
|
This consists of createRequest and pvCopy.
|
||||||
createRequest was moved from pvAccess to here.
|
createRequest was moved from pvAccess to here.
|
||||||
pvCopy is moved from pvDatabaseCPP and now depends
|
pvCopy is moved from pvDatabaseCPP and now depends
|
||||||
only on pvData, i. e. it no longer has any knowledge of PVRecord.
|
only on pvData, i.e. it no longer has any knowledge of PVRecord.
|
||||||
|
|
||||||
monitorPlugin
|
monitorPlugin
|
||||||
-------------
|
-------------
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
<h1>TODO</h1>
|
|
||||||
<h2>printer</h2>
|
|
||||||
<p>pv/printer.h is not used.</p>
|
|
||||||
<h2>doxygen</h2>
|
|
||||||
<p>There is a lot of public code that does not have doxygen tags.</p>
|
|
||||||
<h2>postMonitor: PVUnion, PVUnionArray, and PVStructureArray</h2>
|
|
||||||
<p>PVUnion, PVUnionArray, and PVStructureArray all have elements
|
|
||||||
that are treated like a top level field.</p>
|
|
||||||
<p>Currently if a subField of any of these is changed postMonitor is not called for the field itself.</p>
|
|
||||||
<p>David asked if this could be changed so that it is called.
|
|
||||||
Marty thinks this may not be a good idea.</p>
|
|
||||||
<h2>valueAlarm</h2>
|
|
||||||
<p>normativeTypes.html describes valueAlarm only for a value field that has type
|
|
||||||
double.
|
|
||||||
The implementation also supports all the numeric scalar types.</p>
|
|
||||||
<h2>monitorPlugin</h2>
|
|
||||||
<p>A debate is on-going about what semantics should be.</p>
|
|
||||||
@@ -6,19 +6,6 @@ doxygen
|
|||||||
|
|
||||||
There is a lot of public code that does not have doxygen tags.
|
There is a lot of public code that does not have doxygen tags.
|
||||||
|
|
||||||
|
|
||||||
postMonitor: PVUnion, PVUnionArray, and PVStructureArray
|
|
||||||
--------
|
|
||||||
|
|
||||||
PVUnion, PVUnionArray, and PVStructureArray all have elements
|
|
||||||
that are treated like a top level field.
|
|
||||||
|
|
||||||
Currently if a subField of any of these is changed postMonitor is not called for the field itself.
|
|
||||||
|
|
||||||
David asked if this could be changed so that it is called.
|
|
||||||
Marty thinks this may not be a good idea.
|
|
||||||
|
|
||||||
|
|
||||||
valueAlarm
|
valueAlarm
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
|||||||
@@ -35,33 +35,16 @@
|
|||||||
|
|
||||||
<div class="head">
|
<div class="head">
|
||||||
<h1>EPICS pvDataCPP</h1>
|
<h1>EPICS pvDataCPP</h1>
|
||||||
<!-- Maturity: Working Draft or Request for Comments, or Recommendation, and date. -->
|
|
||||||
|
|
||||||
<h2 class="nocount">EPICS v4 Working Group, Working Draft, 23-June-2015</h2>
|
<h2 class="nocount">Release 6.0.1 - 2016-09-14</h2>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Latest version:</dt>
|
|
||||||
<dd><a
|
|
||||||
href="pvDataCPP.html">pvDataCPP.html</a>
|
|
||||||
</dd>
|
|
||||||
<dt>This version:</dt>
|
|
||||||
<dd><a
|
|
||||||
href="pvDataCPP_20150623.html">pvDataCPP_20150623.html</a>
|
|
||||||
</dd>
|
|
||||||
<dt>Previous version:</dt>
|
|
||||||
<dd><a
|
|
||||||
href="pvDataCPP_20141110.html">pvDataCPP_20141110.html</a>
|
|
||||||
</dd>
|
|
||||||
<dt>Editors:</dt>
|
<dt>Editors:</dt>
|
||||||
<dd>Marty Kraimer, BNL</dd>
|
<dd>Marty Kraimer, BNL</dd>
|
||||||
<dd>Michael Davidsaver, BNL</dd>
|
<dd>Michael Davidsaver, BNL</dd>
|
||||||
<dd>Matej Sekoranja, CosyLab</dd>
|
<dd>Matej Sekoranja, CosyLab</dd>
|
||||||
<dd>David Hickin, Diamond Light Source</dd>
|
<dd>David Hickin, Diamond Light Source</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<p class="copyright">This product is made available subject to acceptance of the <a
|
|
||||||
href="http://epics-pvdata.sourceforge.net/LICENSE.html">EPICS open source
|
|
||||||
license.</a></p>
|
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -79,7 +62,8 @@ V4 control system programming environment:<br />
|
|||||||
|
|
||||||
<h2 class="nocount">Status of this Document</h2>
|
<h2 class="nocount">Status of this Document</h2>
|
||||||
|
|
||||||
<p>This is the 23-June-2015 version of the C++ implementation of pvData.
|
<p>This is the 14-September-2016 version for the 6.0.1 release of the
|
||||||
|
C++ implementation of pvData.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>RELEASE_NOTES.md provides changes since the last release.
|
<p>RELEASE_NOTES.md provides changes since the last release.
|
||||||
@@ -4887,7 +4871,7 @@ Monitor provides:
|
|||||||
monitor. It, together with the queue facility, provides support for
|
monitor. It, together with the queue facility, provides support for
|
||||||
monitor queues.
|
monitor queues.
|
||||||
</dd>
|
</dd>
|
||||||
<dt>monitorPlugin</dt>
|
<dt>monitorPlugin [Deprecated]</dt>
|
||||||
<dd>This is support for implementing monitor plugins.
|
<dd>This is support for implementing monitor plugins.
|
||||||
A monitor plugin can be developed that has no knowledge
|
A monitor plugin can be developed that has no knowledge
|
||||||
of pvAccess but only pvData.
|
of pvAccess but only pvData.
|
||||||
@@ -5069,7 +5053,7 @@ where
|
|||||||
<dl>
|
<dl>
|
||||||
<dt>monitor</dt>
|
<dt>monitor</dt>
|
||||||
<dd>Used by code that implements pvAccess monitors.</dd>
|
<dd>Used by code that implements pvAccess monitors.</dd>
|
||||||
<dt>monitorPlugin</dt>
|
<dt>monitorPlugin [Deprecated]</dt>
|
||||||
<dd>Code that provides special semantics for monitors.</dd>
|
<dd>Code that provides special semantics for monitors.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<h3>monitor</h3>
|
<h3>monitor</h3>
|
||||||
@@ -5185,6 +5169,8 @@ It has the methods:</p>
|
|||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<h3>monitorPlugin</h3>
|
<h3>monitorPlugin</h3>
|
||||||
|
<p>[ MonitorPlugin and related classes MonitorPluginCreator and
|
||||||
|
MonitorPluginManager are deprecated.]</p>
|
||||||
<pre>
|
<pre>
|
||||||
class MonitorPlugin
|
class MonitorPlugin
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -6,16 +6,38 @@
|
|||||||
#
|
#
|
||||||
# Author: Ralph Lange <ralph.lange@gmx.de>
|
# Author: Ralph Lange <ralph.lange@gmx.de>
|
||||||
# Copyright (C) 2013 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
|
# Copyright (C) 2013 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
|
||||||
# Copyright (C) 2014-2015 ITER Organization.
|
# Copyright (C) 2014-2016 ITER Organization.
|
||||||
# All rights reserved. Use is subject to license terms.
|
# All rights reserved. Use is subject to license terms.
|
||||||
|
|
||||||
|
installTool () {
|
||||||
|
local module=$1
|
||||||
|
local version=$2
|
||||||
|
|
||||||
|
wget -nv https://openepics.ci.cloudbees.com/job/${module}-${version}_Build/lastSuccessfulBuild/artifact/${module,,}-${version}.CB-dist.tar.gz
|
||||||
|
tar -xzf ${module,,}-${version}.CB-dist.tar.gz
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
tar -xzf ${module}.CB-dist.tar.gz
|
||||||
|
}
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
# Determine EPICS Base version
|
# Defaults for EPICS Base and MB
|
||||||
|
|
||||||
DEFAULT_BASE=3.14.12.5
|
DEFAULT_BASE=3.15.4
|
||||||
|
BASE=${BASE:-${DEFAULT_BASE}}
|
||||||
BASE=${1:-${DEFAULT_BASE}}
|
MB=${MB:-"NO_MICROBENCH"}
|
||||||
USE_MB=${2:-"MB_NO"}
|
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
# Fetch and unpack dependencies
|
# Fetch and unpack dependencies
|
||||||
@@ -26,8 +48,8 @@ rm -fr ${STUFF}
|
|||||||
mkdir -p ${STUFF}
|
mkdir -p ${STUFF}
|
||||||
cd ${STUFF}
|
cd ${STUFF}
|
||||||
|
|
||||||
wget -nv https://openepics.ci.cloudbees.com/job/Base-${BASE}_Build/lastSuccessfulBuild/artifact/base-${BASE}.CB-dist.tar.gz
|
installTool Boost 1.61.0
|
||||||
tar -xzf base-${BASE}.CB-dist.tar.gz
|
installTool Base ${BASE}
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
# Build
|
# Build
|
||||||
@@ -53,4 +75,4 @@ make runtests
|
|||||||
###########################################
|
###########################################
|
||||||
# Create distribution
|
# Create distribution
|
||||||
|
|
||||||
tar czf pvData.CB-dist.tar.gz lib include COPYRIGHT LICENSE
|
tar czf pvData.CB-dist.tar.gz lib include LICENSE
|
||||||
|
|||||||
@@ -6,15 +6,39 @@
|
|||||||
#
|
#
|
||||||
# Author: Ralph Lange <ralph.lange@gmx.de>
|
# Author: Ralph Lange <ralph.lange@gmx.de>
|
||||||
# Copyright (C) 2013 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
|
# Copyright (C) 2013 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
|
||||||
# Copyright (C) 2014-2015 ITER Organization.
|
# Copyright (C) 2014-2016 ITER Organization.
|
||||||
# All rights reserved. Use is subject to license terms.
|
# All rights reserved. Use is subject to license terms.
|
||||||
|
|
||||||
|
installTool () {
|
||||||
|
local module=$1
|
||||||
|
local version=$2
|
||||||
|
|
||||||
|
wget -nv https://openepics.ci.cloudbees.com/job/${module}-${version}_Build/lastSuccessfulBuild/artifact/${module,,}-${version}.CB-dist.tar.gz
|
||||||
|
tar -xzf ${module,,}-${version}.CB-dist.tar.gz
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
tar -xzf ${module}.CB-dist.tar.gz
|
||||||
|
}
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
# Determine EPICS Base version
|
# Defaults for EPICS Base and parameters
|
||||||
|
|
||||||
DEFAULT_BASE=3.14.12.5
|
BASE=3.15.4
|
||||||
|
PUBLISH=${PUBLISH:-NO}
|
||||||
BASE=${1:-${DEFAULT_BASE}}
|
BRANCH=${BRANCH:-master}
|
||||||
|
MB=NO_MICROBENCH
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
# Fetch and unpack dependencies
|
# Fetch and unpack dependencies
|
||||||
@@ -25,16 +49,14 @@ rm -fr ${STUFF}
|
|||||||
mkdir -p ${STUFF}
|
mkdir -p ${STUFF}
|
||||||
cd ${STUFF}
|
cd ${STUFF}
|
||||||
|
|
||||||
wget -nv https://openepics.ci.cloudbees.com/job/Doxygen-1.8.3_Build/lastSuccessfulBuild/artifact/doxygen-1.8.3.CB-dist.tar.gz
|
installTool Doxygen 1.8.11
|
||||||
tar -xzf doxygen-1.8.3.CB-dist.tar.gz
|
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
# Generate
|
# Generate
|
||||||
|
|
||||||
cd ${WORKSPACE}
|
cd ${WORKSPACE}
|
||||||
|
|
||||||
wget -nv https://openepics.ci.cloudbees.com/job/pvDataCPP_Build/BASE=${BASE},USE_MB=MB_NO/lastSuccessfulBuild/artifact/pvData.CB-dist.tar.gz
|
installE4 pvData ${BRANCH}
|
||||||
tar -xzf pvData.CB-dist.tar.gz
|
|
||||||
|
|
||||||
export PATH=${STUFF}/bin:${PATH}
|
export PATH=${STUFF}/bin:${PATH}
|
||||||
|
|
||||||
@@ -43,4 +65,10 @@ doxygen
|
|||||||
###########################################
|
###########################################
|
||||||
# Publish
|
# Publish
|
||||||
|
|
||||||
rsync -aqP --delete -e ssh documentation epics-jenkins@web.sourceforge.net:/home/project-web/epics-pvdata/htdocs/docbuild/pvDataCPP/tip
|
if [ "${PUBLISH}" != "NO" ]; then
|
||||||
|
# Upload explicit dummy to ensure target directory exists
|
||||||
|
echo "Created by CloudBees Jenkins upload job. Should be deleted as part of the job." > DUMMY
|
||||||
|
rsync -q -e ssh DUMMY epics-jenkins@web.sourceforge.net:/home/project-web/epics-pvdata/htdocs/docbuild/pvDataCPP/${PUBLISH}/
|
||||||
|
|
||||||
|
rsync -aqP --delete -e ssh documentation epics-jenkins@web.sourceforge.net:/home/project-web/epics-pvdata/htdocs/docbuild/pvDataCPP/${PUBLISH}/
|
||||||
|
fi
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
TOP = ..
|
TOP = ..
|
||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG
|
||||||
|
|
||||||
INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv
|
|
||||||
USR_INCLUDES += -I$(INSTALL_LOCATION)/include
|
|
||||||
|
|
||||||
PVDATA_SRC = $(TOP)/src
|
PVDATA_SRC = $(TOP)/src
|
||||||
|
|
||||||
include $(PVDATA_SRC)/misc/Makefile
|
include $(PVDATA_SRC)/misc/Makefile
|
||||||
@@ -20,5 +17,8 @@ LIBRARY = pvData
|
|||||||
|
|
||||||
pvData_LIBS += Com
|
pvData_LIBS += Com
|
||||||
|
|
||||||
|
# shared library ABI version.
|
||||||
|
SHRLIB_VERSION ?= 6.0
|
||||||
|
|
||||||
include $(TOP)/configure/RULES
|
include $(TOP)/configure/RULES
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
SRC_DIRS += $(PVDATA_SRC)/copy
|
SRC_DIRS += $(PVDATA_SRC)/copy
|
||||||
|
|
||||||
INC += createRequest.h
|
INC += pv/createRequest.h
|
||||||
INC += pvCopy.h
|
INC += pv/pvCopy.h
|
||||||
|
|
||||||
LIBSRCS += createRequest.cpp
|
LIBSRCS += createRequest.cpp
|
||||||
LIBSRCS += pvCopy.cpp
|
LIBSRCS += pvCopy.cpp
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* pvAccessCPP is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#include <epicsMutex.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
|
|
||||||
#include <pv/pvData.h>
|
#include <pv/pvData.h>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/*createRequest.h*/
|
/*createRequest.h*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* pvDataCPP is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CREATEREQUEST_H
|
#ifndef CREATEREQUEST_H
|
||||||
@@ -38,7 +37,6 @@ class epicsShareClass CreateRequest {
|
|||||||
* Create a request structure for the create calls in Channel.
|
* Create a request structure for the create calls in Channel.
|
||||||
* See the package overview documentation for details.
|
* See the package overview documentation for details.
|
||||||
* @param request The field request. See the package overview documentation for details.
|
* @param request The field request. See the package overview documentation for details.
|
||||||
* @param requester The requester;
|
|
||||||
* @return The request PVStructure if a valid request was given.
|
* @return The request PVStructure if a valid request was given.
|
||||||
* If a NULL PVStructure is returned then getMessage will return
|
* If a NULL PVStructure is returned then getMessage will return
|
||||||
* the reason.
|
* the reason.
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* pvCopy.h */
|
/* pvCopy.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author Marty Kraimer
|
* @author Marty Kraimer
|
||||||
@@ -116,8 +115,8 @@ public:
|
|||||||
PVStructurePtr const &masterPVStructure,
|
PVStructurePtr const &masterPVStructure,
|
||||||
PVFieldPtr const &masterPVField);
|
PVFieldPtr const &masterPVField);
|
||||||
/**
|
/**
|
||||||
* Given a offset in the copy get the corresponding field in pvMaster.
|
* Given an offset in the copy get the corresponding field in pvMaster.
|
||||||
* @param offset The offset in the copy.
|
* @param structureOffset The offset in the copy.
|
||||||
*/
|
*/
|
||||||
PVFieldPtr getMasterPVField(std::size_t structureOffset);
|
PVFieldPtr getMasterPVField(std::size_t structureOffset);
|
||||||
/**
|
/**
|
||||||
@@ -159,7 +158,7 @@ public:
|
|||||||
BitSetPtr const &bitSet);
|
BitSetPtr const &bitSet);
|
||||||
/**
|
/**
|
||||||
* Get the options for the field at the specified offset.
|
* Get the options for the field at the specified offset.
|
||||||
* @param offset the offset in copy.
|
* @param fieldOffset the offset in copy.
|
||||||
* @returns A NULL is returned if no options were specified for the field.
|
* @returns A NULL is returned if no options were specified for the field.
|
||||||
* If options were specified,PVStructurePtr is a structures
|
* If options were specified,PVStructurePtr is a structures
|
||||||
* with a set of PVString subfields that specify name,value pairs.s
|
* with a set of PVString subfields that specify name,value pairs.s
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* pvCopy.cpp */
|
/* pvCopy.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author Marty Kraimer
|
* @author Marty Kraimer
|
||||||
@@ -13,6 +12,8 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#include <epicsThread.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
|
|
||||||
#include <pv/thread.h>
|
#include <pv/thread.h>
|
||||||
@@ -81,7 +82,7 @@ PVCopyPtr PVCopy::create(
|
|||||||
pvStructure = pvRequest->getSubField<PVStructure>(structureName);
|
pvStructure = pvRequest->getSubField<PVStructure>(structureName);
|
||||||
if(!pvStructure) return NULLPVCopy;
|
if(!pvStructure) return NULLPVCopy;
|
||||||
}
|
}
|
||||||
} else if(pvStructure->getSubField("field")) {
|
} else if(pvStructure->getSubField<PVStructure>("field")) {
|
||||||
pvStructure = pvRequest->getSubField<PVStructure>("field");
|
pvStructure = pvRequest->getSubField<PVStructure>("field");
|
||||||
}
|
}
|
||||||
PVCopyPtr pvCopy = PVCopyPtr(new PVCopy(pvMaster));
|
PVCopyPtr pvCopy = PVCopyPtr(new PVCopy(pvMaster));
|
||||||
@@ -348,7 +349,7 @@ bool PVCopy::init(epics::pvData::PVStructurePtr const &pvRequest)
|
|||||||
if(len==string::npos) entireMaster = true;
|
if(len==string::npos) entireMaster = true;
|
||||||
if(len==0) entireMaster = true;
|
if(len==0) entireMaster = true;
|
||||||
PVStructurePtr pvOptions;
|
PVStructurePtr pvOptions;
|
||||||
if(len==1 && pvRequest->getSubField("_options")) {
|
if(len==1) {
|
||||||
pvOptions = pvRequest->getSubField<PVStructure>("_options");
|
pvOptions = pvRequest->getSubField<PVStructure>("_options");
|
||||||
}
|
}
|
||||||
if(entireMaster) {
|
if(entireMaster) {
|
||||||
@@ -441,11 +442,8 @@ CopyNodePtr PVCopy::createStructureNodes(
|
|||||||
PVFieldPtr copyPVField = copyPVFields[i];
|
PVFieldPtr copyPVField = copyPVFields[i];
|
||||||
string fieldName = copyPVField->getFieldName();
|
string fieldName = copyPVField->getFieldName();
|
||||||
|
|
||||||
PVStructurePtr requestPVStructure = static_pointer_cast<PVStructure>(
|
PVStructurePtr requestPVStructure = pvFromRequest->getSubField<PVStructure>(fieldName);
|
||||||
pvFromRequest->getSubField(fieldName));
|
PVStructurePtr pvSubFieldOptions = requestPVStructure->getSubField<PVStructure>("_options");
|
||||||
PVStructurePtr pvSubFieldOptions;
|
|
||||||
PVFieldPtr pvField = requestPVStructure->getSubField("_options");
|
|
||||||
if(pvField) pvSubFieldOptions = static_pointer_cast<PVStructure>(pvField);
|
|
||||||
PVFieldPtr pvMasterField;
|
PVFieldPtr pvMasterField;
|
||||||
PVFieldPtrArray const & pvMasterFields = pvMasterStructure->getPVFields();
|
PVFieldPtrArray const & pvMasterFields = pvMasterStructure->getPVFields();
|
||||||
for(size_t j=0; i<pvMasterFields.size(); j++ ) {
|
for(size_t j=0; i<pvMasterFields.size(); j++ ) {
|
||||||
@@ -551,7 +549,7 @@ void PVCopy::updateStructureNodeFromBitSet(
|
|||||||
CopyNodePtrArrayPtr nodes = structureNode->nodes;
|
CopyNodePtrArrayPtr nodes = structureNode->nodes;
|
||||||
for(size_t i=0; i<nodes->size(); i++) {
|
for(size_t i=0; i<nodes->size(); i++) {
|
||||||
CopyNodePtr node = (*nodes)[i];
|
CopyNodePtr node = (*nodes)[i];
|
||||||
PVFieldPtr pvField = pvCopy->getSubField(node->structureOffset);
|
PVFieldPtr pvField = pvCopy->getSubFieldT(node->structureOffset);
|
||||||
if(node->isStructure) {
|
if(node->isStructure) {
|
||||||
PVStructurePtr xxx = static_pointer_cast<PVStructure>(pvField);
|
PVStructurePtr xxx = static_pointer_cast<PVStructure>(pvField);
|
||||||
CopyStructureNodePtr subStructureNode =
|
CopyStructureNodePtr subStructureNode =
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mes
|
* @author mes
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/* Convert.cpp */
|
/* Convert.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -13,6 +12,8 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
|
#include <epicsMutex.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <pv/lock.h>
|
#include <pv/lock.h>
|
||||||
#include <pv/pvIntrospect.h>
|
#include <pv/pvIntrospect.h>
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
/*FieldCreateFactory.cpp*/
|
/*FieldCreateFactory.cpp*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(NOMINMAX)
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -19,6 +18,8 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#include <epicsMutex.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <pv/lock.h>
|
#include <pv/lock.h>
|
||||||
#include <pv/pvIntrospect.h>
|
#include <pv/pvIntrospect.h>
|
||||||
@@ -947,9 +948,53 @@ StructureConstPtr FieldCreate::createStructure () const
|
|||||||
return createStructure(fieldNames,fields);
|
return createStructure(fieldNames,fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
bool xisalnum(char c)
|
||||||
|
{
|
||||||
|
return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9');
|
||||||
|
}
|
||||||
|
|
||||||
|
void validateFieldName(const std::string& n)
|
||||||
|
{
|
||||||
|
// enforce [A-Za-z_][A-Za-z0-9_]*
|
||||||
|
if(n.size()==0)
|
||||||
|
throw std::invalid_argument("zero length field names not allowed");
|
||||||
|
if(n[0]>='0' && n[0]<='9') {
|
||||||
|
std::ostringstream msg;
|
||||||
|
msg<<"Field name \""<<n<<"\" must begin with A-Z, a-z, or '_'";
|
||||||
|
throw std::invalid_argument(msg.str());
|
||||||
|
}
|
||||||
|
for(size_t i=0, N=n.size(); i<N; i++)
|
||||||
|
{
|
||||||
|
char c = n[i];
|
||||||
|
if(xisalnum(c)) {}
|
||||||
|
else {
|
||||||
|
switch(c){
|
||||||
|
case '_':
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
std::ostringstream msg;
|
||||||
|
msg<<"Invalid charactor '"<<c<<"' ("<<(int)c<<") in field name \""<<n<<"\" "
|
||||||
|
"must be A-Z, a-z, 0-9, or '_'";
|
||||||
|
throw std::invalid_argument(msg.str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void validateFieldNames(const StringArray& l)
|
||||||
|
{
|
||||||
|
for(StringArray::const_iterator it=l.begin(), end=l.end(); it!=end; ++it)
|
||||||
|
validateFieldName(*it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StructureConstPtr FieldCreate::createStructure (
|
StructureConstPtr FieldCreate::createStructure (
|
||||||
StringArray const & fieldNames,FieldConstPtrArray const & fields) const
|
StringArray const & fieldNames,FieldConstPtrArray const & fields) const
|
||||||
{
|
{
|
||||||
|
validateFieldNames(fieldNames);
|
||||||
// TODO use std::make_shared
|
// TODO use std::make_shared
|
||||||
std::tr1::shared_ptr<Structure> sp(new Structure(fieldNames,fields), Field::Deleter());
|
std::tr1::shared_ptr<Structure> sp(new Structure(fieldNames,fields), Field::Deleter());
|
||||||
StructureConstPtr structure = sp;
|
StructureConstPtr structure = sp;
|
||||||
@@ -961,6 +1006,7 @@ StructureConstPtr FieldCreate::createStructure (
|
|||||||
StringArray const & fieldNames,
|
StringArray const & fieldNames,
|
||||||
FieldConstPtrArray const & fields) const
|
FieldConstPtrArray const & fields) const
|
||||||
{
|
{
|
||||||
|
validateFieldNames(fieldNames);
|
||||||
// TODO use std::make_shared
|
// TODO use std::make_shared
|
||||||
std::tr1::shared_ptr<Structure> sp(new Structure(fieldNames,fields,id), Field::Deleter());
|
std::tr1::shared_ptr<Structure> sp(new Structure(fieldNames,fields,id), Field::Deleter());
|
||||||
StructureConstPtr structure = sp;
|
StructureConstPtr structure = sp;
|
||||||
@@ -979,6 +1025,7 @@ StructureArrayConstPtr FieldCreate::createStructureArray(
|
|||||||
UnionConstPtr FieldCreate::createUnion (
|
UnionConstPtr FieldCreate::createUnion (
|
||||||
StringArray const & fieldNames,FieldConstPtrArray const & fields) const
|
StringArray const & fieldNames,FieldConstPtrArray const & fields) const
|
||||||
{
|
{
|
||||||
|
validateFieldNames(fieldNames);
|
||||||
// TODO use std::make_shared
|
// TODO use std::make_shared
|
||||||
std::tr1::shared_ptr<Union> sp(new Union(fieldNames,fields), Field::Deleter());
|
std::tr1::shared_ptr<Union> sp(new Union(fieldNames,fields), Field::Deleter());
|
||||||
UnionConstPtr punion = sp;
|
UnionConstPtr punion = sp;
|
||||||
@@ -990,6 +1037,7 @@ UnionConstPtr FieldCreate::createUnion (
|
|||||||
StringArray const & fieldNames,
|
StringArray const & fieldNames,
|
||||||
FieldConstPtrArray const & fields) const
|
FieldConstPtrArray const & fields) const
|
||||||
{
|
{
|
||||||
|
validateFieldNames(fieldNames);
|
||||||
// TODO use std::make_shared
|
// TODO use std::make_shared
|
||||||
std::tr1::shared_ptr<Union> sp(new Union(fieldNames,fields,id), Field::Deleter());
|
std::tr1::shared_ptr<Union> sp(new Union(fieldNames,fields,id), Field::Deleter());
|
||||||
UnionConstPtr punion = sp;
|
UnionConstPtr punion = sp;
|
||||||
@@ -1039,6 +1087,7 @@ StructureConstPtr FieldCreate::appendFields(
|
|||||||
StringArray const & fieldNames,
|
StringArray const & fieldNames,
|
||||||
FieldConstPtrArray const & fields) const
|
FieldConstPtrArray const & fields) const
|
||||||
{
|
{
|
||||||
|
validateFieldNames(fieldNames);
|
||||||
StringArray const & oldNames = structure->getFieldNames();
|
StringArray const & oldNames = structure->getFieldNames();
|
||||||
FieldConstPtrArray const & oldFields = structure->getFields();
|
FieldConstPtrArray const & oldFields = structure->getFields();
|
||||||
size_t oldLen = oldNames.size();
|
size_t oldLen = oldNames.size();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
SRC_DIRS += $(PVDATA_SRC)/factory
|
SRC_DIRS += $(PVDATA_SRC)/factory
|
||||||
|
|
||||||
INC += factory.h
|
INC += pv/factory.h
|
||||||
LIBSRCS += TypeFunc.cpp
|
LIBSRCS += TypeFunc.cpp
|
||||||
LIBSRCS += FieldCreateFactory.cpp
|
LIBSRCS += FieldCreateFactory.cpp
|
||||||
LIBSRCS += PVField.cpp
|
LIBSRCS += PVField.cpp
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/*PVArray.cpp*/
|
/*PVArray.cpp*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
/*PVDataCreateFactory.cpp*/
|
/*PVDataCreateFactory.cpp*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(NOMINMAX)
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -17,6 +16,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
#include <epicsMutex.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <pv/lock.h>
|
#include <pv/lock.h>
|
||||||
#include <pv/pvIntrospect.h>
|
#include <pv/pvIntrospect.h>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/*PVField.cpp*/
|
/*PVField.cpp*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -12,6 +11,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
#include <epicsMutex.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <pv/lock.h>
|
#include <pv/lock.h>
|
||||||
#include <pv/pvData.h>
|
#include <pv/pvData.h>
|
||||||
@@ -24,8 +25,7 @@ using std::string;
|
|||||||
namespace epics { namespace pvData {
|
namespace epics { namespace pvData {
|
||||||
|
|
||||||
PVField::PVField(FieldConstPtr field)
|
PVField::PVField(FieldConstPtr field)
|
||||||
: notImplemented("not implemented"),
|
: parent(NULL),field(field),
|
||||||
parent(NULL),field(field),
|
|
||||||
fieldOffset(0), nextFieldOffset(0),
|
fieldOffset(0), nextFieldOffset(0),
|
||||||
immutable(false)
|
immutable(false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/*PVScalar.cpp*/
|
/*PVScalar.cpp*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -29,22 +28,4 @@ namespace epics { namespace pvData {
|
|||||||
{
|
{
|
||||||
return static_pointer_cast<const Scalar>(PVField::getField());
|
return static_pointer_cast<const Scalar>(PVField::getField());
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
|
||||||
std::ostream& PVScalarValue<int8>::dumpValue(std::ostream& o) const
|
|
||||||
{
|
|
||||||
return o << static_cast<int>(get());
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
|
||||||
std::ostream& PVScalarValue<uint8>::dumpValue(std::ostream& o) const
|
|
||||||
{
|
|
||||||
return o << static_cast<unsigned int>(get());
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
|
||||||
std::ostream& PVScalarValue<boolean>::dumpValue(std::ostream& o) const
|
|
||||||
{
|
|
||||||
return o << std::boolalpha << static_cast<bool>(get());
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/*PVScalarArray.cpp*/
|
/*PVScalarArray.cpp*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/*PVStructure.cpp*/
|
/*PVStructure.cpp*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -52,7 +51,6 @@ PVStructure::PVStructure(StructureConstPtr const & structurePtr)
|
|||||||
size_t numberFields = structurePtr->getNumberFields();
|
size_t numberFields = structurePtr->getNumberFields();
|
||||||
FieldConstPtrArray const & fields = structurePtr->getFields();
|
FieldConstPtrArray const & fields = structurePtr->getFields();
|
||||||
StringArray const & fieldNames = structurePtr->getFieldNames();
|
StringArray const & fieldNames = structurePtr->getFieldNames();
|
||||||
// PVFieldPtrArray * xxx = const_cast<PVFieldPtrArray *>(&pvFields);
|
|
||||||
pvFields.reserve(numberFields);
|
pvFields.reserve(numberFields);
|
||||||
PVDataCreatePtr pvDataCreate = getPVDataCreate();
|
PVDataCreatePtr pvDataCreate = getPVDataCreate();
|
||||||
for(size_t i=0; i<numberFields; i++) {
|
for(size_t i=0; i<numberFields; i++) {
|
||||||
@@ -105,9 +103,9 @@ const PVFieldPtrArray & PVStructure::getPVFields() const
|
|||||||
return pvFields;
|
return pvFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
PVFieldPtr PVStructure::getSubField(string const &fieldName) const
|
PVFieldPtr PVStructure::getSubField(const char * fieldName) const
|
||||||
{
|
{
|
||||||
PVField * field = getSubFieldImpl(fieldName.c_str(), false);
|
PVField * field = getSubFieldImpl(fieldName, false);
|
||||||
if (field)
|
if (field)
|
||||||
return field->shared_from_this();
|
return field->shared_from_this();
|
||||||
else
|
else
|
||||||
@@ -259,9 +257,8 @@ void PVStructure::deserialize(ByteBuffer *pbuffer,
|
|||||||
|
|
||||||
void PVStructure::serialize(ByteBuffer *pbuffer,
|
void PVStructure::serialize(ByteBuffer *pbuffer,
|
||||||
SerializableControl *pflusher, BitSet *pbitSet) const {
|
SerializableControl *pflusher, BitSet *pbitSet) const {
|
||||||
PVStructure* nonConstThis = const_cast<PVStructure*>(this);
|
size_t numberFields = this->getNumberFields();
|
||||||
size_t numberFields = nonConstThis->getNumberFields();
|
size_t offset = this->getFieldOffset();
|
||||||
size_t offset = nonConstThis->getFieldOffset();
|
|
||||||
int32 next = pbitSet->nextSetBit(static_cast<uint32>(offset));
|
int32 next = pbitSet->nextSetBit(static_cast<uint32>(offset));
|
||||||
|
|
||||||
// no more changes or no changes in this structure
|
// no more changes or no changes in this structure
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/*PVStructureArray.cpp*/
|
/*PVStructureArray.cpp*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/*PVUnion.cpp*/
|
/*PVUnion.cpp*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mse
|
* @author mse
|
||||||
@@ -145,10 +144,10 @@ void PVUnion::serialize(ByteBuffer *pbuffer, SerializableControl *pflusher) cons
|
|||||||
if (variant)
|
if (variant)
|
||||||
{
|
{
|
||||||
// write introspection data
|
// write introspection data
|
||||||
if (value.get() == 0)
|
if (value.get() == 0) {
|
||||||
|
pflusher->ensureBuffer(1);
|
||||||
pbuffer->put((int8)-1);
|
pbuffer->put((int8)-1);
|
||||||
else
|
}else {
|
||||||
{
|
|
||||||
pflusher->cachedSerialize(value->getField(), pbuffer);
|
pflusher->cachedSerialize(value->getField(), pbuffer);
|
||||||
value->serialize(pbuffer, pflusher);
|
value->serialize(pbuffer, pflusher);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/*PVUnionArray.cpp*/
|
/*PVUnionArray.cpp*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/* StandardField.cpp */
|
/* StandardField.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -11,6 +10,8 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
#include <epicsMutex.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <pv/lock.h>
|
#include <pv/lock.h>
|
||||||
#include <pv/pvIntrospect.h>
|
#include <pv/pvIntrospect.h>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/* StandardPVField.cpp */
|
/* StandardPVField.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -10,6 +9,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
#include <epicsMutex.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <pv/lock.h>
|
#include <pv/lock.h>
|
||||||
#include <pv/pvIntrospect.h>
|
#include <pv/pvIntrospect.h>
|
||||||
@@ -68,7 +69,7 @@ PVStructurePtr StandardPVField::enumerated(StringArray const &choices)
|
|||||||
PVStructurePtr pvStructure = pvDataCreate->createPVStructure(field);
|
PVStructurePtr pvStructure = pvDataCreate->createPVStructure(field);
|
||||||
PVStringArray::svector cdata(choices.size());
|
PVStringArray::svector cdata(choices.size());
|
||||||
std::copy(choices.begin(), choices.end(), cdata.begin());
|
std::copy(choices.begin(), choices.end(), cdata.begin());
|
||||||
pvStructure->getSubField<PVStringArray>("choices")->replace(freeze(cdata));
|
pvStructure->getSubFieldT<PVStringArray>("choices")->replace(freeze(cdata));
|
||||||
return pvStructure;
|
return pvStructure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +80,7 @@ PVStructurePtr StandardPVField::enumerated(
|
|||||||
PVStructurePtr pvStructure = pvDataCreate->createPVStructure(field);
|
PVStructurePtr pvStructure = pvDataCreate->createPVStructure(field);
|
||||||
PVStringArray::svector cdata(choices.size());
|
PVStringArray::svector cdata(choices.size());
|
||||||
std::copy(choices.begin(), choices.end(), cdata.begin());
|
std::copy(choices.begin(), choices.end(), cdata.begin());
|
||||||
pvStructure->getSubField<PVStringArray>("value.choices")->replace(freeze(cdata));
|
pvStructure->getSubFieldT<PVStringArray>("value.choices")->replace(freeze(cdata));
|
||||||
return pvStructure;
|
return pvStructure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/*TypeFunc.cpp*/
|
/*TypeFunc.cpp*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
/*factory.h*/
|
|
||||||
/**
|
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* @author mrk
|
|
||||||
*/
|
|
||||||
#ifndef FACTORY_H
|
|
||||||
#define FACTORY_H
|
|
||||||
|
|
||||||
namespace epics { namespace pvData {
|
|
||||||
|
|
||||||
enum DebugLevel{noDebug,lowDebug,highDebug};
|
|
||||||
|
|
||||||
}}
|
|
||||||
#endif /*FACTORY_H */
|
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* printer.cpp */
|
/* printer.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <deque>
|
#include <deque>
|
||||||
|
|||||||
17
src/factory/pv/factory.h
Normal file
17
src/factory/pv/factory.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
/*factory.h*/
|
||||||
|
/*
|
||||||
|
* Copyright information and license terms for this software can be
|
||||||
|
* found in the file LICENSE that is included with the distribution
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @author mrk
|
||||||
|
*/
|
||||||
|
#ifndef FACTORY_H
|
||||||
|
#define FACTORY_H
|
||||||
|
|
||||||
|
namespace epics { namespace pvData {
|
||||||
|
|
||||||
|
enum DebugLevel{noDebug,lowDebug,highDebug};
|
||||||
|
|
||||||
|
}}
|
||||||
|
#endif /*FACTORY_H */
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author Marty Kraimer
|
* @author Marty Kraimer
|
||||||
|
|||||||
@@ -2,29 +2,29 @@
|
|||||||
|
|
||||||
SRC_DIRS += $(PVDATA_SRC)/misc
|
SRC_DIRS += $(PVDATA_SRC)/misc
|
||||||
|
|
||||||
INC += noDefaultMethods.h
|
INC += pv/noDefaultMethods.h
|
||||||
INC += lock.h
|
INC += pv/lock.h
|
||||||
INC += requester.h
|
INC += pv/requester.h
|
||||||
INC += serialize.h
|
INC += pv/serialize.h
|
||||||
INC += bitSet.h
|
INC += pv/bitSet.h
|
||||||
INC += byteBuffer.h
|
INC += pv/byteBuffer.h
|
||||||
INC += epicsException.h
|
INC += pv/epicsException.h
|
||||||
INC += serializeHelper.h
|
INC += pv/serializeHelper.h
|
||||||
INC += event.h
|
INC += pv/event.h
|
||||||
INC += thread.h
|
INC += pv/thread.h
|
||||||
INC += executor.h
|
INC += pv/executor.h
|
||||||
INC += timeFunction.h
|
INC += pv/timeFunction.h
|
||||||
INC += timer.h
|
INC += pv/timer.h
|
||||||
INC += queue.h
|
INC += pv/queue.h
|
||||||
INC += messageQueue.h
|
INC += pv/messageQueue.h
|
||||||
INC += destroyable.h
|
INC += pv/destroyable.h
|
||||||
INC += status.h
|
INC += pv/status.h
|
||||||
INC += sharedPtr.h
|
INC += pv/sharedPtr.h
|
||||||
INC += localStaticLock.h
|
INC += pv/localStaticLock.h
|
||||||
INC += typeCast.h
|
INC += pv/typeCast.h
|
||||||
INC += sharedVector.h
|
INC += pv/sharedVector.h
|
||||||
INC += templateMeta.h
|
INC += pv/templateMeta.h
|
||||||
INC += current_function.h
|
INC += pv/current_function.h
|
||||||
|
|
||||||
LIBSRCS += byteBuffer.cpp
|
LIBSRCS += byteBuffer.cpp
|
||||||
LIBSRCS += bitSet.cpp
|
LIBSRCS += bitSet.cpp
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/* bitSet.cpp */
|
/* bitSet.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mes
|
* @author mes
|
||||||
@@ -10,12 +9,38 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include <epicsMutex.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <pv/lock.h>
|
#include <pv/lock.h>
|
||||||
#include <pv/serializeHelper.h>
|
#include <pv/serializeHelper.h>
|
||||||
#include <pv/bitSet.h>
|
#include <pv/bitSet.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* BitSets are packed into arrays of "words." Currently a word is
|
||||||
|
* a long, which consists of 64 bits, requiring 6 address bits.
|
||||||
|
* The choice of word size is determined purely by performance concerns.
|
||||||
|
*/
|
||||||
|
#define ADDRESS_BITS_PER_WORD 6u
|
||||||
|
#define BITS_PER_WORD (1u << ADDRESS_BITS_PER_WORD)
|
||||||
|
#define BYTES_PER_WORD sizeof(uint64)
|
||||||
|
#define BIT_INDEX_MASK (BITS_PER_WORD - 1u)
|
||||||
|
|
||||||
|
/** Used to shift left or right for a partial word mask */
|
||||||
|
#define WORD_MASK ~((uint64)0)
|
||||||
|
|
||||||
|
// index of work containing this bit
|
||||||
|
#define WORD_INDEX(bitn) ((bitn)>>ADDRESS_BITS_PER_WORD)
|
||||||
|
// bit offset within word
|
||||||
|
#define WORD_OFFSET(bitn) ((bitn)&BIT_INDEX_MASK)
|
||||||
|
|
||||||
|
// the words vector should be size()d as small as posible,
|
||||||
|
// so the last word should always have a bit set when the set is not empty
|
||||||
|
#define CHECK_POST() assert(words.empty() || words.back()!=0)
|
||||||
|
|
||||||
namespace epics { namespace pvData {
|
namespace epics { namespace pvData {
|
||||||
|
|
||||||
BitSet::shared_pointer BitSet::create(uint32 nbits)
|
BitSet::shared_pointer BitSet::create(uint32 nbits)
|
||||||
@@ -23,88 +48,59 @@ namespace epics { namespace pvData {
|
|||||||
return BitSet::shared_pointer(new BitSet(nbits));
|
return BitSet::shared_pointer(new BitSet(nbits));
|
||||||
}
|
}
|
||||||
|
|
||||||
BitSet::BitSet() : words(0), wordsLength(0), wordsInUse(0) {
|
BitSet::BitSet() {}
|
||||||
initWords(BITS_PER_WORD);
|
|
||||||
|
|
||||||
|
BitSet::BitSet(uint32 nbits)
|
||||||
|
{
|
||||||
|
words.reserve((nbits == 0) ? 1 : WORD_INDEX(nbits-1) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
BitSet::BitSet(uint32 nbits) : words(0), wordsLength(0), wordsInUse(0) {
|
BitSet::~BitSet() {}
|
||||||
initWords(nbits);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
BitSet::~BitSet() {
|
|
||||||
delete[] words;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BitSet::initWords(uint32 nbits) {
|
|
||||||
uint32 length = (nbits <= 0) ? 1 : wordIndex(nbits-1) + 1;
|
|
||||||
if (words) delete[] words;
|
|
||||||
words = new uint64[length];
|
|
||||||
memset(words, 0, sizeof(uint64)*length);
|
|
||||||
wordsLength = length;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BitSet::recalculateWordsInUse() {
|
void BitSet::recalculateWordsInUse() {
|
||||||
// wordsInUse is unsigned
|
// step back from the end to find the first non-zero element
|
||||||
if (wordsInUse == 0)
|
size_t nsize = words.size();
|
||||||
return;
|
for(; nsize; nsize--) {
|
||||||
|
if(words[nsize-1])
|
||||||
// Traverse the bitset until a used word is found
|
|
||||||
int32 i;
|
|
||||||
for (i = (int32)wordsInUse-1; i >= 0; i--)
|
|
||||||
if (words[i] != 0)
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
wordsInUse = i+1; // The new logical size
|
words.resize(nsize);
|
||||||
|
CHECK_POST();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitSet::ensureCapacity(uint32 wordsRequired) {
|
void BitSet::ensureCapacity(uint32 wordsRequired) {
|
||||||
if (wordsLength < wordsRequired) {
|
words.resize(std::max(words.size(), (size_t)wordsRequired), 0);
|
||||||
|
|
||||||
// create and copy
|
|
||||||
uint64* newwords = new uint64[wordsRequired];
|
|
||||||
memset(newwords, 0, sizeof(uint64)*wordsRequired);
|
|
||||||
memcpy(newwords, words, sizeof(uint64)*wordsLength);
|
|
||||||
if (words) delete[] words;
|
|
||||||
words = newwords;
|
|
||||||
wordsLength = wordsRequired;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitSet::expandTo(uint32 wordIndex) {
|
void BitSet::expandTo(uint32 wordIndex) {
|
||||||
uint32 wordsRequired = wordIndex+1;
|
ensureCapacity(wordIndex+1);
|
||||||
if (wordsInUse < wordsRequired) {
|
|
||||||
ensureCapacity(wordsRequired);
|
|
||||||
wordsInUse = wordsRequired;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitSet::flip(uint32 bitIndex) {
|
void BitSet::flip(uint32 bitIndex) {
|
||||||
|
|
||||||
uint32 wordIdx = wordIndex(bitIndex);
|
uint32 wordIdx = WORD_INDEX(bitIndex);
|
||||||
expandTo(wordIdx);
|
expandTo(wordIdx);
|
||||||
|
|
||||||
words[wordIdx] ^= (((uint64)1) << (bitIndex % BITS_PER_WORD));
|
words[wordIdx] ^= (((uint64)1) << WORD_OFFSET(bitIndex));
|
||||||
|
|
||||||
recalculateWordsInUse();
|
recalculateWordsInUse();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitSet::set(uint32 bitIndex) {
|
void BitSet::set(uint32 bitIndex) {
|
||||||
|
|
||||||
uint32 wordIdx = wordIndex(bitIndex);
|
uint32 wordIdx = WORD_INDEX(bitIndex);
|
||||||
expandTo(wordIdx);
|
expandTo(wordIdx);
|
||||||
|
|
||||||
words[wordIdx] |= (((uint64)1) << (bitIndex % BITS_PER_WORD));
|
words[wordIdx] |= (((uint64)1) << WORD_OFFSET(bitIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitSet::clear(uint32 bitIndex) {
|
void BitSet::clear(uint32 bitIndex) {
|
||||||
|
|
||||||
uint32 wordIdx = wordIndex(bitIndex);
|
uint32 wordIdx = WORD_INDEX(bitIndex);
|
||||||
if (wordIdx >= wordsInUse)
|
if (wordIdx >= words.size())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
words[wordIdx] &= ~(((uint64)1) << (bitIndex % BITS_PER_WORD));
|
words[wordIdx] &= ~(((uint64)1) << WORD_OFFSET(bitIndex));
|
||||||
|
|
||||||
recalculateWordsInUse();
|
recalculateWordsInUse();
|
||||||
}
|
}
|
||||||
@@ -117,14 +113,13 @@ namespace epics { namespace pvData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool BitSet::get(uint32 bitIndex) const {
|
bool BitSet::get(uint32 bitIndex) const {
|
||||||
uint32 wordIdx = wordIndex(bitIndex);
|
uint32 wordIdx = WORD_INDEX(bitIndex);
|
||||||
return ((wordIdx < wordsInUse)
|
return ((wordIdx < words.size())
|
||||||
&& ((words[wordIdx] & (((uint64)1) << (bitIndex % BITS_PER_WORD))) != 0));
|
&& ((words[wordIdx] & (((uint64)1) << WORD_OFFSET(bitIndex))) != 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitSet::clear() {
|
void BitSet::clear() {
|
||||||
while (wordsInUse > 0)
|
words.clear();
|
||||||
words[--wordsInUse] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 BitSet::numberOfTrailingZeros(uint64 i) {
|
uint32 BitSet::numberOfTrailingZeros(uint64 i) {
|
||||||
@@ -153,8 +148,8 @@ namespace epics { namespace pvData {
|
|||||||
|
|
||||||
int32 BitSet::nextSetBit(uint32 fromIndex) const {
|
int32 BitSet::nextSetBit(uint32 fromIndex) const {
|
||||||
|
|
||||||
uint32 u = wordIndex(fromIndex);
|
uint32 u = WORD_INDEX(fromIndex);
|
||||||
if (u >= wordsInUse)
|
if (u >= words.size())
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
uint64 word = words[u] & (WORD_MASK << (fromIndex % BITS_PER_WORD));
|
uint64 word = words[u] & (WORD_MASK << (fromIndex % BITS_PER_WORD));
|
||||||
@@ -162,7 +157,7 @@ namespace epics { namespace pvData {
|
|||||||
while (true) {
|
while (true) {
|
||||||
if (word != 0)
|
if (word != 0)
|
||||||
return (u * BITS_PER_WORD) + numberOfTrailingZeros(word);
|
return (u * BITS_PER_WORD) + numberOfTrailingZeros(word);
|
||||||
if (++u == wordsInUse)
|
if (++u == words.size())
|
||||||
return -1;
|
return -1;
|
||||||
word = words[u];
|
word = words[u];
|
||||||
}
|
}
|
||||||
@@ -171,8 +166,8 @@ namespace epics { namespace pvData {
|
|||||||
int32 BitSet::nextClearBit(uint32 fromIndex) const {
|
int32 BitSet::nextClearBit(uint32 fromIndex) const {
|
||||||
// Neither spec nor implementation handle bitsets of maximal length.
|
// Neither spec nor implementation handle bitsets of maximal length.
|
||||||
|
|
||||||
uint32 u = wordIndex(fromIndex);
|
uint32 u = WORD_INDEX(fromIndex);
|
||||||
if (u >= wordsInUse)
|
if (u >= words.size())
|
||||||
return fromIndex;
|
return fromIndex;
|
||||||
|
|
||||||
uint64 word = ~words[u] & (WORD_MASK << (fromIndex % BITS_PER_WORD));
|
uint64 word = ~words[u] & (WORD_MASK << (fromIndex % BITS_PER_WORD));
|
||||||
@@ -180,79 +175,63 @@ namespace epics { namespace pvData {
|
|||||||
while (true) {
|
while (true) {
|
||||||
if (word != 0)
|
if (word != 0)
|
||||||
return (u * BITS_PER_WORD) + numberOfTrailingZeros(word);
|
return (u * BITS_PER_WORD) + numberOfTrailingZeros(word);
|
||||||
if (++u == wordsInUse)
|
if (++u == words.size())
|
||||||
return wordsInUse * BITS_PER_WORD;
|
return words.size() * BITS_PER_WORD;
|
||||||
word = ~words[u];
|
word = ~words[u];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BitSet::isEmpty() const {
|
bool BitSet::isEmpty() const {
|
||||||
return (wordsInUse == 0);
|
return words.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 BitSet::cardinality() const {
|
uint32 BitSet::cardinality() const {
|
||||||
uint32 sum = 0;
|
uint32 sum = 0;
|
||||||
for (uint32 i = 0; i < wordsInUse; i++)
|
for (uint32 i = 0; i < words.size(); i++)
|
||||||
sum += bitCount(words[i]);
|
sum += bitCount(words[i]);
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 BitSet::size() const {
|
uint32 BitSet::size() const {
|
||||||
return wordsLength * BITS_PER_WORD;
|
return words.size() * BITS_PER_WORD;
|
||||||
}
|
}
|
||||||
|
|
||||||
BitSet& BitSet::operator&=(const BitSet& set) {
|
BitSet& BitSet::operator&=(const BitSet& set) {
|
||||||
// Check for self-assignment!
|
// Check for self-assignment!
|
||||||
if (this == &set) return *this;
|
if (this == &set) return *this;
|
||||||
|
|
||||||
while (wordsInUse > set.wordsInUse)
|
// the result length will be <= the shorter of the two inputs
|
||||||
words[--wordsInUse] = 0;
|
words.resize(std::min(words.size(), set.words.size()), 0);
|
||||||
|
|
||||||
// Perform logical AND on words in common
|
for(size_t i=0, e=words.size(); i<e; i++)
|
||||||
for (uint32 i = 0; i < wordsInUse; i++)
|
|
||||||
words[i] &= set.words[i];
|
words[i] &= set.words[i];
|
||||||
|
|
||||||
recalculateWordsInUse();
|
recalculateWordsInUse();
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
BitSet& BitSet::operator|=(const BitSet& set) {
|
BitSet& BitSet::operator|=(const BitSet& set) {
|
||||||
// Check for self-assignment!
|
// Check for self-assignment!
|
||||||
if (this == &set) return *this;
|
if (this == &set) return *this;
|
||||||
uint32 wordsInCommon = wordsInUse;
|
|
||||||
if(wordsInUse>set.wordsInUse) wordsInCommon = set.wordsInUse;
|
// result length will be the same as the longer of the two inputs
|
||||||
if (wordsInUse < set.wordsInUse) {
|
words.resize(std::max(words.size(), set.words.size()), 0);
|
||||||
ensureCapacity(set.wordsInUse);
|
|
||||||
wordsInUse = set.wordsInUse;
|
// since we expand w/ zeros, then iterate using the size of the other vector
|
||||||
}
|
for(size_t i=0, e=set.words.size(); i<e; i++)
|
||||||
// Perform logical OR on words in common
|
|
||||||
for (uint32 i =0; i < wordsInCommon; i++) {
|
|
||||||
words[i] |= set.words[i];
|
words[i] |= set.words[i];
|
||||||
}
|
|
||||||
// Copy any remaining words
|
CHECK_POST();
|
||||||
for(uint32 i=wordsInCommon; i<set.wordsInUse; ++i) {
|
|
||||||
words[i] = set.words[i];
|
|
||||||
}
|
|
||||||
// recalculateWordsInUse() is not needed
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
BitSet& BitSet::operator^=(const BitSet& set) {
|
BitSet& BitSet::operator^=(const BitSet& set) {
|
||||||
uint32 wordsInCommon = wordsInUse;
|
// result length will <= the longer of the two inputs
|
||||||
if(wordsInUse>set.wordsInUse) wordsInCommon = set.wordsInUse;
|
words.resize(std::max(words.size(), set.words.size()), 0);
|
||||||
if (wordsInUse < set.wordsInUse) {
|
|
||||||
ensureCapacity(set.wordsInUse);
|
for(size_t i=0, e=set.words.size(); i<e; i++)
|
||||||
wordsInUse = set.wordsInUse;
|
|
||||||
}
|
|
||||||
// Perform logical OR on words in common
|
|
||||||
for (uint32 i =0; i < wordsInCommon; i++) {
|
|
||||||
words[i] ^= set.words[i];
|
words[i] ^= set.words[i];
|
||||||
}
|
|
||||||
// Copy any remaining words
|
|
||||||
for(uint32 i=wordsInCommon; i<set.wordsInUse; ++i) {
|
|
||||||
words[i] = set.words[i];
|
|
||||||
}
|
|
||||||
recalculateWordsInUse();
|
recalculateWordsInUse();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -260,32 +239,27 @@ namespace epics { namespace pvData {
|
|||||||
|
|
||||||
BitSet& BitSet::operator=(const BitSet &set) {
|
BitSet& BitSet::operator=(const BitSet &set) {
|
||||||
// Check for self-assignment!
|
// Check for self-assignment!
|
||||||
if (this == &set) return *this;
|
if (this != &set) {
|
||||||
|
words = set.words;
|
||||||
// we ensure that words array size is adequate (and not wordsInUse to ensure capacity to the future)
|
|
||||||
if (wordsLength < set.wordsLength)
|
|
||||||
{
|
|
||||||
if (words) delete[] words;
|
|
||||||
words = new uint64[set.wordsLength];
|
|
||||||
wordsLength = set.wordsLength;
|
|
||||||
}
|
}
|
||||||
memcpy(words, set.words, sizeof(uint64)*set.wordsInUse);
|
|
||||||
wordsInUse = set.wordsInUse;
|
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitSet::or_and(const BitSet& set1, const BitSet& set2) {
|
void BitSet::swap(BitSet& set)
|
||||||
uint32 inUse = (set1.wordsInUse < set2.wordsInUse) ? set1.wordsInUse : set2.wordsInUse;
|
{
|
||||||
|
words.swap(set.words);
|
||||||
|
}
|
||||||
|
|
||||||
ensureCapacity(inUse);
|
void BitSet::or_and(const BitSet& set1, const BitSet& set2) {
|
||||||
wordsInUse = inUse;
|
|
||||||
|
const size_t andlen = std::min(set1.words.size(), set2.words.size());
|
||||||
|
words.resize(std::max(words.size(), andlen), 0);
|
||||||
|
|
||||||
// Perform logical AND on words in common
|
// Perform logical AND on words in common
|
||||||
for (uint32 i = 0; i < inUse; i++)
|
for (uint32 i = 0; i < andlen; i++)
|
||||||
words[i] |= (set1.words[i] & set2.words[i]);
|
words[i] |= (set1.words[i] & set2.words[i]);
|
||||||
|
|
||||||
// recalculateWordsInUse()...
|
recalculateWordsInUse();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BitSet::operator==(const BitSet &set) const
|
bool BitSet::operator==(const BitSet &set) const
|
||||||
@@ -293,11 +267,11 @@ namespace epics { namespace pvData {
|
|||||||
if (this == &set)
|
if (this == &set)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (wordsInUse != set.wordsInUse)
|
if (words.size() != set.words.size())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Check words in use by both BitSets
|
// Check words in use by both BitSets
|
||||||
for (uint32 i = 0; i < wordsInUse; i++)
|
for (uint32 i = 0; i < words.size(); i++)
|
||||||
if (words[i] != set.words[i])
|
if (words[i] != set.words[i])
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -310,56 +284,55 @@ namespace epics { namespace pvData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BitSet::serialize(ByteBuffer* buffer, SerializableControl* flusher) const {
|
void BitSet::serialize(ByteBuffer* buffer, SerializableControl* flusher) const {
|
||||||
|
|
||||||
uint32 n = wordsInUse;
|
uint32 n = words.size();
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
SerializeHelper::writeSize(0, buffer, flusher);
|
SerializeHelper::writeSize(0, buffer, flusher);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint32 len = 8 * (n-1);
|
uint32 len = BYTES_PER_WORD * (n-1); // length excluding bits in the last word
|
||||||
|
// count non-zero bytes in the last word
|
||||||
for (uint64 x = words[n - 1]; x != 0; x >>= 8)
|
for (uint64 x = words[n - 1]; x != 0; x >>= 8)
|
||||||
len++;
|
len++;
|
||||||
|
|
||||||
SerializeHelper::writeSize(len, buffer, flusher);
|
SerializeHelper::writeSize(len, buffer, flusher);
|
||||||
flusher->ensureBuffer(len);
|
flusher->ensureBuffer(len);
|
||||||
|
|
||||||
for (uint32 i = 0; i < n - 1; i++)
|
n = len / 8;
|
||||||
|
for (uint32 i = 0; i < n; i++)
|
||||||
buffer->putLong(words[i]);
|
buffer->putLong(words[i]);
|
||||||
|
|
||||||
for (uint64 x = words[n - 1]; x != 0; x >>= 8)
|
if (n < words.size())
|
||||||
buffer->putByte((int8) (x & 0xff));
|
for (uint64 x = words[words.size() - 1]; x != 0; x >>= 8)
|
||||||
|
buffer->putByte((int8) (x & 0xff));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitSet::deserialize(ByteBuffer* buffer, DeserializableControl* control) {
|
void BitSet::deserialize(ByteBuffer* buffer, DeserializableControl* control) {
|
||||||
|
|
||||||
uint32 bytes = static_cast<uint32>(SerializeHelper::readSize(buffer, control)); // in bytes
|
uint32 bytes = static_cast<uint32>(SerializeHelper::readSize(buffer, control)); // in bytes
|
||||||
|
|
||||||
wordsInUse = (bytes + 7) / 8;
|
size_t wordsInUse = (bytes + 7) / BYTES_PER_WORD;
|
||||||
if (wordsInUse > wordsLength)
|
words.resize(wordsInUse);
|
||||||
{
|
|
||||||
if (words) delete[] words;
|
|
||||||
words = new uint64[wordsInUse];
|
|
||||||
wordsLength = wordsInUse;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wordsInUse == 0)
|
if (wordsInUse == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
control->ensureData(bytes);
|
control->ensureData(bytes);
|
||||||
|
|
||||||
uint32 i = 0;
|
uint32 i = 0;
|
||||||
uint32 longs = bytes / 8;
|
uint32 longs = bytes / 8;
|
||||||
while (i < longs)
|
while (i < longs)
|
||||||
words[i++] = buffer->getLong();
|
words[i++] = buffer->getLong();
|
||||||
|
|
||||||
for (uint32 j = i; j < wordsInUse; j++)
|
for (uint32 j = i; j < wordsInUse; j++)
|
||||||
words[j] = 0;
|
words[j] = 0;
|
||||||
|
|
||||||
for (uint32 remaining = (bytes - longs * 8), j = 0; j < remaining; j++)
|
for (uint32 remaining = (bytes - longs * 8), j = 0; j < remaining; j++)
|
||||||
words[i] |= (buffer->getByte() & 0xffL) << (8 * j);
|
words[i] |= (buffer->getByte() & 0xffLL) << (8 * j);
|
||||||
|
|
||||||
|
recalculateWordsInUse(); // Sender shouldn't add extra zero bytes, but don't fail it it does
|
||||||
}
|
}
|
||||||
|
|
||||||
epicsShareExtern std::ostream& operator<<(std::ostream& o, const BitSet& b)
|
epicsShareExtern std::ostream& operator<<(std::ostream& o, const BitSet& b)
|
||||||
{
|
{
|
||||||
o << '{';
|
o << '{';
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mse
|
* @author mse
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define epicsExportSharedSymbols
|
||||||
|
#include <pv/byteBuffer.h>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mes
|
* @author mes
|
||||||
@@ -10,6 +9,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <cstdlib>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
@@ -50,7 +50,7 @@ ExceptionMixin::show() const
|
|||||||
out<<symbols[i]<<"\n";
|
out<<symbols[i]<<"\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
free(symbols);
|
std::free(symbols);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/* event.cpp */
|
/* event.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/* executor.cpp */
|
/* executor.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -13,6 +12,10 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
#include <epicsEvent.h>
|
||||||
|
#include <epicsMutex.h>
|
||||||
|
#include <epicsThread.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <pv/executor.h>
|
#include <pv/executor.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/* localStaticLock.cpp */
|
/* localStaticLock.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mse
|
* @author mse
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/* messageQueue.cpp */
|
/* messageQueue.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* Copyright information and license terms for this software can be
|
||||||
|
* found in the file LICENSE that is included with the distribution
|
||||||
|
*/
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -12,7 +16,7 @@
|
|||||||
#include <epicsConvert.h>
|
#include <epicsConvert.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include "typeCast.h"
|
#include "pv/typeCast.h"
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
@@ -27,7 +31,7 @@ using std::string;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if EPICS_VERSION_INT < VERSION_INT(3,15,0,1)
|
#if EPICS_VERSION_INT < VERSION_INT(3,15,0,1)
|
||||||
/* integer conversion primitives added to epicsStdlib.c in 3.15.0.1 */
|
/* These integer conversion primitives added to epicsStdlib.c in 3.15.0.1 */
|
||||||
|
|
||||||
#define S_stdlib_noConversion 1 /* No digits to convert */
|
#define S_stdlib_noConversion 1 /* No digits to convert */
|
||||||
#define S_stdlib_extraneous 2 /* Extraneous characters */
|
#define S_stdlib_extraneous 2 /* Extraneous characters */
|
||||||
@@ -249,18 +253,19 @@ epicsParseFloat(const char *str, float *to, char **units)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// MS Visual Studio 2013 defines strtoll, etc.
|
// Sometimes we have to provide our own copy of strtoll()
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32) && !defined(_MINGW)
|
||||||
# if (_MSC_VER >= 1800)
|
// On Windows with MSVC, Base-3.15 provides strtoll()
|
||||||
# define WIN_NEEDS_OLL_FUNC 0
|
# define NEED_OLL_FUNCS (EPICS_VERSION_INT < VERSION_INT(3,15,0,1))
|
||||||
# else
|
#elif defined(vxWorks)
|
||||||
# define WIN_NEEDS_OLL_FUNC 1
|
// On VxWorks, Base-3.15 provides strtoll()
|
||||||
# endif
|
# define NEED_OLL_FUNCS (EPICS_VERSION_INT < VERSION_INT(3,15,0,1))
|
||||||
#else
|
#else
|
||||||
# define WIN_NEEDS_OLL_FUNC 0
|
// Other architectures all provide strtoll()
|
||||||
|
# define NEED_OLL_FUNCS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(NEED_LONGLONG) && (defined(__vxworks) || WIN_NEEDS_OLL_FUNC)
|
#if defined(NEED_LONGLONG) && NEED_OLL_FUNCS
|
||||||
static
|
static
|
||||||
long long strtoll(const char *ptr, char ** endp, int base)
|
long long strtoll(const char *ptr, char ** endp, int base)
|
||||||
{
|
{
|
||||||
@@ -308,8 +313,10 @@ noconvert:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__vxworks)
|
#if defined(vxWorks)
|
||||||
/* vxworks version of std::istringstream >>uint64_t is buggy, we use out own implementation */
|
/* The VxWorks version of std::istringstream >> uint64_t is buggy,
|
||||||
|
* provide our own implementation
|
||||||
|
*/
|
||||||
static
|
static
|
||||||
unsigned long long strtoull(const char *nptr, char **endptr, int base)
|
unsigned long long strtoull(const char *nptr, char **endptr, int base)
|
||||||
{
|
{
|
||||||
@@ -551,9 +558,10 @@ void parseToPOD(const string& in, float *out) {
|
|||||||
void parseToPOD(const string& in, double *out) {
|
void parseToPOD(const string& in, double *out) {
|
||||||
int err = epicsParseDouble(in.c_str(), out, NULL);
|
int err = epicsParseDouble(in.c_str(), out, NULL);
|
||||||
if(err) handleParseError(err);
|
if(err) handleParseError(err);
|
||||||
#if defined(__vxworks)
|
#if defined(vxWorks)
|
||||||
/* vxWorks strtod returns [-]epicsINF when it should return ERANGE error
|
/* vxWorks strtod returns [-]epicsINF when it should return ERANGE error.
|
||||||
* if [-]epicsINF is returned and first char is a digit then translate this into ERANGE error
|
* If [-]epicsINF is returned and the first char is a digit we translate
|
||||||
|
* this into an ERANGE error
|
||||||
*/
|
*/
|
||||||
else if (*out == epicsINF || *out == -epicsINF) {
|
else if (*out == epicsINF || *out == -epicsINF) {
|
||||||
const char* s = in.c_str();
|
const char* s = in.c_str();
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/* bitSet.h */
|
/* bitSet.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mse
|
* @author mse
|
||||||
@@ -10,7 +9,7 @@
|
|||||||
#ifndef BITSET_H
|
#ifndef BITSET_H
|
||||||
#define BITSET_H
|
#define BITSET_H
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <vector>
|
||||||
|
|
||||||
#include <pv/pvType.h>
|
#include <pv/pvType.h>
|
||||||
#include <pv/serialize.h>
|
#include <pv/serialize.h>
|
||||||
@@ -27,15 +26,15 @@ namespace epics { namespace pvData {
|
|||||||
* @brief A vector of bits.
|
* @brief A vector of bits.
|
||||||
*
|
*
|
||||||
* This class implements a vector of bits that grows as needed. Each
|
* This class implements a vector of bits that grows as needed. Each
|
||||||
* component of the bit set has a {@code bool} value. The
|
* component of the bit set has a @c bool value. The bits of a
|
||||||
* bits of a {@code BitSet} are indexed by nonnegative integers.
|
* @c BitSet are indexed by nonnegative integers. Individual
|
||||||
* Individual indexed bits can be examined, set, or cleared. One
|
* indexed bits can be examined, set, or cleared. One @c BitSet may
|
||||||
* {@code BitSet} may be used to modify the contents of another
|
* be used to modify the contents of another @c BitSet through
|
||||||
* {@code BitSet} through logical AND, logical inclusive OR, and
|
* logical AND, logical inclusive OR, and logical exclusive OR
|
||||||
* logical exclusive OR operations.
|
* operations.
|
||||||
*
|
*
|
||||||
* <p>By default, all bits in the set initially have the value
|
* <p>By default, all bits in the set initially have the value
|
||||||
* {@code false}.
|
* @c false.
|
||||||
*
|
*
|
||||||
* <p>Every bit set has a current size, which is the number of bits
|
* <p>Every bit set has a current size, which is the number of bits
|
||||||
* of space currently in use by the bit set. Note that the size is
|
* of space currently in use by the bit set. Note that the size is
|
||||||
@@ -43,8 +42,8 @@ namespace epics { namespace pvData {
|
|||||||
* implementation. The length of a bit set relates to logical length
|
* implementation. The length of a bit set relates to logical length
|
||||||
* of a bit set and is defined independently of implementation.
|
* of a bit set and is defined independently of implementation.
|
||||||
*
|
*
|
||||||
* <p>A {@code BitSet} is not safe for multithreaded use without
|
* <p>A @c BitSet is not safe for multithreaded use without external
|
||||||
* external synchronization.
|
* synchronization.
|
||||||
*
|
*
|
||||||
* Based on Java implementation.
|
* Based on Java implementation.
|
||||||
*/
|
*/
|
||||||
@@ -53,14 +52,14 @@ namespace epics { namespace pvData {
|
|||||||
POINTER_DEFINITIONS(BitSet);
|
POINTER_DEFINITIONS(BitSet);
|
||||||
static BitSetPtr create(uint32 nbits);
|
static BitSetPtr create(uint32 nbits);
|
||||||
/**
|
/**
|
||||||
* Creates a new bit set. All bits are initially {@code false}.
|
* Creates a new bit set. All bits are initially @c false.
|
||||||
*/
|
*/
|
||||||
BitSet();
|
BitSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a bit set whose initial size is large enough to explicitly
|
* Creates a bit set whose initial size is large enough to explicitly
|
||||||
* represent bits with indices in the range {@code 0} through
|
* represent bits with indices in the range @c 0 through
|
||||||
* {@code nbits-1}. All bits are initially {@code false}.
|
* @c nbits-1. All bits are initially @c false.
|
||||||
*
|
*
|
||||||
* @param nbits the initial size of the bit set
|
* @param nbits the initial size of the bit set
|
||||||
*/
|
*/
|
||||||
@@ -80,14 +79,14 @@ namespace epics { namespace pvData {
|
|||||||
void flip(uint32 bitIndex);
|
void flip(uint32 bitIndex);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the bit at the specified index to {@code true}.
|
* Sets the bit at the specified index to @c true.
|
||||||
*
|
*
|
||||||
* @param bitIndex a bit index
|
* @param bitIndex a bit index
|
||||||
*/
|
*/
|
||||||
void set(uint32 bitIndex);
|
void set(uint32 bitIndex);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the bit specified by the index to {@code false}.
|
* Sets the bit specified by the index to @c false.
|
||||||
*
|
*
|
||||||
* @param bitIndex the index of the bit to be cleared
|
* @param bitIndex the index of the bit to be cleared
|
||||||
*/
|
*/
|
||||||
@@ -103,9 +102,8 @@ namespace epics { namespace pvData {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the value of the bit with the specified index. The value
|
* Returns the value of the bit with the specified index. The value
|
||||||
* is {@code true} if the bit with the index {@code bitIndex}
|
* is @c true if the bit with the index @c bitIndex is currently
|
||||||
* is currently set in this {@code BitSet}; otherwise, the result
|
* set in this @c BitSet; otherwise, the result is @c false.
|
||||||
* is {@code false}.
|
|
||||||
*
|
*
|
||||||
* @param bitIndex the bit index
|
* @param bitIndex the bit index
|
||||||
* @return the value of the bit with the specified index
|
* @return the value of the bit with the specified index
|
||||||
@@ -113,16 +111,16 @@ namespace epics { namespace pvData {
|
|||||||
bool get(uint32 bitIndex) const;
|
bool get(uint32 bitIndex) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets all of the bits in this BitSet to {@code false}.
|
* Sets all of the bits in this BitSet to @c false.
|
||||||
*/
|
*/
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the index of the first bit that is set to {@code true}
|
* Returns the index of the first bit that is set to @c true that
|
||||||
* that occurs on or after the specified starting index. If no such
|
* occurs on or after the specified starting index. If no such bit
|
||||||
* bit exists then {@code -1} is returned.
|
* exists then @c -1 is returned.
|
||||||
*
|
*
|
||||||
* <p>To iterate over the {@code true} bits in a {@code BitSet},
|
* <p>To iterate over the @c true bits in a @c BitSet,
|
||||||
* use the following loop:
|
* use the following loop:
|
||||||
*
|
*
|
||||||
* <pre> {@code
|
* <pre> {@code
|
||||||
@@ -131,13 +129,13 @@ namespace epics { namespace pvData {
|
|||||||
* }}</pre>
|
* }}</pre>
|
||||||
*
|
*
|
||||||
* @param fromIndex the index to start checking from (inclusive)
|
* @param fromIndex the index to start checking from (inclusive)
|
||||||
* @return the index of the next set bit, or {@code -1} if there
|
* @return the index of the next set bit, or @c -1 if there
|
||||||
* is no such bit
|
* is no such bit
|
||||||
*/
|
*/
|
||||||
int32 nextSetBit(uint32 fromIndex) const;
|
int32 nextSetBit(uint32 fromIndex) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the index of the first bit that is set to {@code false}
|
* Returns the index of the first bit that is set to @c false
|
||||||
* that occurs on or after the specified starting index.
|
* that occurs on or after the specified starting index.
|
||||||
*
|
*
|
||||||
* @param fromIndex the index to start checking from (inclusive)
|
* @param fromIndex the index to start checking from (inclusive)
|
||||||
@@ -146,23 +144,23 @@ namespace epics { namespace pvData {
|
|||||||
int32 nextClearBit(uint32 fromIndex) const;
|
int32 nextClearBit(uint32 fromIndex) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this {@code BitSet} contains no bits that are set
|
* Returns true if this @c BitSet contains no bits that are set
|
||||||
* to {@code true}.
|
* to @c true.
|
||||||
*
|
*
|
||||||
* @return indicating whether this {@code BitSet} is empty
|
* @return indicating whether this @c BitSet is empty
|
||||||
*/
|
*/
|
||||||
bool isEmpty() const;
|
bool isEmpty() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of bits set to {@code true} in this {@code BitSet}.
|
* Returns the number of bits set to @c true in this @c BitSet.
|
||||||
*
|
*
|
||||||
* @return the number of bits set to {@code true} in this {@code BitSet}
|
* @return the number of bits set to @c true in this @c BitSet
|
||||||
*/
|
*/
|
||||||
uint32 cardinality() const;
|
uint32 cardinality() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of bits of space actually in use by this
|
* Returns the number of bits of space actually in use by this
|
||||||
* {@code BitSet} to represent bit values.
|
* @c BitSet to represent bit values.
|
||||||
* The maximum element in the set is the size - 1st element.
|
* The maximum element in the set is the size - 1st element.
|
||||||
*
|
*
|
||||||
* @return the number of bits currently in this bit set
|
* @return the number of bits currently in this bit set
|
||||||
@@ -172,9 +170,9 @@ namespace epics { namespace pvData {
|
|||||||
/**
|
/**
|
||||||
* Performs a logical <b>AND</b> of this target bit set with the
|
* Performs a logical <b>AND</b> of this target bit set with the
|
||||||
* argument bit set. This bit set is modified so that each bit in it
|
* argument bit set. This bit set is modified so that each bit in it
|
||||||
* has the value {@code true} if and only if it both initially
|
* has the value @c true if and only if it both initially
|
||||||
* had the value {@code true} and the corresponding bit in the
|
* had the value @c true and the corresponding bit in the
|
||||||
* bit set argument also had the value {@code true}.
|
* bit set argument also had the value @c true.
|
||||||
*
|
*
|
||||||
* @param set a bit set
|
* @param set a bit set
|
||||||
*/
|
*/
|
||||||
@@ -183,9 +181,9 @@ namespace epics { namespace pvData {
|
|||||||
/**
|
/**
|
||||||
* Performs a logical <b>OR</b> of this bit set with the bit set
|
* Performs a logical <b>OR</b> of this bit set with the bit set
|
||||||
* argument. This bit set is modified so that a bit in it has the
|
* argument. This bit set is modified so that a bit in it has the
|
||||||
* value {@code true} if and only if it either already had the
|
* value @c true if and only if it either already had the
|
||||||
* value {@code true} or the corresponding bit in the bit set
|
* value @c true or the corresponding bit in the bit set
|
||||||
* argument has the value {@code true}.
|
* argument has the value @c true.
|
||||||
*
|
*
|
||||||
* @param set a bit set
|
* @param set a bit set
|
||||||
*/
|
*/
|
||||||
@@ -194,13 +192,13 @@ namespace epics { namespace pvData {
|
|||||||
/**
|
/**
|
||||||
* Performs a logical <b>XOR</b> of this bit set with the bit set
|
* Performs a logical <b>XOR</b> of this bit set with the bit set
|
||||||
* argument. This bit set is modified so that a bit in it has the
|
* argument. This bit set is modified so that a bit in it has the
|
||||||
* value {@code true} if and only if one of the following
|
* value @c true if and only if one of the following
|
||||||
* statements holds:
|
* statements holds:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>The bit initially has the value {@code true}, and the
|
* <li>The bit initially has the value @c true, and the
|
||||||
* corresponding bit in the argument has the value {@code false}.
|
* corresponding bit in the argument has the value @c false.
|
||||||
* <li>The bit initially has the value {@code false}, and the
|
* <li>The bit initially has the value @c false, and the
|
||||||
* corresponding bit in the argument has the value {@code true}.
|
* corresponding bit in the argument has the value @c true.
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @param set a bit set
|
* @param set a bit set
|
||||||
@@ -212,6 +210,9 @@ namespace epics { namespace pvData {
|
|||||||
*/
|
*/
|
||||||
BitSet& operator=(const BitSet &set);
|
BitSet& operator=(const BitSet &set);
|
||||||
|
|
||||||
|
//! Swap contents
|
||||||
|
void swap(BitSet& set);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform AND operation on <code>set1</code> and <code>set2</code>,
|
* Perform AND operation on <code>set1</code> and <code>set2</code>,
|
||||||
* and OR on result and this instance.
|
* and OR on result and this instance.
|
||||||
@@ -234,42 +235,11 @@ namespace epics { namespace pvData {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/*
|
typedef std::vector<uint64> words_t;
|
||||||
* BitSets are packed into arrays of "words." Currently a word is
|
|
||||||
* a long, which consists of 64 bits, requiring 6 address bits.
|
|
||||||
* The choice of word size is determined purely by performance concerns.
|
|
||||||
*/
|
|
||||||
static const uint32 ADDRESS_BITS_PER_WORD = 6;
|
|
||||||
static const uint32 BITS_PER_WORD = 1 << ADDRESS_BITS_PER_WORD;
|
|
||||||
static const uint32 BIT_INDEX_MASK = BITS_PER_WORD - 1;
|
|
||||||
|
|
||||||
/** Used to shift left or right for a partial word mask */
|
|
||||||
static const uint64 WORD_MASK = ~((uint64)0);
|
|
||||||
|
|
||||||
/** The internal field corresponding to the serialField "bits". */
|
/** The internal field corresponding to the serialField "bits". */
|
||||||
uint64* words;
|
words_t words;
|
||||||
|
|
||||||
/** The internal field corresponding to the size of words[] array. */
|
|
||||||
uint32 wordsLength;
|
|
||||||
|
|
||||||
/** The number of words in the logical size of this BitSet. */
|
|
||||||
uint32 wordsInUse;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/**
|
|
||||||
* Given a bit index, return word index containing it.
|
|
||||||
*/
|
|
||||||
static inline uint32 wordIndex(uint32 bitIndex) {
|
|
||||||
return bitIndex >> ADDRESS_BITS_PER_WORD;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new word array.
|
|
||||||
*/
|
|
||||||
void initWords(uint32 nbits);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the field wordsInUse to the logical size in words of the bit set.
|
* Sets the field wordsInUse to the logical size in words of the bit set.
|
||||||
* WARNING: This method assumes that the number of words actually in use is
|
* WARNING: This method assumes that the number of words actually in use is
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* byteBuffer.h */
|
/* byteBuffer.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mse
|
* @author mse
|
||||||
@@ -11,24 +10,15 @@
|
|||||||
#define BYTEBUFFER_H
|
#define BYTEBUFFER_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string.h>
|
#include <cstring>
|
||||||
|
#include <cstdlib>
|
||||||
#ifdef epicsExportSharedSymbols
|
|
||||||
#define byteBufferepicsExportSharedSymbols
|
|
||||||
#undef epicsExportSharedSymbols
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <epicsEndian.h>
|
#include <epicsEndian.h>
|
||||||
|
#include <shareLib.h>
|
||||||
#ifdef byteBufferepicsExportSharedSymbols
|
|
||||||
#define epicsExportSharedSymbols
|
|
||||||
#undef byteBufferepicsExportSharedSymbols
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <pv/pvType.h>
|
#include <pv/pvType.h>
|
||||||
#include <pv/epicsException.h>
|
#include <pv/epicsException.h>
|
||||||
|
|
||||||
#include <shareLib.h>
|
|
||||||
|
|
||||||
namespace epics {
|
namespace epics {
|
||||||
namespace pvData {
|
namespace pvData {
|
||||||
@@ -208,7 +198,7 @@ inline double swap(double val)
|
|||||||
/**
|
/**
|
||||||
* @brief This class implements a Bytebuffer that is like the java.nio.ByteBuffer.
|
* @brief This class implements a Bytebuffer that is like the java.nio.ByteBuffer.
|
||||||
*
|
*
|
||||||
* <p>A {@code BitSet} is not safe for multithreaded use without
|
* <p>A @c BitSet is not safe for multithreaded use without
|
||||||
* external synchronization.
|
* external synchronization.
|
||||||
*
|
*
|
||||||
* Based on Java implementation.
|
* Based on Java implementation.
|
||||||
@@ -224,19 +214,20 @@ public:
|
|||||||
* Must be one of EPICS_BYTE_ORDER,EPICS_ENDIAN_LITTLE,EPICS_ENDIAN_BIG.
|
* Must be one of EPICS_BYTE_ORDER,EPICS_ENDIAN_LITTLE,EPICS_ENDIAN_BIG.
|
||||||
*/
|
*/
|
||||||
ByteBuffer(std::size_t size, int byteOrder = EPICS_BYTE_ORDER) :
|
ByteBuffer(std::size_t size, int byteOrder = EPICS_BYTE_ORDER) :
|
||||||
_buffer(0), _size(size),
|
_buffer((char*)std::malloc(size)), _size(size),
|
||||||
_reverseEndianess(byteOrder != EPICS_BYTE_ORDER),
|
_reverseEndianess(byteOrder != EPICS_BYTE_ORDER),
|
||||||
_reverseFloatEndianess(byteOrder != EPICS_FLOAT_WORD_ORDER),
|
_reverseFloatEndianess(byteOrder != EPICS_FLOAT_WORD_ORDER),
|
||||||
_wrapped(false)
|
_wrapped(false)
|
||||||
{
|
{
|
||||||
_buffer = (char*)malloc(size);
|
if(!_buffer)
|
||||||
|
throw std::bad_alloc();
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for wrapping existing buffers.
|
* Constructor for wrapping an existing buffer.
|
||||||
* Given buffer will not be released by the ByteBuffer instance.
|
* Given buffer will not be released by the ByteBuffer instance.
|
||||||
* @param buffer Existing buffer.
|
* @param buffer Existing buffer. May not be NULL.
|
||||||
* @param size The number of bytes.
|
* @param size The number of bytes.
|
||||||
* @param byteOrder The byte order.
|
* @param byteOrder The byte order.
|
||||||
* Must be one of EPICS_BYTE_ORDER,EPICS_ENDIAN_LITTLE,EPICS_ENDIAN_BIG.
|
* Must be one of EPICS_BYTE_ORDER,EPICS_ENDIAN_LITTLE,EPICS_ENDIAN_BIG.
|
||||||
@@ -247,6 +238,8 @@ public:
|
|||||||
_reverseFloatEndianess(byteOrder != EPICS_FLOAT_WORD_ORDER),
|
_reverseFloatEndianess(byteOrder != EPICS_FLOAT_WORD_ORDER),
|
||||||
_wrapped(true)
|
_wrapped(true)
|
||||||
{
|
{
|
||||||
|
if(!_buffer)
|
||||||
|
throw std::invalid_argument("ByteBuffer can't be constructed with NULL");
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -254,7 +247,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
~ByteBuffer()
|
~ByteBuffer()
|
||||||
{
|
{
|
||||||
if (_buffer && !_wrapped) free(_buffer);
|
if (_buffer && !_wrapped) std::free(_buffer);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Set the byte order.
|
* Set the byte order.
|
||||||
@@ -271,7 +264,7 @@ public:
|
|||||||
* Get the raw buffer data.
|
* Get the raw buffer data.
|
||||||
* @return the raw buffer data.
|
* @return the raw buffer data.
|
||||||
*/
|
*/
|
||||||
inline const char* getBuffer()
|
inline const char* getBuffer() const
|
||||||
{
|
{
|
||||||
return _buffer;
|
return _buffer;
|
||||||
}
|
}
|
||||||
@@ -303,7 +296,7 @@ public:
|
|||||||
* Returns the current position.
|
* Returns the current position.
|
||||||
* @return The current position in the raw data.
|
* @return The current position in the raw data.
|
||||||
*/
|
*/
|
||||||
inline std::size_t getPosition()
|
inline std::size_t getPosition() const
|
||||||
{
|
{
|
||||||
return (std::size_t)(((std::ptrdiff_t)(const void *)_position) - ((std::ptrdiff_t)(const void *)_buffer));
|
return (std::size_t)(((std::ptrdiff_t)(const void *)_position) - ((std::ptrdiff_t)(const void *)_buffer));
|
||||||
}
|
}
|
||||||
@@ -323,7 +316,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @return The offset into the raw buffer.
|
* @return The offset into the raw buffer.
|
||||||
*/
|
*/
|
||||||
inline std::size_t getLimit()
|
inline std::size_t getLimit() const
|
||||||
{
|
{
|
||||||
return (std::size_t)(((std::ptrdiff_t)(const void *)_limit) - ((std::ptrdiff_t)(const void *)_buffer));
|
return (std::size_t)(((std::ptrdiff_t)(const void *)_limit) - ((std::ptrdiff_t)(const void *)_buffer));
|
||||||
}
|
}
|
||||||
@@ -344,7 +337,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @return The number of elements remaining in this buffer.
|
* @return The number of elements remaining in this buffer.
|
||||||
*/
|
*/
|
||||||
inline std::size_t getRemaining()
|
inline std::size_t getRemaining() const
|
||||||
{
|
{
|
||||||
return (std::size_t)(((std::ptrdiff_t)(const void *)_limit) - ((std::ptrdiff_t)(const void *)_position));
|
return (std::size_t)(((std::ptrdiff_t)(const void *)_limit) - ((std::ptrdiff_t)(const void *)_position));
|
||||||
}
|
}
|
||||||
@@ -353,7 +346,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @return The size of the raw data buffer.
|
* @return The size of the raw data buffer.
|
||||||
*/
|
*/
|
||||||
inline std::size_t getSize()
|
inline std::size_t getSize() const
|
||||||
{
|
{
|
||||||
return _size;
|
return _size;
|
||||||
}
|
}
|
||||||
@@ -373,7 +366,7 @@ public:
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
inline void put(std::size_t index, T value);
|
inline void put(std::size_t index, T value);
|
||||||
/**
|
/**
|
||||||
* Get the new object from the byte buffer. The item MUST have type {@code T}.
|
* Get the new object from the byte buffer. The item MUST have type @c T.
|
||||||
* The position is adjusted based on the type.
|
* The position is adjusted based on the type.
|
||||||
*
|
*
|
||||||
* @return The object.
|
* @return The object.
|
||||||
@@ -387,7 +380,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
/**
|
/**
|
||||||
* Get the new object from the byte buffer at the specified index.
|
* Get the new object from the byte buffer at the specified index.
|
||||||
* The item MUST have type {@code T}.
|
* The item MUST have type @c T.
|
||||||
* The position is adjusted based on the type.
|
* The position is adjusted based on the type.
|
||||||
*
|
*
|
||||||
* @param index The location in the byte buffer.
|
* @param index The location in the byte buffer.
|
||||||
@@ -399,9 +392,9 @@ public:
|
|||||||
* Put a sub-array of bytes into the byte buffer.
|
* Put a sub-array of bytes into the byte buffer.
|
||||||
* The position is increased by the count.
|
* The position is increased by the count.
|
||||||
*
|
*
|
||||||
* @param src The source array.
|
* @param src The source array.
|
||||||
* @param offset The starting position within src.
|
* @param src_offset The starting position within src.
|
||||||
* @param count The number of bytes to put into the byte buffer,
|
* @param count The number of bytes to put into the byte buffer,
|
||||||
*/
|
*/
|
||||||
inline void put(const char* src, std::size_t src_offset, std::size_t count) {
|
inline void put(const char* src, std::size_t src_offset, std::size_t count) {
|
||||||
//if(count>getRemaining()) THROW_BASE_EXCEPTION("buffer overflow");
|
//if(count>getRemaining()) THROW_BASE_EXCEPTION("buffer overflow");
|
||||||
@@ -412,9 +405,9 @@ public:
|
|||||||
* Get a sub-array of bytes from the byte buffer.
|
* Get a sub-array of bytes from the byte buffer.
|
||||||
* The position is increased by the count.
|
* The position is increased by the count.
|
||||||
*
|
*
|
||||||
* @param dest The destination array.
|
* @param dest The destination array.
|
||||||
* @param offset The starting position within src.
|
* @param dest_offset The starting position within src.
|
||||||
* @param count The number of bytes to put into the byte buffer,
|
* @param count The number of bytes to put into the byte buffer.
|
||||||
*/
|
*/
|
||||||
inline void get(char* dest, std::size_t dest_offset, std::size_t count) {
|
inline void get(char* dest, std::size_t dest_offset, std::size_t count) {
|
||||||
//if(count>getRemaining()) THROW_BASE_EXCEPTION("buffer overflow");
|
//if(count>getRemaining()) THROW_BASE_EXCEPTION("buffer overflow");
|
||||||
@@ -422,7 +415,7 @@ public:
|
|||||||
_position += count;
|
_position += count;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Put an array of type {@code T} into the byte buffer.
|
* Put an array of type @c T into the byte buffer.
|
||||||
* The position is adjusted.
|
* The position is adjusted.
|
||||||
*
|
*
|
||||||
* @param values The input array.
|
* @param values The input array.
|
||||||
@@ -431,7 +424,7 @@ public:
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
inline void putArray(const T* values, std::size_t count);
|
inline void putArray(const T* values, std::size_t count);
|
||||||
/**
|
/**
|
||||||
* Get an array of type {@code T} from the byte buffer.
|
* Get an array of type @c T from the byte buffer.
|
||||||
* The position is adjusted.
|
* The position is adjusted.
|
||||||
*
|
*
|
||||||
* @param values The destination array.
|
* @param values The destination array.
|
||||||
@@ -444,7 +437,7 @@ public:
|
|||||||
* @return (false,true) if (is, is not) the EPICS_BYTE_ORDER
|
* @return (false,true) if (is, is not) the EPICS_BYTE_ORDER
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline bool reverse()
|
inline bool reverse() const
|
||||||
{
|
{
|
||||||
return _reverseEndianess;
|
return _reverseEndianess;
|
||||||
}
|
}
|
||||||
@@ -637,54 +630,54 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Get a boolean value from the byte buffer at the specified index.
|
* Get a boolean value from the byte buffer at the specified index.
|
||||||
*
|
*
|
||||||
* @param double The offset in the byte buffer.
|
* @param index The offset in the byte buffer.
|
||||||
* @return The value.
|
* @return The value.
|
||||||
*/
|
*/
|
||||||
inline double getDouble (std::size_t index) { return get<double>(index); }
|
inline double getDouble (std::size_t index) { return get<double>(index); }
|
||||||
|
|
||||||
// TODO remove
|
// TODO remove
|
||||||
inline const char* getArray()
|
inline const char* getArray() const
|
||||||
{
|
{
|
||||||
return _buffer;
|
return _buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char* _buffer;
|
char* const _buffer;
|
||||||
char* _position;
|
char* _position;
|
||||||
char* _limit;
|
char* _limit;
|
||||||
std::size_t _size;
|
const std::size_t _size;
|
||||||
bool _reverseEndianess;
|
bool _reverseEndianess;
|
||||||
bool _reverseFloatEndianess;
|
bool _reverseFloatEndianess;
|
||||||
bool _wrapped;
|
const bool _wrapped;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline bool ByteBuffer::reverse<bool>()
|
inline bool ByteBuffer::reverse<bool>() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline bool ByteBuffer::reverse<int8>()
|
inline bool ByteBuffer::reverse<int8>() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline bool ByteBuffer::reverse<uint8>()
|
inline bool ByteBuffer::reverse<uint8>() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline bool ByteBuffer::reverse<float>()
|
inline bool ByteBuffer::reverse<float>() const
|
||||||
{
|
{
|
||||||
return _reverseFloatEndianess;
|
return _reverseFloatEndianess;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline bool ByteBuffer::reverse<double>()
|
inline bool ByteBuffer::reverse<double>() const
|
||||||
{
|
{
|
||||||
return _reverseFloatEndianess;
|
return _reverseFloatEndianess;
|
||||||
}
|
}
|
||||||
0
src/misc/current_function.h → src/misc/pv/current_function.h
Executable file → Normal file
0
src/misc/current_function.h → src/misc/pv/current_function.h
Executable file → Normal file
@@ -1,8 +1,7 @@
|
|||||||
/* destroyable.h */
|
/* destroyable.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mse
|
* @author mse
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* epicsException.hpp
|
* epicsException.h
|
||||||
*
|
*
|
||||||
* Created on: Oct 20, 2010
|
* Created on: Oct 20, 2010
|
||||||
* Author: Matej Sekoranja
|
* Author: Matej Sekoranja
|
||||||
@@ -34,19 +33,14 @@
|
|||||||
#ifndef EPICSEXCEPTION_H_
|
#ifndef EPICSEXCEPTION_H_
|
||||||
#define EPICSEXCEPTION_H_
|
#define EPICSEXCEPTION_H_
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(NOMINMAX)
|
||||||
#pragma warning( push )
|
#define NOMINMAX
|
||||||
#pragma warning(disable: 4275) // warning C4275: non dll-interface class used as base for dll-interface class (std::logic_error)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <shareLib.h>
|
#include <shareLib.h>
|
||||||
|
|
||||||
// Users may redefine this for a large size if desired
|
// Users may redefine this for a large size if desired
|
||||||
@@ -58,7 +52,7 @@
|
|||||||
# include <execinfo.h>
|
# include <execinfo.h>
|
||||||
# include <cxxabi.h>
|
# include <cxxabi.h>
|
||||||
# define EXCEPT_USE_BACKTRACE
|
# define EXCEPT_USE_BACKTRACE
|
||||||
#elif defined(_WIN32) && !defined(__MINGW__) && !defined(SKIP_DBGHELP)
|
#elif defined(_WIN32) && !defined(_MINGW) && !defined(SKIP_DBGHELP)
|
||||||
# define _WINSOCKAPI_
|
# define _WINSOCKAPI_
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# include <dbghelp.h>
|
# include <dbghelp.h>
|
||||||
@@ -67,6 +61,12 @@
|
|||||||
# define EXCEPT_USE_NONE
|
# define EXCEPT_USE_NONE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(_MINGW)
|
||||||
|
#pragma warning( push )
|
||||||
|
#pragma warning(disable: 4275) // non dll-interface class used as base for dll-interface class (std::logic_error)
|
||||||
|
#pragma warning(disable: 4251) // class std::string needs to have dll-interface to be used by clients
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace epics { namespace pvData {
|
namespace epics { namespace pvData {
|
||||||
|
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ do { \
|
|||||||
|
|
||||||
#define PRINT_EXCEPTION2(EI, FP) \
|
#define PRINT_EXCEPTION2(EI, FP) \
|
||||||
do { \
|
do { \
|
||||||
ExceptionMixin *_em_p=dynamic_cast<ExceptionMixin*>(&EI); \
|
::epics::pvData::ExceptionMixin *_em_p=dynamic_cast< ::epics::pvData::ExceptionMixin*>(&EI); \
|
||||||
if (_em_p) {_em_p->print(FP);} \
|
if (_em_p) {_em_p->print(FP);} \
|
||||||
}while(0)
|
}while(0)
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ do { \
|
|||||||
# define SHOW_EXCEPTION(EI) ::epics::pvData::detail::showException(EI)
|
# define SHOW_EXCEPTION(EI) ::epics::pvData::detail::showException(EI)
|
||||||
#else
|
#else
|
||||||
# define SHOW_EXCEPTION(EI) \
|
# define SHOW_EXCEPTION(EI) \
|
||||||
({ ExceptionMixin *_mx=dynamic_cast<ExceptionMixin*>(&(EI)); \
|
({ ::epics::pvData::ExceptionMixin *_mx=dynamic_cast< ::epics::pvData::ExceptionMixin*>(&(EI)); \
|
||||||
_mx ? _mx->show() : std::string(); \
|
_mx ? _mx->show() : std::string(); \
|
||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
@@ -228,7 +228,7 @@ private:
|
|||||||
mutable std::string base_msg;
|
mutable std::string base_msg;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(_MINGW)
|
||||||
#pragma warning( pop )
|
#pragma warning( pop )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* event.h */
|
/* event.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -13,22 +12,12 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#ifdef epicsExportSharedSymbols
|
|
||||||
#define eventepicsExportSharedSymbols
|
|
||||||
#undef epicsExportSharedSymbols
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <epicsEvent.h>
|
#include <epicsEvent.h>
|
||||||
|
#include <shareLib.h>
|
||||||
#ifdef eventepicsExportSharedSymbols
|
|
||||||
#define epicsExportSharedSymbols
|
|
||||||
#undef eventepicsExportSharedSymbols
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <pv/pvType.h>
|
#include <pv/pvType.h>
|
||||||
#include <pv/sharedPtr.h>
|
#include <pv/sharedPtr.h>
|
||||||
|
|
||||||
#include <shareLib.h>
|
|
||||||
|
|
||||||
namespace epics { namespace pvData {
|
namespace epics { namespace pvData {
|
||||||
|
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* executor.h */
|
/* executor.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* localStaticLock.h */
|
/* localStaticLock.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mse
|
* @author mse
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* lock.h */
|
/* lock.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -12,21 +11,11 @@
|
|||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#ifdef epicsExportSharedSymbols
|
|
||||||
#define lockepicsExportSharedSymbols
|
|
||||||
#undef epicsExportSharedSymbols
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <epicsMutex.h>
|
#include <epicsMutex.h>
|
||||||
|
#include <shareLib.h>
|
||||||
#ifdef lockepicsExportSharedSymbols
|
|
||||||
#define epicsExportSharedSymbols
|
|
||||||
#undef lockepicsExportSharedSymbols
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <pv/noDefaultMethods.h>
|
#include <pv/noDefaultMethods.h>
|
||||||
|
|
||||||
#include <shareLib.h>
|
|
||||||
|
|
||||||
/* This is based on item 14 of
|
/* This is based on item 14 of
|
||||||
* Effective C++, Third Edition, Scott Meyers
|
* Effective C++, Third Edition, Scott Meyers
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* messageQueue.h */
|
/* messageQueue.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* noDefaultMethods.h */
|
/* noDefaultMethods.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* queue.h */
|
/* queue.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* requester.h */
|
/* requester.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -65,7 +64,7 @@ public:
|
|||||||
};
|
};
|
||||||
@endcode
|
@endcode
|
||||||
*/
|
*/
|
||||||
virtual void message(std::string const & message,MessageType messageType) = 0;
|
virtual void message(std::string const & message,MessageType messageType);
|
||||||
};
|
};
|
||||||
|
|
||||||
}}
|
}}
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* serialize.h */
|
/* serialize.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -10,6 +9,8 @@
|
|||||||
#ifndef SERIALIZE_H
|
#ifndef SERIALIZE_H
|
||||||
#define SERIALIZE_H
|
#define SERIALIZE_H
|
||||||
|
|
||||||
|
#include <epicsTypes.h>
|
||||||
|
|
||||||
#include <pv/byteBuffer.h>
|
#include <pv/byteBuffer.h>
|
||||||
#include <pv/sharedPtr.h>
|
#include <pv/sharedPtr.h>
|
||||||
|
|
||||||
@@ -52,14 +53,18 @@ namespace epics { namespace pvData {
|
|||||||
*/
|
*/
|
||||||
virtual void alignBuffer(std::size_t alignment) =0;
|
virtual void alignBuffer(std::size_t alignment) =0;
|
||||||
/**
|
/**
|
||||||
* method for serializing array data.
|
* Method for serializing primitive array data.
|
||||||
* This should only be used for arrays of primitive types.
|
* Hook for supplying custom serialization implementation.
|
||||||
* i. e. boolean,byte,...,double.
|
* The serialization implementation need not be provided.
|
||||||
* It can not be called for string, structure, or union arrays.
|
* Returns true if method performs serialization, false otherwise.
|
||||||
|
* This should only be used for arrays of primitive types,
|
||||||
|
* i. e. boolean, byte,..., double.
|
||||||
|
* It cannot be called for string, structure, or union arrays.
|
||||||
* @param existingBuffer the existing buffer from the caller.
|
* @param existingBuffer the existing buffer from the caller.
|
||||||
* @param toSerialize location of data to be put into buffer.
|
* @param toSerialize location of data to be put into buffer.
|
||||||
* @param elementCount number of elements.
|
* @param elementCount number of elements.
|
||||||
* @param elementSize element size.
|
* @param elementSize element size.
|
||||||
|
* @returns true if serialization performed, else false.
|
||||||
*/
|
*/
|
||||||
virtual bool directSerialize(
|
virtual bool directSerialize(
|
||||||
ByteBuffer *existingBuffer,
|
ByteBuffer *existingBuffer,
|
||||||
@@ -102,14 +107,18 @@ namespace epics { namespace pvData {
|
|||||||
*/
|
*/
|
||||||
virtual void alignData(std::size_t alignment) =0;
|
virtual void alignData(std::size_t alignment) =0;
|
||||||
/**
|
/**
|
||||||
* method for deserializing array data.
|
* Method for deserializing array data.
|
||||||
|
* Hook for supplying custom deserialization implementation.
|
||||||
|
* The deserialization implementation need not be provided.
|
||||||
|
* Returns true if method performs deserialization, false otherwise.
|
||||||
* This should only be used for arrays of primitive types.
|
* This should only be used for arrays of primitive types.
|
||||||
* i. e. boolean,byte,...,double.
|
* i.e. boolean, byte,..., double.
|
||||||
* It can not be called for string, structure, or union arrays.
|
* It cannot be called for string, structure, or union arrays.
|
||||||
* @param existingBuffer the existing buffer from the caller.
|
* @param existingBuffer the existing buffer from the caller.
|
||||||
* @param deserializeTo location of data.
|
* @param deserializeTo location of data.
|
||||||
* @param elementCount number of elements.
|
* @param elementCount number of elements.
|
||||||
* @param elementSize element size.
|
* @param elementSize element size.
|
||||||
|
* @returns true if deserialization performed, else false.
|
||||||
*/
|
*/
|
||||||
virtual bool directDeserialize(
|
virtual bool directDeserialize(
|
||||||
ByteBuffer *existingBuffer,
|
ByteBuffer *existingBuffer,
|
||||||
@@ -118,7 +127,6 @@ namespace epics { namespace pvData {
|
|||||||
std::size_t elementSize) = 0;
|
std::size_t elementSize) = 0;
|
||||||
/**
|
/**
|
||||||
* deserialize via cache
|
* deserialize via cache
|
||||||
* @param field instance to be deserialized
|
|
||||||
* @param buffer buffer to be deserialized from
|
* @param buffer buffer to be deserialized from
|
||||||
*/
|
*/
|
||||||
virtual std::tr1::shared_ptr<const Field> cachedDeserialize(
|
virtual std::tr1::shared_ptr<const Field> cachedDeserialize(
|
||||||
@@ -151,6 +159,41 @@ namespace epics { namespace pvData {
|
|||||||
DeserializableControl *flusher) = 0;
|
DeserializableControl *flusher) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Push serialize and append to the provided byte vector.
|
||||||
|
* No caching is done. Only complete serialization.
|
||||||
|
*
|
||||||
|
* @param S A Serializable object
|
||||||
|
* @param byteOrder Byte order to write (EPICS_ENDIAN_LITTLE or EPICS_ENDIAN_BIG)
|
||||||
|
* @param out The output vector. Results are appended
|
||||||
|
*/
|
||||||
|
void epicsShareFunc serializeToVector(const Serializable *S,
|
||||||
|
int byteOrder,
|
||||||
|
std::vector<epicsUInt8>& out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief deserializeFromBuffer Deserialize into S from provided vector
|
||||||
|
* @param S A Serializeable object. The current contents will be replaced
|
||||||
|
* @param in The input buffer (byte order of this buffer is used)
|
||||||
|
* @throws std::logic_error if input buffer is too small. State of S is then undefined.
|
||||||
|
*/
|
||||||
|
void epicsShareFunc deserializeFromBuffer(Serializable *S,
|
||||||
|
ByteBuffer& in);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief deserializeFromBuffer Deserialize into S from provided vector
|
||||||
|
* @param S A Serializeable object. The current contents will be replaced
|
||||||
|
* @param byteOrder Byte order to write (EPICS_ENDIAN_LITTLE or EPICS_ENDIAN_BIG)
|
||||||
|
* @param in The input vector
|
||||||
|
* @throws std::logic_error if input buffer is too small. State of S is then undefined.
|
||||||
|
*/
|
||||||
|
inline void deserializeFromVector(Serializable *S,
|
||||||
|
int byteOrder,
|
||||||
|
const std::vector<epicsUInt8>& in)
|
||||||
|
{
|
||||||
|
ByteBuffer B((char*)&in[0], in.size(), byteOrder); // we promise not the modify 'in'
|
||||||
|
deserializeFromBuffer(S, B);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Class for serializing bitSets.
|
* @brief Class for serializing bitSets.
|
||||||
@@ -166,7 +209,7 @@ namespace epics { namespace pvData {
|
|||||||
* Serialize field into given buffer.
|
* Serialize field into given buffer.
|
||||||
* @param buffer serialization buffer.
|
* @param buffer serialization buffer.
|
||||||
* @param flusher flush interface.
|
* @param flusher flush interface.
|
||||||
* ¶m bitSet The bitSet to serialize.
|
* @param bitSet The bitSet to serialize.
|
||||||
*/
|
*/
|
||||||
virtual void serialize(ByteBuffer *buffer,
|
virtual void serialize(ByteBuffer *buffer,
|
||||||
SerializableControl *flusher,BitSet *bitSet) const = 0;
|
SerializableControl *flusher,BitSet *bitSet) const = 0;
|
||||||
@@ -174,7 +217,7 @@ namespace epics { namespace pvData {
|
|||||||
* Deserialize buffer.
|
* Deserialize buffer.
|
||||||
* @param buffer serialization buffer.
|
* @param buffer serialization buffer.
|
||||||
* @param flusher deserialization control.
|
* @param flusher deserialization control.
|
||||||
* ¶m bitSet The bitSet to deserialize.
|
* @param bitSet The bitSet to deserialize.
|
||||||
*/
|
*/
|
||||||
virtual void deserialize(ByteBuffer *buffer,
|
virtual void deserialize(ByteBuffer *buffer,
|
||||||
DeserializableControl *flusher,BitSet *bitSet) = 0;
|
DeserializableControl *flusher,BitSet *bitSet) = 0;
|
||||||
@@ -196,7 +239,7 @@ namespace epics { namespace pvData {
|
|||||||
* Serialize field into given buffer.
|
* Serialize field into given buffer.
|
||||||
* @param buffer serialization buffer.
|
* @param buffer serialization buffer.
|
||||||
* @param flusher flush interface.
|
* @param flusher flush interface.
|
||||||
* ¶m offset offset in elements.
|
* @param offset offset in elements.
|
||||||
* @param count number of elements
|
* @param count number of elements
|
||||||
*/
|
*/
|
||||||
virtual void serialize(
|
virtual void serialize(
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* serializeHelper.h
|
* serializeHelper.h
|
||||||
@@ -31,19 +30,25 @@ namespace epics {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Serialize array size.
|
* Serialize the specified array size into the specified
|
||||||
|
* buffer, flushing when necessary.
|
||||||
|
* The specified SerializableControl manages any flushing
|
||||||
|
* required.
|
||||||
*
|
*
|
||||||
* @param[in] s size to encode
|
* @param[in] s size to encode
|
||||||
* @param[in] buffer serialization buffer
|
* @param[in] buffer serialization buffer
|
||||||
* @param[in] flusher flusher
|
* @param[in] flusher SerializableControl to manage the flushing
|
||||||
*/
|
*/
|
||||||
static void writeSize(std::size_t s, ByteBuffer* buffer,
|
static void writeSize(std::size_t s, ByteBuffer* buffer,
|
||||||
SerializableControl* flusher);
|
SerializableControl* flusher);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deserialize array size.
|
* Deserialize array size.
|
||||||
|
* The specified DeserializableControl ensures
|
||||||
|
* sufficient bytes are available.
|
||||||
*
|
*
|
||||||
* @param[in] buffer deserialization buffer.
|
* @param[in] buffer deserialization buffer.
|
||||||
|
* @param[in] control the DeserializableControl.
|
||||||
* @returns array size.
|
* @returns array size.
|
||||||
*/
|
*/
|
||||||
static std::size_t readSize(ByteBuffer* buffer,
|
static std::size_t readSize(ByteBuffer* buffer,
|
||||||
@@ -63,7 +68,7 @@ namespace epics {
|
|||||||
* std::string serialization helper method.
|
* std::string serialization helper method.
|
||||||
*
|
*
|
||||||
* @param[in] value std::string to serialize
|
* @param[in] value std::string to serialize
|
||||||
* @param[in] offset start of the substring in {@code value}
|
* @param[in] offset start of the substring in value
|
||||||
* @param[in] count the number of characters to write
|
* @param[in] count the number of characters to write
|
||||||
* @param[in] buffer serialization buffer
|
* @param[in] buffer serialization buffer
|
||||||
* @param[in] flusher flusher
|
* @param[in] flusher flusher
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author Michael Davidsaver
|
* @author Michael Davidsaver
|
||||||
@@ -26,7 +25,7 @@
|
|||||||
|
|
||||||
// where should we look?
|
// where should we look?
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__>=4 && !defined(__vxworks)
|
#if defined(__GNUC__) && __GNUC__>=4 && !defined(vxWorks)
|
||||||
// GCC >=4.0.0
|
// GCC >=4.0.0
|
||||||
# define SHARED_FROM_TR1
|
# define SHARED_FROM_TR1
|
||||||
|
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
/* sharedVector.h */
|
/* sharedVector.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
#ifndef SHAREDVECTOR_H
|
#ifndef SHAREDVECTOR_H
|
||||||
#define SHAREDVECTOR_H
|
#define SHAREDVECTOR_H
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(NOMINMAX)
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -326,7 +325,7 @@ public:
|
|||||||
//! Internal for static_shared_vector_cast
|
//! Internal for static_shared_vector_cast
|
||||||
template<typename FROM>
|
template<typename FROM>
|
||||||
shared_vector(const shared_vector<FROM> &src,
|
shared_vector(const shared_vector<FROM> &src,
|
||||||
typename meta::is_void<FROM, detail::_shared_vector_cast_tag>::type)
|
detail::_shared_vector_cast_tag)
|
||||||
:base_t(std::tr1::static_pointer_cast<E>(src.dataPtr()),
|
:base_t(std::tr1::static_pointer_cast<E>(src.dataPtr()),
|
||||||
src.dataOffset()/sizeof(E),
|
src.dataOffset()/sizeof(E),
|
||||||
src.dataCount()/sizeof(E))
|
src.dataCount()/sizeof(E))
|
||||||
@@ -432,8 +431,8 @@ public:
|
|||||||
shared_vector<E> original(...);
|
shared_vector<E> original(...);
|
||||||
|
|
||||||
if(!original.unique()){
|
if(!original.unique()){
|
||||||
shared_vector<E> temp(myallocator(original.size()),
|
std::tr1::shared_ptr<E> sptr(myalloc(original.size()), myfree);
|
||||||
0, original.size());
|
shared_vector<E> temp(sptr, 0, original.size());
|
||||||
std::copy(original.begin(), original.end(), temp.begin());
|
std::copy(original.begin(), original.end(), temp.begin());
|
||||||
original.swap(temp);
|
original.swap(temp);
|
||||||
}
|
}
|
||||||
@@ -532,6 +531,20 @@ public:
|
|||||||
*
|
*
|
||||||
* Does not allow access or iteration of contents
|
* Does not allow access or iteration of contents
|
||||||
* other than as void* or const void*
|
* other than as void* or const void*
|
||||||
|
*
|
||||||
|
* In order to support shared_vector_convert<>()
|
||||||
|
* information about the type of the underlying allocation
|
||||||
|
* is stored.
|
||||||
|
* This is implicitly set by static_shared_vector_cast<>()
|
||||||
|
* and may be explicitly checked/changed using
|
||||||
|
* original_type()/set_original_type().
|
||||||
|
*
|
||||||
|
* A shared_vector<void> directly constructed
|
||||||
|
* from a smart pointer does not have an associated
|
||||||
|
* original_type().
|
||||||
|
* Use epics::pvData::ScalarTypeFunc::allocArray()
|
||||||
|
* to convienently allocate an array with a known
|
||||||
|
* original_type().
|
||||||
*/
|
*/
|
||||||
template<typename E>
|
template<typename E>
|
||||||
class shared_vector<E, typename meta::is_void<E>::type >
|
class shared_vector<E, typename meta::is_void<E>::type >
|
||||||
@@ -539,7 +552,11 @@ class shared_vector<E, typename meta::is_void<E>::type >
|
|||||||
{
|
{
|
||||||
typedef detail::shared_vector_base<E> base_t;
|
typedef detail::shared_vector_base<E> base_t;
|
||||||
ScalarType m_vtype;
|
ScalarType m_vtype;
|
||||||
|
|
||||||
|
// allow specialization for all E to be friends
|
||||||
|
template<typename E1, class Enable1> friend class shared_vector;
|
||||||
public:
|
public:
|
||||||
|
typedef E value_type;
|
||||||
typedef E* pointer;
|
typedef E* pointer;
|
||||||
typedef ptrdiff_t difference_type;
|
typedef ptrdiff_t difference_type;
|
||||||
typedef size_t size_type;
|
typedef size_t size_type;
|
||||||
@@ -566,7 +583,7 @@ public:
|
|||||||
//! Internal for static_shared_vector_cast
|
//! Internal for static_shared_vector_cast
|
||||||
template<typename FROM>
|
template<typename FROM>
|
||||||
shared_vector(const shared_vector<FROM> &src,
|
shared_vector(const shared_vector<FROM> &src,
|
||||||
typename meta::is_not_void<FROM, detail::_shared_vector_cast_tag>::type)
|
detail::_shared_vector_cast_tag)
|
||||||
:base_t(std::tr1::static_pointer_cast<E>(src.dataPtr()),
|
:base_t(std::tr1::static_pointer_cast<E>(src.dataPtr()),
|
||||||
src.dataOffset()*sizeof(FROM),
|
src.dataOffset()*sizeof(FROM),
|
||||||
src.dataCount()*sizeof(FROM))
|
src.dataCount()*sizeof(FROM))
|
||||||
@@ -575,12 +592,12 @@ public:
|
|||||||
|
|
||||||
shared_vector(shared_vector<void>& O,
|
shared_vector(shared_vector<void>& O,
|
||||||
detail::_shared_vector_freeze_tag t)
|
detail::_shared_vector_freeze_tag t)
|
||||||
:base_t(O,t)
|
:base_t(O,t), m_vtype(O.m_vtype)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
shared_vector(shared_vector<const void>& O,
|
shared_vector(shared_vector<const void>& O,
|
||||||
detail::_shared_vector_thaw_tag t)
|
detail::_shared_vector_thaw_tag t)
|
||||||
:base_t(O,t)
|
:base_t(O,t), m_vtype(O.m_vtype)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
shared_vector& operator=(const shared_vector& o)
|
shared_vector& operator=(const shared_vector& o)
|
||||||
@@ -602,6 +619,64 @@ public:
|
|||||||
ScalarType original_type() const {return m_vtype;}
|
ScalarType original_type() const {return m_vtype;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace detail {
|
||||||
|
template<typename TO, typename FROM, class Enable = void>
|
||||||
|
struct static_shared_vector_caster { /* no default */ };
|
||||||
|
// from void to non-void with same const-ness
|
||||||
|
template<typename TO>
|
||||||
|
struct static_shared_vector_caster<TO, void,
|
||||||
|
typename meta::_and<meta::same_const<TO,void>, meta::is_not_void<TO> >::type> {
|
||||||
|
static inline shared_vector<TO> op(const shared_vector<void>& src) {
|
||||||
|
return shared_vector<TO>(src, detail::_shared_vector_cast_tag());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
template<typename TO>
|
||||||
|
struct static_shared_vector_caster<TO, const void,
|
||||||
|
typename meta::_and<meta::same_const<TO,const void>, meta::is_not_void<TO> >::type> {
|
||||||
|
static inline shared_vector<TO> op(const shared_vector<const void>& src) {
|
||||||
|
return shared_vector<TO>(src, detail::_shared_vector_cast_tag());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// from non-void to void with same const-ness
|
||||||
|
template<typename FROM>
|
||||||
|
struct static_shared_vector_caster<void, FROM,
|
||||||
|
typename meta::_and<meta::same_const<void,FROM>, meta::is_not_void<FROM> >::type> {
|
||||||
|
static FORCE_INLINE shared_vector<void> op(const shared_vector<FROM>& src) {
|
||||||
|
return shared_vector<void>(src, detail::_shared_vector_cast_tag());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
template<typename FROM>
|
||||||
|
struct static_shared_vector_caster<const void, FROM,
|
||||||
|
typename meta::_and<meta::same_const<const void,FROM>, meta::is_not_void<FROM> >::type> {
|
||||||
|
static FORCE_INLINE shared_vector<const void> op(const shared_vector<FROM>& src) {
|
||||||
|
return shared_vector<const void>(src, detail::_shared_vector_cast_tag());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// cast to same type, no-op
|
||||||
|
template<typename TOFRO>
|
||||||
|
struct static_shared_vector_caster<TOFRO,TOFRO,void> {
|
||||||
|
static FORCE_INLINE const shared_vector<TOFRO>& op(const shared_vector<TOFRO>& src) {
|
||||||
|
return src;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} // namespace detail
|
||||||
|
|
||||||
|
/** @brief Allow casting of shared_vector between types
|
||||||
|
*
|
||||||
|
* Currently only to/from void is implemented.
|
||||||
|
*
|
||||||
|
@warning Casting from void is undefined unless the offset and length
|
||||||
|
* are integer multiples of the size of the destination type.
|
||||||
|
*/
|
||||||
|
template<typename TO, typename FROM>
|
||||||
|
static FORCE_INLINE
|
||||||
|
shared_vector<TO>
|
||||||
|
static_shared_vector_cast(const shared_vector<FROM>& src)
|
||||||
|
{
|
||||||
|
return detail::static_shared_vector_caster<TO,FROM>::op(src);
|
||||||
|
}
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
// Default to type conversion using castUnsafe (C++ type casting) on each element
|
// Default to type conversion using castUnsafe (C++ type casting) on each element
|
||||||
@@ -634,7 +709,7 @@ namespace detail {
|
|||||||
return shared_vector<TO>(src, detail::_shared_vector_cast_tag());
|
return shared_vector<TO>(src, detail::_shared_vector_cast_tag());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// convert from void uses original type or throws an exception.
|
// convert from void uses original type or throws an exception.
|
||||||
template<typename TO, typename FROM>
|
template<typename TO, typename FROM>
|
||||||
struct shared_vector_converter<TO,FROM,
|
struct shared_vector_converter<TO,FROM,
|
||||||
@@ -662,30 +737,16 @@ namespace detail {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @brief Allow casting of shared_vector between types
|
|
||||||
*
|
|
||||||
* Currently only to/from void is implemented.
|
|
||||||
*
|
|
||||||
@warning Casting from void is undefined unless the offset and length
|
|
||||||
* are integer multiples of the size of the destination type.
|
|
||||||
*/
|
|
||||||
template<typename TO, typename FROM>
|
|
||||||
static FORCE_INLINE
|
|
||||||
shared_vector<TO>
|
|
||||||
static_shared_vector_cast(const shared_vector<FROM>& src,
|
|
||||||
typename meta::same_const<TO,FROM,int>::type = 0)
|
|
||||||
{
|
|
||||||
return shared_vector<TO>(src, detail::_shared_vector_cast_tag());
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @brief Allow converting of shared_vector between types
|
/** @brief Allow converting of shared_vector between types
|
||||||
*
|
*
|
||||||
* Conversion utilizes castUnsafe<TO,FROM>().
|
* Conversion utilizes castUnsafe<TO,FROM>().
|
||||||
*
|
*
|
||||||
* Converting to/from void is supported. Convert to void
|
* Converting to/from void is supported. Convert to void
|
||||||
* is an alias for static_shared_vector_cast<void>().
|
* is an alias for static_shared_vector_cast<void>().
|
||||||
* Convert from void utilizes shared_vector<void>::original_type()
|
* Convert from void utilizes shared_vector<void>::original_type().
|
||||||
* and throws std::runtime_error if this is not valid.
|
*
|
||||||
|
* @throws std::runtime_error if cast is not valid.
|
||||||
|
* @throws std::bad_alloc for out of memory condition
|
||||||
*/
|
*/
|
||||||
template<typename TO, typename FROM>
|
template<typename TO, typename FROM>
|
||||||
static FORCE_INLINE
|
static FORCE_INLINE
|
||||||
@@ -861,8 +922,11 @@ std::ostream& operator<<(std::ostream& strm, const epics::pvData::shared_vector<
|
|||||||
* shared_vector has additional constructors from raw pointers
|
* shared_vector has additional constructors from raw pointers
|
||||||
* and shared_ptr s.
|
* and shared_ptr s.
|
||||||
*
|
*
|
||||||
* The copy constructor and assignment operator allow implicit
|
* Implicit casting is not allowed. Instead use
|
||||||
* casting from type 'shared_vector<T>' to 'shared_vector<const T>'.
|
* const_shared_vector_cast()/freeze()/thaw() (@ref vectorconst)
|
||||||
|
* to casting between 'T' and 'const T'.
|
||||||
|
* Use static_shared_vector_cast() to cast between
|
||||||
|
* void and non-void (same const-ness).
|
||||||
*
|
*
|
||||||
* To facilitate safe modification the methods unique() and
|
* To facilitate safe modification the methods unique() and
|
||||||
* make_unique() are provided.
|
* make_unique() are provided.
|
||||||
@@ -964,17 +1028,15 @@ Type #2 is constant reference to a mutable value.
|
|||||||
Type #3 is a mutable reference to a constant value.
|
Type #3 is a mutable reference to a constant value.
|
||||||
Type #4 is a constant reference to a constant value.
|
Type #4 is a constant reference to a constant value.
|
||||||
|
|
||||||
Casting between const and non-const references of the same value type
|
|
||||||
is governed by the normal C++ casting rules.
|
|
||||||
|
|
||||||
Casting between const and non-const values does @b not follow the normal
|
Casting between const and non-const values does @b not follow the normal
|
||||||
C++ casting rules.
|
C++ casting rules (no implicit cast).
|
||||||
|
|
||||||
For casting between shared_vector<T> and shared_vector<const T>
|
For casting between shared_vector<T> and shared_vector<const T>
|
||||||
explicit casting operations are required. These operations are
|
explicit casting operations are required. These operations are
|
||||||
@b freeze() (non-const to const) and @b thaw() (const to non-const).
|
@b freeze() (non-const to const) and @b thaw() (const to non-const).
|
||||||
|
|
||||||
A shared_vector<const T> is "frozen" as its value can not be modified.
|
A 'shared_vector<const T>' is "frozen" as its value can not be modified.
|
||||||
|
However it can still be sliced because the reference is not const.
|
||||||
|
|
||||||
These functions are defined like:
|
These functions are defined like:
|
||||||
|
|
||||||
@@ -998,17 +1060,18 @@ The following guarantees are provided by both functions:
|
|||||||
# The returned reference points to a value which is only referenced by
|
# The returned reference points to a value which is only referenced by
|
||||||
shared_vectors with the same value const-ness as the returned reference.
|
shared_vectors with the same value const-ness as the returned reference.
|
||||||
|
|
||||||
Please note that the argument of both freeze and thaw is a non-const
|
@note The argument of both freeze() and thaw() is a non-const
|
||||||
reference which will always be cleared.
|
reference which will always be cleared.
|
||||||
|
|
||||||
@section vfreeze Freezing
|
@section vfreeze Freezing
|
||||||
|
|
||||||
The act of freezing a shared_vector requires that the shared_vector
|
The act of freezing a shared_vector requires that the shared_vector
|
||||||
passed in must be unique() or an exception is thrown. This is
|
passed in must be unique() or an exception is thrown.
|
||||||
done to reduce the possibility of accidental copying.
|
No copy is made.
|
||||||
|
|
||||||
This possibility can be avoided by calling the make_unique() on a
|
The possibility of an exception can be avoided by calling the make_unique() on a
|
||||||
shared_vector before passing it to freeze().
|
shared_vector before passing it to freeze().
|
||||||
|
This will make a copy if necessary.
|
||||||
|
|
||||||
@section vthaw Thawing
|
@section vthaw Thawing
|
||||||
|
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* status.h */
|
/* status.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mse
|
* @author mse
|
||||||
@@ -103,9 +102,7 @@ namespace epics { namespace pvData {
|
|||||||
void dump(std::ostream& o) const;
|
void dump(std::ostream& o) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
static std::string m_emptyStringtring;
|
|
||||||
|
|
||||||
StatusType m_statusType;
|
StatusType m_statusType;
|
||||||
std::string m_message;
|
std::string m_message;
|
||||||
std::string m_stackDump;
|
std::string m_stackDump;
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/** C++ Template meta programming helpers
|
/** C++ Template meta programming helpers
|
||||||
*/
|
*/
|
||||||
@@ -11,7 +10,9 @@
|
|||||||
// gently nudge the compiler to inline our wrappers
|
// gently nudge the compiler to inline our wrappers
|
||||||
// Warning: Only use this when the template body is *small*.
|
// Warning: Only use this when the template body is *small*.
|
||||||
// You have been warned!
|
// You have been warned!
|
||||||
#if defined(__GNUC__) && __GNUC__>=3
|
#if defined(__MINGW32__)
|
||||||
|
# define FORCE_INLINE inline
|
||||||
|
#elif defined(__GNUC__) && __GNUC__>=3
|
||||||
# define FORCE_INLINE __attribute__((always_inline)) inline
|
# define FORCE_INLINE __attribute__((always_inline)) inline
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
# define FORCE_INLINE __forceinline
|
# define FORCE_INLINE __forceinline
|
||||||
296
src/misc/pv/thread.h
Normal file
296
src/misc/pv/thread.h
Normal file
@@ -0,0 +1,296 @@
|
|||||||
|
/* thread.h */
|
||||||
|
/*
|
||||||
|
* Copyright information and license terms for this software can be
|
||||||
|
* found in the file LICENSE that is included with the distribution
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @author mrk
|
||||||
|
*/
|
||||||
|
#ifndef THREAD_H
|
||||||
|
#define THREAD_H
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
#if __cplusplus>=201103L
|
||||||
|
#include <functional>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <epicsThread.h>
|
||||||
|
#include <shareLib.h>
|
||||||
|
|
||||||
|
#include <pv/noDefaultMethods.h>
|
||||||
|
#include <pv/pvType.h>
|
||||||
|
|
||||||
|
|
||||||
|
namespace epics { namespace pvData {
|
||||||
|
|
||||||
|
enum ThreadPriority {
|
||||||
|
lowestPriority =epicsThreadPriorityLow,
|
||||||
|
lowerPriority =epicsThreadPriorityLow + 15,
|
||||||
|
lowPriority =epicsThreadPriorityMedium - 15,
|
||||||
|
middlePriority =epicsThreadPriorityMedium,
|
||||||
|
highPriority =epicsThreadPriorityMedium + 15,
|
||||||
|
higherPriority =epicsThreadPriorityHigh - 15,
|
||||||
|
highestPriority =epicsThreadPriorityHigh
|
||||||
|
};
|
||||||
|
|
||||||
|
class Thread;
|
||||||
|
typedef std::tr1::shared_ptr<Thread> ThreadPtr;
|
||||||
|
typedef std::tr1::shared_ptr<epicsThread> EpicsThreadPtr;
|
||||||
|
|
||||||
|
typedef epicsThreadRunable Runnable;
|
||||||
|
|
||||||
|
//! Helper for those cases where a class should have more than one runnable
|
||||||
|
template<typename C>
|
||||||
|
class epicsShareClass RunnableMethod : public Runnable, private NoDefaultMethods
|
||||||
|
{
|
||||||
|
typedef void (C::*meth_t)();
|
||||||
|
C *inst;
|
||||||
|
meth_t meth;
|
||||||
|
|
||||||
|
virtual void run()
|
||||||
|
{
|
||||||
|
(inst->*meth)();
|
||||||
|
}
|
||||||
|
public:
|
||||||
|
RunnableMethod(C* inst, void (C::*meth)())
|
||||||
|
:inst(inst), meth(meth)
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace detail {
|
||||||
|
struct FuncRunner : public epicsThreadRunable
|
||||||
|
{
|
||||||
|
typedef void (*fn_t)(void*);
|
||||||
|
fn_t fn;
|
||||||
|
void *arg;
|
||||||
|
FuncRunner(fn_t f, void *a) :fn(f), arg(a) {}
|
||||||
|
virtual ~FuncRunner(){}
|
||||||
|
virtual void run()
|
||||||
|
{
|
||||||
|
(*fn)(arg);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
template<typename C>
|
||||||
|
struct MethRunner : public epicsThreadRunable
|
||||||
|
{
|
||||||
|
typedef void(C::*fn_t)();
|
||||||
|
fn_t fn;
|
||||||
|
C* inst;
|
||||||
|
MethRunner(C* i, fn_t f) :fn(f), inst(i) {}
|
||||||
|
virtual ~MethRunner() {}
|
||||||
|
virtual void run()
|
||||||
|
{
|
||||||
|
(inst->*fn)();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#if __cplusplus>=201103L
|
||||||
|
struct BindRunner : public epicsThreadRunable
|
||||||
|
{
|
||||||
|
typedef std::function<void()> fn_t;
|
||||||
|
fn_t fn;
|
||||||
|
BindRunner(const fn_t f) : fn(f) {}
|
||||||
|
virtual ~BindRunner() {}
|
||||||
|
virtual void run()
|
||||||
|
{
|
||||||
|
fn();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
} // namespace detail
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief C++ wrapper for epicsThread from EPICS base.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class epicsShareClass Thread : public epicsThread, private NoDefaultMethods {
|
||||||
|
public:
|
||||||
|
/** @brief Holds all the configuration necessary to launch a @class Thread
|
||||||
|
*
|
||||||
|
* The defaults may be used except for the runnable, which must be given
|
||||||
|
* either in the constructor, or the @method run() method.
|
||||||
|
*
|
||||||
|
* @note Instances of @class Config may not be reused.
|
||||||
|
*
|
||||||
|
* Defaults:
|
||||||
|
* name: ""
|
||||||
|
* priority: epicsThreadPriorityLow (aka epics::pvData::lowestPriority)
|
||||||
|
* stack size: epicsThreadStackSmall
|
||||||
|
* auto start: true
|
||||||
|
* runner: nil (must be set explictly)
|
||||||
|
*
|
||||||
|
@code
|
||||||
|
stuct bar { void meth(); ... } X;
|
||||||
|
// with a static thread name
|
||||||
|
Thread foo(Thread::Config(&X, &bar::meth)
|
||||||
|
.name("example")
|
||||||
|
.prio(epicsThreadPriorityHigh));
|
||||||
|
|
||||||
|
// with a constructed thread name
|
||||||
|
Thread foo(Thread::Config(&X, &bar::meth)
|
||||||
|
.prio(epicsThreadPriorityHigh)
|
||||||
|
<<"example"<<1);
|
||||||
|
@endcode
|
||||||
|
*/
|
||||||
|
class epicsShareClass Config
|
||||||
|
{
|
||||||
|
unsigned int p_prio, p_stack;
|
||||||
|
std::ostringstream p_strm;
|
||||||
|
bool p_autostart;
|
||||||
|
Runnable *p_runner;
|
||||||
|
#if __cplusplus>=201103L
|
||||||
|
typedef std::unique_ptr<Runnable> p_owned_runner_t;
|
||||||
|
#else
|
||||||
|
typedef std::auto_ptr<Runnable> p_owned_runner_t;
|
||||||
|
#endif
|
||||||
|
p_owned_runner_t p_owned_runner;
|
||||||
|
friend class Thread;
|
||||||
|
Runnable& x_getrunner()
|
||||||
|
{
|
||||||
|
if(!this->p_runner)
|
||||||
|
throw std::logic_error("Thread::Config missing run()");
|
||||||
|
return *this->p_runner;
|
||||||
|
}
|
||||||
|
void x_setdefault()
|
||||||
|
{
|
||||||
|
this->p_prio = epicsThreadPriorityLow;
|
||||||
|
this->p_autostart = true;
|
||||||
|
this->p_runner = NULL;
|
||||||
|
(*this).stack(epicsThreadStackSmall);
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
Config() {this->x_setdefault();}
|
||||||
|
Config(Runnable *r) {this->x_setdefault();this->run(r);}
|
||||||
|
Config(void(*fn)(void*), void *ptr) {this->x_setdefault();this->run(fn, ptr);}
|
||||||
|
template<typename C>
|
||||||
|
Config(C* inst, void(C::*meth)()) {this->x_setdefault();this->run(inst, meth);}
|
||||||
|
#if __cplusplus>=201103L
|
||||||
|
Config(const std::function<void()>& fn) {this->x_setdefault();this->run(fn);}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
inline Config& name(const std::string& n)
|
||||||
|
{ this->p_strm.str(n); return *this; }
|
||||||
|
inline Config& prio(unsigned int p)
|
||||||
|
{ this->p_prio = p; return *this; }
|
||||||
|
inline Config& stack(epicsThreadStackSizeClass s)
|
||||||
|
{ this->p_stack = epicsThreadGetStackSize(s); return *this; }
|
||||||
|
inline Config& autostart(bool a)
|
||||||
|
{ this->p_autostart = a; return *this; }
|
||||||
|
|
||||||
|
//! Thread will execute Runnable::run()
|
||||||
|
Config& run(Runnable* r)
|
||||||
|
{ this->p_runner = r; return *this; }
|
||||||
|
//! Thread will execute (*fn)(ptr)
|
||||||
|
Config& run(void(*fn)(void*), void *ptr)
|
||||||
|
{
|
||||||
|
this->p_owned_runner.reset(new detail::FuncRunner(fn, ptr));
|
||||||
|
this->p_runner = this->p_owned_runner.get();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
//! Thread will execute (inst->*meth)()
|
||||||
|
template<typename C>
|
||||||
|
Config& run(C* inst, void(C::*meth)())
|
||||||
|
{
|
||||||
|
this->p_owned_runner.reset(new detail::MethRunner<C>(inst, meth));
|
||||||
|
this->p_runner = this->p_owned_runner.get();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
#if __cplusplus>=201103L
|
||||||
|
Config& run(const std::function<void()>& fn)
|
||||||
|
{
|
||||||
|
this->p_owned_runner.reset(new detail::BindRunner(fn));
|
||||||
|
this->p_runner = this->p_owned_runner.get();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//! Append to thread name string. Argument must be understood by std::ostream::operator<<
|
||||||
|
template<typename T>
|
||||||
|
Config& operator<<(T x) { this->p_strm<<x; return *this; }
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Constructor
|
||||||
|
* @param name thread name.
|
||||||
|
* @param priority priority is one of:
|
||||||
|
@code
|
||||||
|
enum ThreadPriority {
|
||||||
|
lowestPriority, lowerPriority, lowPriority,
|
||||||
|
middlePriority,
|
||||||
|
highPriority, higherPriority, highestPriority
|
||||||
|
};
|
||||||
|
@endcode
|
||||||
|
* @param runnable this is a c function
|
||||||
|
* @param stkcls stack size as specified by epicsThreadStackSizeClass
|
||||||
|
*/
|
||||||
|
Thread(std::string name,
|
||||||
|
ThreadPriority priority,
|
||||||
|
Runnable *runnable,
|
||||||
|
epicsThreadStackSizeClass stkcls=epicsThreadStackSmall)
|
||||||
|
:epicsThread(*runnable,
|
||||||
|
name.c_str(),
|
||||||
|
epicsThreadGetStackSize(stkcls),
|
||||||
|
priority)
|
||||||
|
{
|
||||||
|
this->start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Constructor
|
||||||
|
* @param runnable this is a c function
|
||||||
|
* @name thread name.
|
||||||
|
* @param stkcls stack size as specified by epicsThreadStackSizeClass
|
||||||
|
* @param priority priority is one of:
|
||||||
|
@code
|
||||||
|
enum ThreadPriority {
|
||||||
|
lowestPriority, lowerPriority, lowPriority,
|
||||||
|
middlePriority,
|
||||||
|
highPriority, higherPriority, highestPriority
|
||||||
|
};
|
||||||
|
@endcode
|
||||||
|
*/
|
||||||
|
Thread(Runnable &runnable,
|
||||||
|
std::string name,
|
||||||
|
unsigned int stksize,
|
||||||
|
unsigned int priority=lowestPriority)
|
||||||
|
:epicsThread(runnable,
|
||||||
|
name.c_str(),
|
||||||
|
stksize,
|
||||||
|
priority)
|
||||||
|
{
|
||||||
|
this->start();
|
||||||
|
}
|
||||||
|
|
||||||
|
//! @brief Create a new thread using the given @class Config
|
||||||
|
//! @throws std::logic_error for improper @class Config (ie. missing runner)
|
||||||
|
Thread(Config& c)
|
||||||
|
:epicsThread(c.x_getrunner(), c.p_strm.str().c_str(),
|
||||||
|
c.p_stack, c.p_prio)
|
||||||
|
{
|
||||||
|
#if __cplusplus>=201103L
|
||||||
|
p_owned = std::move(c.p_owned_runner);
|
||||||
|
#else
|
||||||
|
p_owned = c.p_owned_runner;
|
||||||
|
#endif
|
||||||
|
if(c.p_autostart)
|
||||||
|
this->start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destructor
|
||||||
|
*/
|
||||||
|
~Thread()
|
||||||
|
{
|
||||||
|
this->exitWait();
|
||||||
|
}
|
||||||
|
|
||||||
|
Config::p_owned_runner_t p_owned;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}}
|
||||||
|
#endif /* THREAD_H */
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* timeFunction.h */
|
/* timeFunction.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* timer.h */
|
/* timer.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -115,7 +114,7 @@ public:
|
|||||||
bool isScheduled(TimerCallbackPtr const &timerCallback);
|
bool isScheduled(TimerCallbackPtr const &timerCallback);
|
||||||
/**
|
/**
|
||||||
* show the elements in the timer queue.
|
* show the elements in the timer queue.
|
||||||
* @parm o The output stream for the output
|
* @param o The output stream for the output
|
||||||
*/
|
*/
|
||||||
void dump(std::ostream& o);
|
void dump(std::ostream& o);
|
||||||
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/* Author: Michael Davidsaver */
|
/* Author: Michael Davidsaver */
|
||||||
#ifndef PVTYPECAST_H
|
#ifndef PVTYPECAST_H
|
||||||
@@ -10,23 +9,13 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#ifdef epicsExportSharedSymbols
|
|
||||||
#define typeCastepicsExportSharedSymbols
|
|
||||||
#undef epicsExportSharedSymbols
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <epicsConvert.h>
|
#include <epicsConvert.h>
|
||||||
|
#include <shareLib.h>
|
||||||
#ifdef typeCastepicsExportSharedSymbols
|
|
||||||
#define epicsExportSharedSymbols
|
|
||||||
#undef typeCastepicsExportSharedSymbols
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <pv/pvType.h>
|
#include <pv/pvType.h>
|
||||||
#include <pv/pvIntrospect.h>
|
#include <pv/pvIntrospect.h>
|
||||||
#include <pv/templateMeta.h>
|
#include <pv/templateMeta.h>
|
||||||
|
|
||||||
#include <shareLib.h>
|
|
||||||
|
|
||||||
namespace epics { namespace pvData {
|
namespace epics { namespace pvData {
|
||||||
|
|
||||||
@@ -1,14 +1,16 @@
|
|||||||
/* requester.cpp */
|
/* requester.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
*/
|
*/
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <epicsMutex.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <pv/lock.h>
|
#include <pv/lock.h>
|
||||||
@@ -34,6 +36,9 @@ string getMessageTypeName(MessageType messageType)
|
|||||||
return messageTypeName[messageType];
|
return messageTypeName[messageType];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Requester::message(std::string const & message,MessageType messageType)
|
||||||
|
{
|
||||||
|
std::cerr << "[" << getRequesterName() << "] message(" << message << ", " << getMessageTypeName(messageType) << ")\n";
|
||||||
|
}
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* serializeHelper.cpp
|
* serializeHelper.cpp
|
||||||
@@ -12,8 +11,11 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include <epicsEndian.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <pv/pvType.h>
|
#include <pv/pvType.h>
|
||||||
|
#include <pv/byteBuffer.h>
|
||||||
#include <pv/epicsException.h>
|
#include <pv/epicsException.h>
|
||||||
#include <pv/byteBuffer.h>
|
#include <pv/byteBuffer.h>
|
||||||
#include <pv/serializeHelper.h>
|
#include <pv/serializeHelper.h>
|
||||||
@@ -139,6 +141,132 @@ namespace epics {
|
|||||||
else
|
else
|
||||||
return emptyStringtring;
|
return emptyStringtring;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
using namespace epics::pvData;
|
||||||
|
|
||||||
|
struct ToString : public epics::pvData::SerializableControl
|
||||||
|
{
|
||||||
|
typedef std::vector<epicsUInt8> buf_type;
|
||||||
|
buf_type buf;
|
||||||
|
buf_type& out;
|
||||||
|
ByteBuffer bufwrap;
|
||||||
|
|
||||||
|
ToString(buf_type& out, int byteOrder = EPICS_BYTE_ORDER)
|
||||||
|
:buf(16*1024)
|
||||||
|
,out(out)
|
||||||
|
,bufwrap((char*)&buf[0], buf.size(), byteOrder)
|
||||||
|
{}
|
||||||
|
|
||||||
|
virtual void flushSerializeBuffer()
|
||||||
|
{
|
||||||
|
size_t N = out.size();
|
||||||
|
out.resize(out.size()+bufwrap.getPosition());
|
||||||
|
std::copy(buf.begin(),
|
||||||
|
buf.begin()+bufwrap.getPosition(),
|
||||||
|
out.begin()+N);
|
||||||
|
bufwrap.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void ensureBuffer(std::size_t size)
|
||||||
|
{
|
||||||
|
flushSerializeBuffer();
|
||||||
|
assert(bufwrap.getRemaining()>0);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void alignBuffer(std::size_t alignment)
|
||||||
|
{
|
||||||
|
if(bufwrap.getRemaining()<alignment)
|
||||||
|
flushSerializeBuffer();
|
||||||
|
assert(bufwrap.getRemaining()>=alignment);
|
||||||
|
bufwrap.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);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
namespace epics {
|
||||||
|
namespace pvData {
|
||||||
|
void serializeToVector(const Serializable *S,
|
||||||
|
int byteOrder,
|
||||||
|
std::vector<epicsUInt8>& out)
|
||||||
|
{
|
||||||
|
ToString TS(out, byteOrder);
|
||||||
|
S->serialize(&TS.bufwrap, &TS);
|
||||||
|
TS.flushSerializeBuffer();
|
||||||
|
assert(TS.bufwrap.getPosition()==0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
struct FromString : public epics::pvData::DeserializableControl
|
||||||
|
{
|
||||||
|
ByteBuffer &buf;
|
||||||
|
epics::pvData::FieldCreatePtr create;
|
||||||
|
|
||||||
|
FromString(ByteBuffer& b)
|
||||||
|
:buf(b)
|
||||||
|
,create(epics::pvData::getFieldCreate())
|
||||||
|
{}
|
||||||
|
|
||||||
|
virtual void ensureData(std::size_t size)
|
||||||
|
{
|
||||||
|
if(size>buf.getRemaining())
|
||||||
|
throw std::logic_error("Incomplete buffer");
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void alignData(std::size_t alignment)
|
||||||
|
{
|
||||||
|
size_t pos = buf.getPosition(), k = alignment-1;
|
||||||
|
if(pos&k) {
|
||||||
|
std::size_t npad = alignment-(pos&k);
|
||||||
|
ensureData(npad);
|
||||||
|
buf.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 create->deserialize(buffer, this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace epics {
|
||||||
|
namespace pvData {
|
||||||
|
void deserializeFromBuffer(Serializable *S,
|
||||||
|
ByteBuffer& buf)
|
||||||
|
{
|
||||||
|
FromString F(buf);
|
||||||
|
S->deserialize(&buf, &F);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/*pvData.cpp*/
|
/*status.cpp*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -17,7 +16,6 @@ using std::string;
|
|||||||
namespace epics { namespace pvData {
|
namespace epics { namespace pvData {
|
||||||
|
|
||||||
const char* Status::StatusTypeName[] = { "OK", "WARNING", "ERROR", "FATAL" };
|
const char* Status::StatusTypeName[] = { "OK", "WARNING", "ERROR", "FATAL" };
|
||||||
string Status::m_emptyStringtring;
|
|
||||||
|
|
||||||
Status Status::Ok;
|
Status Status::Ok;
|
||||||
|
|
||||||
@@ -102,7 +100,8 @@ void Status::deserialize(ByteBuffer *buffer, DeserializableControl *flusher)
|
|||||||
if (m_statusType != STATUSTYPE_OK)
|
if (m_statusType != STATUSTYPE_OK)
|
||||||
{
|
{
|
||||||
m_statusType = STATUSTYPE_OK;
|
m_statusType = STATUSTYPE_OK;
|
||||||
m_message = m_stackDump = m_emptyStringtring;
|
m_message.clear();
|
||||||
|
m_stackDump.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,122 +0,0 @@
|
|||||||
/* thread.h */
|
|
||||||
/**
|
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* @author mrk
|
|
||||||
*/
|
|
||||||
#ifndef THREAD_H
|
|
||||||
#define THREAD_H
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#ifdef epicsExportSharedSymbols
|
|
||||||
#define threadepicsExportSharedSymbols
|
|
||||||
#undef epicsExportSharedSymbols
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <epicsThread.h>
|
|
||||||
|
|
||||||
#ifdef threadepicsExportSharedSymbols
|
|
||||||
#define epicsExportSharedSymbols
|
|
||||||
#undef threadepicsExportSharedSymbols
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <pv/noDefaultMethods.h>
|
|
||||||
#include <pv/pvType.h>
|
|
||||||
|
|
||||||
#include <shareLib.h>
|
|
||||||
|
|
||||||
namespace epics { namespace pvData {
|
|
||||||
|
|
||||||
enum ThreadPriority {
|
|
||||||
lowestPriority =epicsThreadPriorityLow,
|
|
||||||
lowerPriority =epicsThreadPriorityLow + 15,
|
|
||||||
lowPriority =epicsThreadPriorityMedium - 15,
|
|
||||||
middlePriority =epicsThreadPriorityMedium,
|
|
||||||
highPriority =epicsThreadPriorityMedium + 15,
|
|
||||||
higherPriority =epicsThreadPriorityHigh - 15,
|
|
||||||
highestPriority =epicsThreadPriorityHigh
|
|
||||||
};
|
|
||||||
|
|
||||||
class Thread;
|
|
||||||
typedef std::tr1::shared_ptr<Thread> ThreadPtr;
|
|
||||||
typedef std::tr1::shared_ptr<epicsThread> EpicsThreadPtr;
|
|
||||||
|
|
||||||
typedef epicsThreadRunable Runnable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief C++ wrapper for epicsThread from EPICS base.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class epicsShareClass Thread : public epicsThread, private NoDefaultMethods {
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Constructor
|
|
||||||
* @param name thread name.
|
|
||||||
* @param priority priority is one of:
|
|
||||||
@code
|
|
||||||
enum ThreadPriority {
|
|
||||||
lowestPriority, lowerPriority, lowPriority,
|
|
||||||
middlePriority,
|
|
||||||
highPriority, higherPriority, highestPriority
|
|
||||||
};
|
|
||||||
@endcode
|
|
||||||
* @param runnable this is a c function
|
|
||||||
* @param stkcls stack size as specified by epicsThreadStackSizeClass
|
|
||||||
*/
|
|
||||||
Thread(std::string name,
|
|
||||||
ThreadPriority priority,
|
|
||||||
Runnable *runnable,
|
|
||||||
epicsThreadStackSizeClass stkcls=epicsThreadStackSmall)
|
|
||||||
:epicsThread(*runnable,
|
|
||||||
name.c_str(),
|
|
||||||
epicsThreadGetStackSize(stkcls),
|
|
||||||
priority)
|
|
||||||
{
|
|
||||||
this->start();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Constructor
|
|
||||||
* @param runnable this is a c function
|
|
||||||
* @name thread name.
|
|
||||||
* @param stkcls stack size as specified by epicsThreadStackSizeClass
|
|
||||||
* @param priority priority is one of:
|
|
||||||
@code
|
|
||||||
enum ThreadPriority {
|
|
||||||
lowestPriority, lowerPriority, lowPriority,
|
|
||||||
middlePriority,
|
|
||||||
highPriority, higherPriority, highestPriority
|
|
||||||
};
|
|
||||||
@endcode
|
|
||||||
*/
|
|
||||||
Thread(Runnable &runnable,
|
|
||||||
std::string name,
|
|
||||||
unsigned int stksize,
|
|
||||||
unsigned int priority=lowestPriority)
|
|
||||||
:epicsThread(runnable,
|
|
||||||
name.c_str(),
|
|
||||||
stksize,
|
|
||||||
priority)
|
|
||||||
{
|
|
||||||
this->start();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destructor
|
|
||||||
*/
|
|
||||||
~Thread()
|
|
||||||
{
|
|
||||||
this->exitWait();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}}
|
|
||||||
#endif /* THREAD_H */
|
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* timeFunction.cpp */
|
/* timeFunction.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -13,6 +12,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
#include <epicsTime.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <pv/pvType.h>
|
#include <pv/pvType.h>
|
||||||
#include <pv/timeStamp.h>
|
#include <pv/timeStamp.h>
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
/* timer.cpp */
|
/* timer.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(NOMINMAX)
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -16,6 +15,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <epicsThread.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <pv/timer.h>
|
#include <pv/timer.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/* Author: Michael Davidsaver */
|
/* Author: Michael Davidsaver */
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#include <epicsConvert.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include "typeCast.h"
|
#include "pv/typeCast.h"
|
||||||
|
|
||||||
using epics::pvData::castUnsafe;
|
using epics::pvData::castUnsafe;
|
||||||
using epics::pvData::ScalarType;
|
using epics::pvData::ScalarType;
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
SRC_DIRS += $(PVDATA_SRC)/monitor
|
SRC_DIRS += $(PVDATA_SRC)/monitor
|
||||||
|
|
||||||
INC += monitor.h
|
INC += pv/monitor.h
|
||||||
INC += monitorPlugin.h
|
INC += pv/monitorPlugin.h
|
||||||
|
|
||||||
LIBSRCS += monitor.cpp
|
LIBSRCS += monitor.cpp
|
||||||
LIBSRCS += monitorPlugin.cpp
|
LIBSRCS += monitorPlugin.cpp
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/*monitor.cpp*/
|
/*monitor.cpp*/
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mse
|
* @author mse
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
/* monitorPlugin.cpp */
|
/* monitorPlugin.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define IN_MONITORPLUGIN_CPP
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
|
|
||||||
#include <pv/monitorPlugin.h>
|
#include <pv/monitorPlugin.h>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/* monitor.h */
|
/* monitor.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* monitorPlugin.h */
|
/* monitorPlugin.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -18,6 +17,16 @@
|
|||||||
|
|
||||||
#include <shareLib.h>
|
#include <shareLib.h>
|
||||||
|
|
||||||
|
#if !defined(IN_MONITORPLUGIN_CPP)
|
||||||
|
#warning monitorPlugin.h is deprecated
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(IN_MONITORPLUGIN_CPP) && defined(__GNUC__) && !(defined(__vxworks) && !defined(_WRS_VXWORKS_MAJOR))
|
||||||
|
#define USAGE_DEPRECATED __attribute__((deprecated))
|
||||||
|
#else
|
||||||
|
#define USAGE_DEPRECATED
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace epics { namespace pvData {
|
namespace epics { namespace pvData {
|
||||||
|
|
||||||
class MonitorPlugin;
|
class MonitorPlugin;
|
||||||
@@ -41,7 +50,7 @@ typedef std::tr1::shared_ptr<MonitorPluginManager> MonitorPluginManagerPtr;
|
|||||||
* A monitor is assumed to be associated with a field of a top-level
|
* A monitor is assumed to be associated with a field of a top-level
|
||||||
* structure.
|
* structure.
|
||||||
*/
|
*/
|
||||||
class epicsShareClass MonitorPlugin
|
class epicsShareClass USAGE_DEPRECATED MonitorPlugin
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~MonitorPlugin(){}
|
virtual ~MonitorPlugin(){}
|
||||||
@@ -66,9 +75,6 @@ public:
|
|||||||
MonitorElementPtr const &monitorElement) = 0;
|
MonitorElementPtr const &monitorElement) = 0;
|
||||||
/**
|
/**
|
||||||
* A monitor will be sent to the client.
|
* A monitor will be sent to the client.
|
||||||
* @param pvField The copy of the field being monitored.
|
|
||||||
* The plugin can modify the data.
|
|
||||||
* @param pvTop The top-level structure in which the field resides.
|
|
||||||
* @param monitorElement The data for the client.
|
* @param monitorElement The data for the client.
|
||||||
* The plugin is allowed to change the data values.
|
* The plugin is allowed to change the data values.
|
||||||
*/
|
*/
|
||||||
@@ -98,7 +104,7 @@ public:
|
|||||||
*
|
*
|
||||||
* Normlly a plugin is created for a single client.
|
* Normlly a plugin is created for a single client.
|
||||||
*/
|
*/
|
||||||
class epicsShareClass MonitorPluginCreator
|
class epicsShareClass USAGE_DEPRECATED MonitorPluginCreator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~MonitorPluginCreator() {}
|
virtual ~MonitorPluginCreator() {}
|
||||||
@@ -130,7 +136,7 @@ public:
|
|||||||
* This manages a set of monitor plugins.
|
* This manages a set of monitor plugins.
|
||||||
* @author mrk
|
* @author mrk
|
||||||
*/
|
*/
|
||||||
class epicsShareClass MonitorPluginManager
|
class epicsShareClass USAGE_DEPRECATED MonitorPluginManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
POINTER_DEFINITIONS(MonitorPluginManager);
|
POINTER_DEFINITIONS(MonitorPluginManager);
|
||||||
@@ -168,7 +174,7 @@ private:
|
|||||||
epics::pvData::Mutex mutex;
|
epics::pvData::Mutex mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#undef USAGE_DEPRECATED
|
||||||
|
|
||||||
}}
|
}}
|
||||||
#endif /* MONITORPLUGIN_H */
|
#endif /* MONITORPLUGIN_H */
|
||||||
@@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
SRC_DIRS += $(PVDATA_SRC)/property
|
SRC_DIRS += $(PVDATA_SRC)/property
|
||||||
|
|
||||||
INC += alarm.h
|
INC += pv/alarm.h
|
||||||
INC += pvAlarm.h
|
INC += pv/pvAlarm.h
|
||||||
INC += control.h
|
INC += pv/control.h
|
||||||
INC += pvControl.h
|
INC += pv/pvControl.h
|
||||||
INC += display.h
|
INC += pv/display.h
|
||||||
INC += pvDisplay.h
|
INC += pv/pvDisplay.h
|
||||||
INC += pvEnumerated.h
|
INC += pv/pvEnumerated.h
|
||||||
INC += timeStamp.h
|
INC += pv/timeStamp.h
|
||||||
INC += pvTimeStamp.h
|
INC += pv/pvTimeStamp.h
|
||||||
|
|
||||||
LIBSRCS += alarm.cpp
|
LIBSRCS += alarm.cpp
|
||||||
LIBSRCS += pvAlarm.cpp
|
LIBSRCS += pvAlarm.cpp
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/* alarm.cpp */
|
/* alarm.cpp */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -10,6 +9,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
#include <epicsMutex.h>
|
||||||
|
|
||||||
#define epicsExportSharedSymbols
|
#define epicsExportSharedSymbols
|
||||||
#include <pv/lock.h>
|
#include <pv/lock.h>
|
||||||
#include <pv/pvType.h>
|
#include <pv/pvType.h>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/* alarm.h */
|
/* alarm.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* control.h */
|
/* control.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* display.h */
|
/* display.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* pvAlarm.h */
|
/* pvAlarm.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* pvControl.h */
|
/* pvControl.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* pvDisplay.h */
|
/* pvDisplay.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
/* pvEnumerated.h */
|
/* pvEnumerated.h */
|
||||||
/**
|
/*
|
||||||
* Copyright - See the COPYRIGHT that is included with this distribution.
|
* Copyright information and license terms for this software can be
|
||||||
* EPICS pvData is distributed subject to a Software License Agreement found
|
* found in the file LICENSE that is included with the distribution
|
||||||
* in file LICENSE that is included with this distribution.
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @author mrk
|
* @author mrk
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user