Merge pull request #37 from mrkraimer/master
pvCopy.h now pvStructureCopy.h; copy name space now epics::pvCopy
This commit is contained in:
@ -15,10 +15,10 @@ INC += pv/pvDatabase.h
|
||||
INC += pv/traceRecord.h
|
||||
INC += pv/removeRecord.h
|
||||
|
||||
include $(PVDATABASE_SRC)/copy/Makefile
|
||||
include $(PVDATABASE_SRC)/database/Makefile
|
||||
include $(PVDATABASE_SRC)/pvAccess/Makefile
|
||||
include $(PVDATABASE_SRC)/special/Makefile
|
||||
include $(PVDATABASE_SRC)/copy/Makefile
|
||||
|
||||
pvDatabase_LIBS += $(EPICS_BASE_PVA_CORE_LIBS)
|
||||
pvDatabase_LIBS += $(EPICS_BASE_IOC_LIBS)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
SRC_DIRS += $(PVDATABASE_SRC)/copy
|
||||
|
||||
INC += pv/pvCopy.h
|
||||
INC += pv/pvStructureCopy.h
|
||||
INC += pv/pvPlugin.h
|
||||
INC += pv/pvArrayPlugin.h
|
||||
INC += pv/pvDeadbandPlugin.h
|
||||
|
@ -16,7 +16,9 @@
|
||||
#include <pv/pvData.h>
|
||||
#include <pv/pvPlugin.h>
|
||||
|
||||
namespace epics { namespace pvDatabase{
|
||||
#include <shareLib.h>
|
||||
|
||||
namespace epics { namespace pvCopy{
|
||||
|
||||
class PVArrayPlugin;
|
||||
class PVArrayFilter;
|
||||
@ -31,7 +33,7 @@ typedef std::tr1::shared_ptr<PVArrayFilter> PVArrayFilterPtr;
|
||||
* @author mrk
|
||||
* @since date 2017.02.23
|
||||
*/
|
||||
class PVArrayPlugin : public PVPlugin
|
||||
class epicsShareClass PVArrayPlugin : public PVPlugin
|
||||
{
|
||||
private:
|
||||
PVArrayPlugin();
|
||||
@ -59,7 +61,7 @@ public:
|
||||
/**
|
||||
* @brief A filter that gets a sub array from a PVScalarArray.
|
||||
*/
|
||||
class PVArrayFilter : public PVFilter
|
||||
class epicsShareClass PVArrayFilter : public PVFilter
|
||||
{
|
||||
private:
|
||||
long start;
|
||||
|
@ -16,7 +16,9 @@
|
||||
#include <pv/pvData.h>
|
||||
#include <pv/pvPlugin.h>
|
||||
|
||||
namespace epics { namespace pvDatabase{
|
||||
#include <shareLib.h>
|
||||
|
||||
namespace epics { namespace pvCopy{
|
||||
|
||||
class PVDeadbandPlugin;
|
||||
class PVDeadbandFilter;
|
||||
@ -31,7 +33,7 @@ typedef std::tr1::shared_ptr<PVDeadbandFilter> PVDeadbandFilterPtr;
|
||||
* @author mrk
|
||||
* @since date 2017.02.23
|
||||
*/
|
||||
class PVDeadbandPlugin : public PVPlugin
|
||||
class epicsShareClass PVDeadbandPlugin : public PVPlugin
|
||||
{
|
||||
private:
|
||||
PVDeadbandPlugin();
|
||||
@ -59,7 +61,7 @@ public:
|
||||
/**
|
||||
* @brief A Plugin for a filter that gets a sub array from a PVScalarDeadband.
|
||||
*/
|
||||
class PVDeadbandFilter : public PVFilter
|
||||
class epicsShareClass PVDeadbandFilter : public PVFilter
|
||||
{
|
||||
private:
|
||||
bool absolute;
|
||||
|
@ -16,9 +16,11 @@
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <pv/lock.h>
|
||||
#include <pv/pvCopy.h>
|
||||
#include <pv/pvStructureCopy.h>
|
||||
|
||||
namespace epics { namespace pvDatabase{
|
||||
#include <shareLib.h>
|
||||
|
||||
namespace epics { namespace pvCopy{
|
||||
|
||||
class PVPlugin;
|
||||
class PVFilter;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* pvCopy.h */
|
||||
/* pvStructureCopy.h */
|
||||
/*
|
||||
* Copyright information and license terms for this software can be
|
||||
* found in the file LICENSE that is included with the distribution
|
||||
@ -7,18 +7,22 @@
|
||||
* @author Marty Kraimer
|
||||
* @date 2013.04
|
||||
*/
|
||||
#ifndef PVCOPY_H
|
||||
#define PVCOPY_H
|
||||
#ifndef PVSTRUCTURECOPY_H
|
||||
#define PVSTRUCTURECOPY_H
|
||||
|
||||
#if defined(_WIN32) && !defined(NOMINMAX)
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <memory>
|
||||
|
||||
#include <shareLib.h>
|
||||
|
||||
#include <pv/pvData.h>
|
||||
#include <pv/bitSet.h>
|
||||
|
||||
namespace epics { namespace pvDatabase{
|
||||
#include <shareLib.h>
|
||||
|
||||
namespace epics { namespace pvCopy{
|
||||
|
||||
class PVCopyTraverseMasterCallback;
|
||||
typedef std::tr1::shared_ptr<PVCopyTraverseMasterCallback> PVCopyTraverseMasterCallbackPtr;
|
||||
@ -27,6 +31,11 @@ typedef std::tr1::shared_ptr<PVCopyTraverseMasterCallback> PVCopyTraverseMasterC
|
||||
* @brief Callback for traversing master structure
|
||||
*
|
||||
* Must be implemented by code that creates pvCopy.
|
||||
*
|
||||
* This was originally name pvCopy.h and implemented in pvDataCPP
|
||||
* When it was moved to pvDatabaseCPP it was renamed to prevent conflicts with
|
||||
* the version in pvDataCPP.
|
||||
* Also the namespace was changed from epics::pvData to epics::pvCopy
|
||||
*/
|
||||
class epicsShareClass PVCopyTraverseMasterCallback
|
||||
{
|
||||
@ -235,4 +244,4 @@ private:
|
||||
|
||||
}}
|
||||
|
||||
#endif /* PVCOPY_H */
|
||||
#endif /* PVSTRUCTURECOPY_H */
|
@ -17,7 +17,9 @@
|
||||
#include <pv/pvPlugin.h>
|
||||
#include <pv/pvTimeStamp.h>
|
||||
|
||||
namespace epics { namespace pvDatabase{
|
||||
#include <shareLib.h>
|
||||
|
||||
namespace epics { namespace pvCopy{
|
||||
|
||||
class PVTimestampPlugin;
|
||||
class PVTimestampFilter;
|
||||
@ -32,7 +34,7 @@ typedef std::tr1::shared_ptr<PVTimestampFilter> PVTimestampFilterPtr;
|
||||
* @author mrk
|
||||
* @since date 2017.03.24
|
||||
*/
|
||||
class PVTimestampPlugin : public PVPlugin
|
||||
class epicsShareClass PVTimestampPlugin : public PVPlugin
|
||||
{
|
||||
private:
|
||||
PVTimestampPlugin();
|
||||
@ -60,7 +62,7 @@ public:
|
||||
/**
|
||||
* @brief A filter that sets a timeStamp to the current time.
|
||||
*/
|
||||
class PVTimestampFilter : public PVFilter
|
||||
class epicsShareClass PVTimestampFilter : public PVFilter
|
||||
{
|
||||
private:
|
||||
epics::pvData::PVTimeStamp pvTimeStamp;
|
||||
|
@ -19,7 +19,7 @@ using std::tr1::static_pointer_cast;
|
||||
using std::vector;
|
||||
using namespace epics::pvData;
|
||||
|
||||
namespace epics { namespace pvDatabase{
|
||||
namespace epics { namespace pvCopy{
|
||||
|
||||
static ConvertPtr convert = getConvert();
|
||||
static std::string name("array");
|
||||
@ -34,8 +34,12 @@ PVArrayPlugin::~PVArrayPlugin()
|
||||
|
||||
void PVArrayPlugin::create()
|
||||
{
|
||||
PVArrayPluginPtr pvPlugin = PVArrayPluginPtr(new PVArrayPlugin());
|
||||
PVPluginRegistry::registerPlugin(name,pvPlugin);
|
||||
static bool firstTime = true;
|
||||
if(firstTime) {
|
||||
firstTime = false;
|
||||
PVArrayPluginPtr pvPlugin = PVArrayPluginPtr(new PVArrayPlugin());
|
||||
PVPluginRegistry::registerPlugin(name,pvPlugin);
|
||||
}
|
||||
}
|
||||
|
||||
PVFilterPtr PVArrayPlugin::create(
|
||||
|
@ -17,10 +17,8 @@
|
||||
#include <pv/thread.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include <pv/pvCopy.h>
|
||||
#include <pv/pvArrayPlugin.h>
|
||||
#include <pv/pvTimestampPlugin.h>
|
||||
#include <pv/pvDeadbandPlugin.h>
|
||||
#include <pv/pvPlugin.h>
|
||||
#include <pv/pvStructureCopy.h>
|
||||
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::tr1::dynamic_pointer_cast;
|
||||
@ -31,7 +29,7 @@ using std::endl;
|
||||
using std::vector;
|
||||
using namespace epics::pvData;
|
||||
|
||||
namespace epics { namespace pvDatabase {
|
||||
namespace epics { namespace pvCopy {
|
||||
|
||||
/**
|
||||
* Convenience method for implementing dump.
|
||||
@ -77,13 +75,6 @@ PVCopyPtr PVCopy::create(
|
||||
PVStructurePtr const &pvRequest,
|
||||
string const & structureName)
|
||||
{
|
||||
static bool firstTime = true;
|
||||
if(firstTime) {
|
||||
firstTime = false;
|
||||
PVArrayPlugin::create();
|
||||
PVTimestampPlugin::create();
|
||||
PVDeadbandPlugin::create();
|
||||
}
|
||||
PVStructurePtr pvStructure(pvRequest);
|
||||
if(structureName.size()>0) {
|
||||
if(pvStructure->getStructure()->getNumberFields()>0) {
|
||||
|
@ -19,7 +19,7 @@ using std::tr1::static_pointer_cast;
|
||||
using std::vector;
|
||||
using namespace epics::pvData;
|
||||
|
||||
namespace epics { namespace pvDatabase{
|
||||
namespace epics { namespace pvCopy{
|
||||
|
||||
static ConvertPtr convert = getConvert();
|
||||
static std::string name("deadband");
|
||||
@ -34,8 +34,12 @@ PVDeadbandPlugin::~PVDeadbandPlugin()
|
||||
|
||||
void PVDeadbandPlugin::create()
|
||||
{
|
||||
PVDeadbandPluginPtr pvPlugin = PVDeadbandPluginPtr(new PVDeadbandPlugin());
|
||||
PVPluginRegistry::registerPlugin(name,pvPlugin);
|
||||
static bool firstTime = true;
|
||||
if(firstTime) {
|
||||
firstTime = false;
|
||||
PVDeadbandPluginPtr pvPlugin = PVDeadbandPluginPtr(new PVDeadbandPlugin());
|
||||
PVPluginRegistry::registerPlugin(name,pvPlugin);
|
||||
}
|
||||
}
|
||||
|
||||
PVFilterPtr PVDeadbandPlugin::create(
|
||||
|
@ -5,11 +5,12 @@
|
||||
|
||||
#include <pv/pvData.h>
|
||||
#define epicsExportSharedSymbols
|
||||
#include <pv/pvStructureCopy.h>
|
||||
#include <pv/pvPlugin.h>
|
||||
|
||||
using namespace epics::pvData;
|
||||
|
||||
namespace epics { namespace pvDatabase{
|
||||
namespace epics { namespace pvCopy{
|
||||
|
||||
typedef std::map<std::string,PVPluginPtr> PVPluginMap;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include <pv/pvTimestampPlugin.h>
|
||||
#include <pv/pvCopy.h>
|
||||
#include <pv/pvStructureCopy.h>
|
||||
|
||||
using std::string;
|
||||
using std::size_t;
|
||||
@ -19,7 +19,7 @@ using std::tr1::static_pointer_cast;
|
||||
using std::vector;
|
||||
using namespace epics::pvData;
|
||||
|
||||
namespace epics { namespace pvDatabase{
|
||||
namespace epics { namespace pvCopy{
|
||||
|
||||
static ConvertPtr convert = getConvert();
|
||||
static std::string name("timestamp");
|
||||
@ -34,8 +34,12 @@ PVTimestampPlugin::~PVTimestampPlugin()
|
||||
|
||||
void PVTimestampPlugin::create()
|
||||
{
|
||||
PVTimestampPluginPtr pvPlugin = PVTimestampPluginPtr(new PVTimestampPlugin());
|
||||
PVPluginRegistry::registerPlugin(name,pvPlugin);
|
||||
static bool firstTime = true;
|
||||
if(firstTime) {
|
||||
firstTime = false;
|
||||
PVTimestampPluginPtr pvPlugin = PVTimestampPluginPtr(new PVTimestampPlugin());
|
||||
PVPluginRegistry::registerPlugin(name,pvPlugin);
|
||||
}
|
||||
}
|
||||
|
||||
PVFilterPtr PVTimestampPlugin::create(
|
||||
|
@ -10,13 +10,17 @@
|
||||
*/
|
||||
|
||||
#include <epicsGuard.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
|
||||
#include <pv/pvDatabase.h>
|
||||
#include <pv/pvStructureCopy.h>
|
||||
#include <pv/pvPlugin.h>
|
||||
#include <pv/pvArrayPlugin.h>
|
||||
#include <pv/pvTimestampPlugin.h>
|
||||
#include <pv/pvDeadbandPlugin.h>
|
||||
|
||||
using std::tr1::static_pointer_cast;
|
||||
using namespace epics::pvData;
|
||||
using namespace epics::pvCopy;
|
||||
using namespace std;
|
||||
|
||||
namespace epics { namespace pvDatabase {
|
||||
@ -25,13 +29,15 @@ namespace epics { namespace pvDatabase {
|
||||
|
||||
static PVDatabasePtr pvDatabaseMaster;
|
||||
|
||||
bool PVDatabase::getMasterFirstCall = true;
|
||||
|
||||
PVDatabasePtr PVDatabase::getMaster()
|
||||
{
|
||||
if(getMasterFirstCall) {
|
||||
getMasterFirstCall = false;
|
||||
static bool firstTime = true;
|
||||
if(firstTime) {
|
||||
firstTime = false;
|
||||
pvDatabaseMaster = PVDatabasePtr(new PVDatabase());
|
||||
PVArrayPlugin::create();
|
||||
PVTimestampPlugin::create();
|
||||
PVDeadbandPlugin::create();
|
||||
}
|
||||
return pvDatabaseMaster;
|
||||
}
|
||||
|
@ -12,12 +12,13 @@
|
||||
#include <epicsThread.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
|
||||
#include <pv/pvDatabase.h>
|
||||
#include <pv/pvStructureCopy.h>
|
||||
|
||||
|
||||
using std::tr1::static_pointer_cast;
|
||||
using namespace epics::pvData;
|
||||
using namespace epics::pvDatabase;
|
||||
using namespace std;
|
||||
|
||||
namespace epics { namespace pvDatabase {
|
||||
@ -236,7 +237,7 @@ bool PVRecord::addPVRecordClient(PVRecordClientPtr const & pvRecordClient)
|
||||
|
||||
bool PVRecord::addListener(
|
||||
PVListenerPtr const & pvListener,
|
||||
PVCopyPtr const & pvCopy)
|
||||
epics::pvCopy::PVCopyPtr const & pvCopy)
|
||||
{
|
||||
if(traceLevel>1) {
|
||||
cout << "PVRecord::addListener() " << recordName << endl;
|
||||
@ -267,7 +268,7 @@ void PVRecord::nextMasterPVField(PVFieldPtr const & pvField)
|
||||
|
||||
bool PVRecord::removeListener(
|
||||
PVListenerPtr const & pvListener,
|
||||
PVCopyPtr const & pvCopy)
|
||||
epics::pvCopy::PVCopyPtr const & pvCopy)
|
||||
{
|
||||
if(traceLevel>1) {
|
||||
cout << "PVRecord::removeListener() " << recordName << endl;
|
||||
|
@ -29,14 +29,15 @@
|
||||
#include <pv/status.h>
|
||||
#include <pv/serverContext.h>
|
||||
|
||||
|
||||
#ifdef channelProviderLocalEpicsExportSharedSymbols
|
||||
# define epicsExportSharedSymbols
|
||||
# undef channelProviderLocalEpicsExportSharedSymbols
|
||||
#endif
|
||||
|
||||
#include <shareLib.h>
|
||||
#include <pv/pvCopy.h>
|
||||
#include <pv/pvDatabase.h>
|
||||
#include <pv/pvStructureCopy.h>
|
||||
|
||||
namespace epics { namespace pvDatabase {
|
||||
|
||||
|
@ -18,14 +18,14 @@
|
||||
#include <pv/pvTimeStamp.h>
|
||||
#include <pv/rpcService.h>
|
||||
|
||||
|
||||
#ifdef pvdatabaseEpicsExportSharedSymbols
|
||||
# define epicsExportSharedSymbols
|
||||
# undef pvdatabaseEpicsExportSharedSymbols
|
||||
#endif
|
||||
|
||||
#include <shareLib.h>
|
||||
#include <pv/pvCopy.h>
|
||||
|
||||
#include <pv/pvStructureCopy.h>
|
||||
|
||||
namespace epics { namespace pvDatabase {
|
||||
|
||||
@ -65,7 +65,7 @@ typedef std::tr1::weak_ptr<PVDatabase> PVDatabaseWPtr;
|
||||
* @date 2012.11.20
|
||||
*/
|
||||
class epicsShareClass PVRecord :
|
||||
public PVCopyTraverseMasterCallback,
|
||||
public epics::pvCopy::PVCopyTraverseMasterCallback,
|
||||
public std::tr1::enable_shared_from_this<PVRecord>
|
||||
{
|
||||
public:
|
||||
@ -210,7 +210,7 @@ public:
|
||||
*/
|
||||
bool addListener(
|
||||
PVListenerPtr const & pvListener,
|
||||
PVCopyPtr const & pvCopy);
|
||||
epics::pvCopy::PVCopyPtr const & pvCopy);
|
||||
/**
|
||||
* @brief PVCopyTraverseMasterCallback method
|
||||
*
|
||||
@ -226,7 +226,7 @@ public:
|
||||
*/
|
||||
bool removeListener(
|
||||
PVListenerPtr const & pvListener,
|
||||
PVCopyPtr const & pvCopy);
|
||||
epics::pvCopy::PVCopyPtr const & pvCopy);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
using namespace epics::pvData;
|
||||
using namespace epics::pvAccess;
|
||||
using namespace epics::pvCopy;
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::tr1::dynamic_pointer_cast;
|
||||
using std::cout;
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
using namespace epics::pvData;
|
||||
using namespace epics::pvAccess;
|
||||
using namespace epics::pvCopy;
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::tr1::dynamic_pointer_cast;
|
||||
using std::cout;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
using namespace epics::pvData;
|
||||
using namespace epics::pvAccess;
|
||||
using namespace epics::pvCopy;
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <pv/pvTimeStamp.h>
|
||||
#include <pv/pvAlarm.h>
|
||||
#include <pv/pvDatabase.h>
|
||||
#include <pv/pvStructureCopy.h>
|
||||
|
||||
#ifdef listenerEpicsExportSharedSymbols
|
||||
# define epicsExportSharedSymbols
|
||||
@ -87,7 +88,7 @@ public:
|
||||
private:
|
||||
Listener(PVRecordPtr const & pvRecord)
|
||||
: pvCopy(
|
||||
PVCopy::create(
|
||||
epics::pvCopy::PVCopy::create(
|
||||
getPVDataCreate()->createPVStructure(
|
||||
pvRecord->getPVRecordStructure()->getPVStructure()),
|
||||
CreateRequest::create()->createRequest(""),
|
||||
@ -96,7 +97,7 @@ private:
|
||||
recordName(pvRecord->getRecordName())
|
||||
{
|
||||
}
|
||||
PVCopyPtr pvCopy;
|
||||
epics::pvCopy::PVCopyPtr pvCopy;
|
||||
PVStructurePtr pvStructure;
|
||||
string recordName;
|
||||
};
|
||||
|
@ -37,6 +37,7 @@ using namespace std;
|
||||
using std::tr1::static_pointer_cast;
|
||||
using namespace epics::pvData;
|
||||
using namespace epics::pvAccess;
|
||||
using namespace epics::pvCopy;
|
||||
using namespace epics::pvDatabase;
|
||||
|
||||
static bool debug = false;
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <pv/standardField.h>
|
||||
#include <pv/standardPVField.h>
|
||||
#include <pv/pvData.h>
|
||||
#include <pv/pvCopy.h>
|
||||
#include <pv/pvStructureCopy.h>
|
||||
#define epicsExportSharedSymbols
|
||||
#include "powerSupply.h"
|
||||
|
||||
@ -37,6 +37,7 @@ using namespace std;
|
||||
using std::tr1::static_pointer_cast;
|
||||
using namespace epics::pvData;
|
||||
using namespace epics::pvDatabase;
|
||||
using namespace epics::pvCopy;
|
||||
using std::string;
|
||||
|
||||
static bool debug = false;
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include <pv/standardPVField.h>
|
||||
#include <pv/channelProviderLocal.h>
|
||||
#include <pv/convert.h>
|
||||
#include <pv/pvStructureCopy.h>
|
||||
#include <pv/pvDatabase.h>
|
||||
#define epicsExportSharedSymbols
|
||||
#include "powerSupply.h"
|
||||
|
||||
@ -37,6 +39,7 @@ using namespace std;
|
||||
using std::tr1::static_pointer_cast;
|
||||
using namespace epics::pvData;
|
||||
using namespace epics::pvAccess;
|
||||
using namespace epics::pvCopy;
|
||||
using namespace epics::pvDatabase;
|
||||
|
||||
static bool debug = true;
|
||||
@ -265,6 +268,7 @@ static void ignoreTest()
|
||||
MAIN(testPlugin)
|
||||
{
|
||||
testPlan(22);
|
||||
PVDatabasePtr pvDatabase(PVDatabase::getMaster());
|
||||
deadbandTest();
|
||||
arrayTest();
|
||||
timeStampTest();
|
||||
|
Reference in New Issue
Block a user