using new copy API

This commit is contained in:
Matej Sekoranja
2015-02-18 10:04:19 +01:00
parent 35dcbf35b3
commit 36dac883f4
8 changed files with 6 additions and 17 deletions

View File

@ -9,7 +9,6 @@
* @date 2014.04.16 * @date 2014.04.16
*/ */
#include <pv/convert.h>
#include <pv/monitorPlugin.h> #include <pv/monitorPlugin.h>
#define epicsExportSharedSymbols #define epicsExportSharedSymbols
@ -23,7 +22,6 @@ using std::string;
namespace epics { namespace pvDatabase { namespace epics { namespace pvDatabase {
static string pluginName("onChange"); static string pluginName("onChange");
static ConvertPtr convert(getConvert());
class OnChangePlugin; class OnChangePlugin;
typedef std::tr1::shared_ptr<OnChangePlugin> OnChangePluginPtr; typedef std::tr1::shared_ptr<OnChangePlugin> OnChangePluginPtr;
@ -58,9 +56,9 @@ public:
PVStructurePtr const &pvTop, PVStructurePtr const &pvTop,
MonitorElementPtr const &monitorElement) MonitorElementPtr const &monitorElement)
{ {
bool isSame = convert->equals(pvNew,pvField); bool isSame = (*pvNew == *pvField);
if(isSame) return false; if(isSame) return false;
convert->copy(pvNew,pvField); pvField->copyUnchecked(*pvNew);
return raiseMonitor; return raiseMonitor;
} }
private: private:

View File

@ -10,7 +10,6 @@
*/ */
#include <pv/standardPVField.h> #include <pv/standardPVField.h>
#include <pv/convert.h>
#define epicsExportSharedSymbols #define epicsExportSharedSymbols
#include <pv/exampleLink.h> #include <pv/exampleLink.h>
@ -46,8 +45,7 @@ ExampleLink::ExampleLink(
PVStructurePtr const & pvStructure) PVStructurePtr const & pvStructure)
: PVRecord(recordName,pvStructure), : PVRecord(recordName,pvStructure),
providerName(providerName), providerName(providerName),
channelName(channelName), channelName(channelName)
convert(getConvert())
{ {
} }
@ -121,7 +119,7 @@ void ExampleLink::process()
} }
alarm.setSeverity(severity); alarm.setSeverity(severity);
} else { } else {
convert->copy(getPVValue,pvValue); pvValue->copyUnchecked(*getPVValue);
} }
alarm.setMessage(status.getMessage()); alarm.setMessage(status.getMessage());
pvAlarm.set(alarm); pvAlarm.set(alarm);
@ -160,7 +158,7 @@ void ExampleLink::getDone(
BitSetPtr const & bitSet) BitSetPtr const & bitSet)
{ {
this->status = status; this->status = status;
convert->copyStructure(pvStructure,getPVStructure); getPVStructure->copyUnchecked(*pvStructure);
this->bitSet = bitSet; this->bitSet = bitSet;
event.signal(); event.signal();
} }

View File

@ -83,7 +83,6 @@ private:
epics::pvData::PVStructurePtr const & pvStructure); epics::pvData::PVStructurePtr const & pvStructure);
std::string providerName; std::string providerName;
std::string channelName; std::string channelName;
epics::pvData::ConvertPtr convert;
epics::pvData::PVDoubleArrayPtr pvValue; epics::pvData::PVDoubleArrayPtr pvValue;
epics::pvData::PVTimeStamp pvTimeStamp; epics::pvData::PVTimeStamp pvTimeStamp;
epics::pvData::TimeStamp timeStamp; epics::pvData::TimeStamp timeStamp;

View File

@ -22,7 +22,6 @@
#include <pv/pvData.h> #include <pv/pvData.h>
#include <pv/pvCopy.h> #include <pv/pvCopy.h>
#include <pv/convert.h>
#include <pv/pvTimeStamp.h> #include <pv/pvTimeStamp.h>
#ifdef pvdatabaseEpicsExportSharedSymbols #ifdef pvdatabaseEpicsExportSharedSymbols
@ -237,7 +236,6 @@ private:
std::string recordName; std::string recordName;
epics::pvData::PVStructurePtr pvStructure; epics::pvData::PVStructurePtr pvStructure;
epics::pvData::ConvertPtr convert;
PVRecordStructurePtr pvRecordStructure; PVRecordStructurePtr pvRecordStructure;
std::list<PVListenerPtr> pvListenerList; std::list<PVListenerPtr> pvListenerList;
std::list<PVRecordClientPtr> pvRecordClientList; std::list<PVRecordClientPtr> pvRecordClientList;

View File

@ -39,7 +39,6 @@ PVRecord::PVRecord(
PVStructurePtr const & pvStructure) PVStructurePtr const & pvStructure)
: recordName(recordName), : recordName(recordName),
pvStructure(pvStructure), pvStructure(pvStructure),
convert(getConvert()),
depthGroupPut(0), depthGroupPut(0),
traceLevel(0), traceLevel(0),
isDestroyed(false), isDestroyed(false),
@ -98,7 +97,6 @@ void PVRecord::destroy()
} }
pvRecordStructure->destroy(); pvRecordStructure->destroy();
pvRecordStructure.reset(); pvRecordStructure.reset();
convert.reset();
pvStructure.reset(); pvStructure.reset();
unlock(); unlock();
} catch(...) { } catch(...) {

View File

@ -13,7 +13,6 @@
#include <epicsThread.h> #include <epicsThread.h>
#include <pv/timeStamp.h> #include <pv/timeStamp.h>
#include <pv/convert.h>
#include <pv/pvSubArrayCopy.h> #include <pv/pvSubArrayCopy.h>
#define epicsExportSharedSymbols #define epicsExportSharedSymbols
@ -30,7 +29,6 @@ using std::string;
namespace epics { namespace pvDatabase { namespace epics { namespace pvDatabase {
static ConvertPtr convert = getConvert();
static StructureConstPtr nullStructure; static StructureConstPtr nullStructure;
static PVStructurePtr nullPVStructure; static PVStructurePtr nullPVStructure;
static BitSetPtr nullBitSet; static BitSetPtr nullBitSet;

View File

@ -37,7 +37,6 @@ static Status wasDestroyedStatus(Status::STATUSTYPE_ERROR,"was destroyed");
static Status alreadyStartedStatus(Status::STATUSTYPE_ERROR,"already started"); static Status alreadyStartedStatus(Status::STATUSTYPE_ERROR,"already started");
static Status notStartedStatus(Status::STATUSTYPE_ERROR,"not started"); static Status notStartedStatus(Status::STATUSTYPE_ERROR,"not started");
static ConvertPtr convert = getConvert();
typedef Queue<MonitorElement> MonitorElementQueue; typedef Queue<MonitorElement> MonitorElementQueue;

View File

@ -26,6 +26,7 @@
#include <pv/standardField.h> #include <pv/standardField.h>
#include <pv/standardPVField.h> #include <pv/standardPVField.h>
#include <pv/channelProviderLocal.h> #include <pv/channelProviderLocal.h>
#include <pv/convert.h>
#include "powerSupply.h" #include "powerSupply.h"