moved operators to pvData/pvIntrospect, added copy/copyUnchecked methods

This commit is contained in:
Matej Sekoranja
2015-02-17 13:59:15 +01:00
parent 92a178cbf9
commit cc1536b6e1
9 changed files with 368 additions and 44 deletions

View File

@@ -242,4 +242,24 @@ std::ostream& PVStructureArray::dumpValue(std::ostream& o, std::size_t index) co
return o;
}
void PVStructureArray::copy(const PVStructureArray& from)
{
if(isImmutable())
throw std::invalid_argument("destination is immutable");
// TODO relaxed structure compare?
if(*getStructureArray().get() != *from.getStructureArray().get())
throw std::invalid_argument("structureArray definitions do not match");
copyUnchecked(from);
}
void PVStructureArray::copyUnchecked(const PVStructureArray& from)
{
if (this == &from)
return;
replace(from.view());
}
}}