changes for PVStructureArray

This commit is contained in:
Marty Kraimer
2012-07-08 12:51:46 -04:00
parent 5d6205cb44
commit 32790674d6
3 changed files with 14 additions and 28 deletions

View File

@@ -1067,29 +1067,7 @@ void Convert::copyStructureArray(
String message("Convert.copyStructureArray destination is immutable");
throw std::invalid_argument(message);
}
StructureConstPtr xxx = from->getStructureArray()->getStructure();
StructureConstPtr yyy = to->getStructureArray()->getStructure();
if(!isCopyStructureCompatible(xxx,yyy)) {
String message("Convert.copyStructureArray from and to are not compatible");
throw std::invalid_argument(message);
}
size_t length = from->getLength();
if(to->getCapacity()<length) to->setCapacity(length);
PVStructurePtr * fromArray = from->get();
PVStructurePtr * toArray = to->get();
for(size_t i=0; i<length; i++) {
if(fromArray[i].get()==NULL) {
toArray[i] = PVStructurePtr();
} else {
if(toArray[i].get()==0) {
StructureConstPtr structure = to->getStructureArray()->getStructure();
toArray[i] = pvDataCreate->createPVStructure(structure);
}
copyStructure(fromArray[i],toArray[i]);
}
}
to->setLength(length);
to->postPut();
to->put(0,from->getLength(),from->getVector(),0);
}
String Convert::toString(PVScalarPtr const & pv)