From 70454a6006f326c81ceb27aef3c910b4956546e3 Mon Sep 17 00:00:00 2001 From: Dave Hickin Date: Fri, 24 Jul 2015 10:42:45 +0100 Subject: [PATCH] Remove calls of deprecated getScalarArrayField --- arrayPerformance/src/arrayPerformance.cpp | 6 +++--- exampleLink/src/exampleLink.cpp | 6 ++---- test/src/testPVCopy.cpp | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/arrayPerformance/src/arrayPerformance.cpp b/arrayPerformance/src/arrayPerformance.cpp index 46303e9..efe2e3f 100644 --- a/arrayPerformance/src/arrayPerformance.cpp +++ b/arrayPerformance/src/arrayPerformance.cpp @@ -59,9 +59,9 @@ bool ArrayPerformance::init() { initPVRecord(); - PVScalarArrayPtr pvScalarArray = getPVStructure()->getScalarArrayField("value",pvLong); - if(!pvScalarArray) return false; - pvValue = static_pointer_cast(pvScalarArray); + PVLongArrayPtr pvLongArray = getPVStructure()->getSubField("value"); + if(!pvLongArray) return false; + pvValue = pvLongArray; ArrayPerformancePtr xxx = dynamic_pointer_cast(getPtrSelf()); arrayPerformanceThread = ArrayPerformanceThreadPtr(new ArrayPerformanceThread(xxx)); arrayPerformanceThread->init(); diff --git a/exampleLink/src/exampleLink.cpp b/exampleLink/src/exampleLink.cpp index ac615cc..1d358cb 100644 --- a/exampleLink/src/exampleLink.cpp +++ b/exampleLink/src/exampleLink.cpp @@ -61,8 +61,7 @@ bool ExampleLink::init() PVStructurePtr pvStructure = getPVRecordStructure()->getPVStructure(); pvTimeStamp.attach(pvStructure->getSubField("timeStamp")); pvAlarm.attach(pvStructure->getSubField("alarm")); - pvValue = static_pointer_cast( - pvStructure->getScalarArrayField("value",pvDouble)); + pvValue = pvStructure->getSubField("value"); if(!pvValue) { return false; } @@ -93,8 +92,7 @@ bool ExampleLink::init() << status.getMessage() << endl; return false; } - getPVValue = static_pointer_cast( - getPVStructure->getScalarArrayField("value",pvDouble)); + getPVValue = getPVStructure->getSubField("value"); if(!getPVValue) { cout << getRecordName() << " get value not PVDoubleArray" << endl; return false; diff --git a/test/src/testPVCopy.cpp b/test/src/testPVCopy.cpp index 84ac342..94d8696 100644 --- a/test/src/testPVCopy.cpp +++ b/test/src/testPVCopy.cpp @@ -160,14 +160,14 @@ static void testPVScalarArray( shared_vector values(n); cout << endl; pvStructureRecord = pvRecord->getPVRecordStructure()->getPVStructure(); - pvValueRecord = pvStructureRecord->getScalarArrayField(valueNameRecord,scalarType); + pvValueRecord = pvStructureRecord->getSubField(valueNameRecord); for(size_t i=0; i xxx(freeze(values)); pvValueRecord->putFrom(xxx); StructureConstPtr structure = pvCopy->getStructure(); cout << "structure from copy" << endl << *structure << endl; pvStructureCopy = pvCopy->createPVStructure(); - pvValueCopy = pvStructureCopy->getScalarArrayField(valueNameCopy,scalarType); + pvValueCopy = pvStructureCopy->getSubField(valueNameCopy); bitSet = BitSetPtr(new BitSet(pvStructureCopy->getNumberFields())); pvCopy->initCopy(pvStructureCopy, bitSet); cout << "after initCopy pvValueCopy " << *pvValueCopy << endl;