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

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