Implement PVStructureArray with shared_vector

Combine as much as possible with scalar array handling.

PVStructureArray becomes PVValueArray<shared_ptr<PVStructure> >

Bulk of shared implementation moved the PVVectorStorage
which has a parametrized base to avoid using multiple inheritance.
This commit is contained in:
Michael Davidsaver
2013-06-10 18:47:55 -04:00
parent 4e749cc8be
commit 7f9745c8d1
5 changed files with 374 additions and 480 deletions

View File

@@ -382,12 +382,15 @@ bool Convert::isCopyStructureArrayCompatible(
void Convert::copyStructureArray(
PVStructureArrayPtr const & from, PVStructureArrayPtr const & to)
{
if(to->isImmutable()) {
if(from==to) return;
String message("Convert.copyStructureArray destination is immutable");
throw std::invalid_argument(message);
if(from==to) {
return;
} else if(to->isImmutable()) {
throw std::invalid_argument("Convert.copyStructureArray destination is immutable");
}
to->put(0,from->getLength(),from->getVector(),0);
PVStructureArray::svector data;
from->swap(data);
to->replace(data);
from->swap(data);
}
void Convert::newLine(StringBuilder buffer, int indentLevel)