diff --git a/src/copy/pvCopy.cpp b/src/copy/pvCopy.cpp index 9c36913..5fc5c93 100644 --- a/src/copy/pvCopy.cpp +++ b/src/copy/pvCopy.cpp @@ -243,10 +243,9 @@ void PVCopy::updateCopySetBitSet( updateSubFieldSetBitSet(copyPVField,pvMasterField,bitSet); return; } - ConvertPtr convert = getConvert(); - bool isEqual = convert->equals(copyPVField,pvField); + bool isEqual = (*copyPVField == *pvField); if(!isEqual) { - convert->copy(pvField, copyPVField); + copyPVField->copyUnchecked(*pvField); bitSet->set(copyPVField->getFieldOffset()); } } @@ -499,17 +498,16 @@ void PVCopy::updateSubFieldSetBitSet( FieldConstPtr field = pvCopy->getField(); Type type = field->getType(); if(type!=epics::pvData::structure) { - ConvertPtr convert = getConvert(); - bool isEqual = convert->equals(pvCopy,pvMaster); + bool isEqual = (*pvCopy == *pvMaster); if(isEqual) { if(type==structureArray) { // always act as though a change occurred. // Note that array elements are shared. - bitSet->set(pvCopy->getFieldOffset()); + bitSet->set(pvCopy->getFieldOffset()); } } if(isEqual) return; - convert->copy(pvMaster, pvCopy); + pvCopy->copyUnchecked(*pvMaster); bitSet->set(pvCopy->getFieldOffset()); return; } @@ -574,7 +572,6 @@ void PVCopy::updateSubFieldFromBitSet( if(nextSet==string::npos) return; if(nextSet>=pvCopy->getNextFieldOffset()) return; } - ConvertPtr convert = getConvert(); if(pvCopy->getField()->getType()==epics::pvData::structure) { PVStructurePtr pvCopyStructure = static_pointer_cast(pvCopy); @@ -595,9 +592,9 @@ void PVCopy::updateSubFieldFromBitSet( } } else { if(toCopy) { - convert->copy(pvMasterField, pvCopy); + pvCopy->copyUnchecked(*pvMasterField); } else { - convert->copy(pvCopy, pvMasterField); + pvMasterField->copyUnchecked(*pvCopy); } } } diff --git a/src/factory/Convert.cpp b/src/factory/Convert.cpp index 359ea75..a50e1af 100644 --- a/src/factory/Convert.cpp +++ b/src/factory/Convert.cpp @@ -152,382 +152,6 @@ size_t Convert::toStringArray(PVScalarArrayPtr const & pv, return data.size(); } -bool Convert::isCopyCompatible(FieldConstPtr const &from, FieldConstPtr const &to) -{ - if(from->getType()!=to->getType()) return false; - switch(from->getType()) { - case scalar: - { - ScalarConstPtr xxx = static_pointer_cast(from); - ScalarConstPtr yyy = static_pointer_cast(to); - return isCopyScalarCompatible(xxx,yyy); - } - case scalarArray: - { - ScalarArrayConstPtr xxx = static_pointer_cast(from); - ScalarArrayConstPtr yyy = static_pointer_cast(to); - return isCopyScalarArrayCompatible(xxx,yyy); - } - case structure: - { - StructureConstPtr xxx = static_pointer_cast(from); - StructureConstPtr yyy = static_pointer_cast(to); - return isCopyStructureCompatible(xxx,yyy); - } - case structureArray: - { - StructureArrayConstPtr xxx = static_pointer_cast(from); - StructureArrayConstPtr yyy = static_pointer_cast(to); - return isCopyStructureArrayCompatible(xxx,yyy); - } - case union_: - { - UnionConstPtr xxx = static_pointer_cast(from); - UnionConstPtr yyy = static_pointer_cast(to); - return isCopyUnionCompatible(xxx,yyy); - } - case unionArray: - { - UnionArrayConstPtr xxx = static_pointer_cast(from); - UnionArrayConstPtr yyy = static_pointer_cast(to); - return isCopyUnionArrayCompatible(xxx,yyy); - } - } - string message("Convert::isCopyCompatible should never get here"); - throw std::logic_error(message); -} - -void Convert::copy(PVFieldPtr const & from, PVFieldPtr const & to) -{ - switch(from->getField()->getType()) { - case scalar: - { - PVScalarPtr xxx = static_pointer_cast(from); - PVScalarPtr yyy = static_pointer_cast(to); - copyScalar(xxx,yyy); - return; - } - case scalarArray: - { - PVScalarArrayPtr fromArray = static_pointer_cast(from); - PVScalarArrayPtr toArray = static_pointer_cast(to); - toArray->assign(*fromArray.get()); - return; - } - case structure: - { - PVStructurePtr xxx = static_pointer_cast(from); - PVStructurePtr yyy = static_pointer_cast(to); - copyStructure(xxx,yyy); - return; - } - case structureArray: { - PVStructureArrayPtr fromArray = static_pointer_cast(from); - PVStructureArrayPtr toArray = static_pointer_cast(to); - copyStructureArray(fromArray,toArray); - return; - } - case union_: - { - PVUnionPtr xxx = static_pointer_cast(from); - PVUnionPtr yyy = static_pointer_cast(to); - copyUnion(xxx,yyy); - return; - } - case unionArray: { - PVUnionArrayPtr fromArray = static_pointer_cast(from); - PVUnionArrayPtr toArray = static_pointer_cast(to); - copyUnionArray(fromArray,toArray); - return; - } - } -} - -bool Convert::isCopyScalarCompatible( - ScalarConstPtr const & fromField, ScalarConstPtr const & toField) -{ - ScalarType fromScalarType = fromField->getScalarType(); - ScalarType toScalarType = toField->getScalarType(); - if(fromScalarType==toScalarType) return true; - if(ScalarTypeFunc::isNumeric(fromScalarType) - && ScalarTypeFunc::isNumeric(toScalarType)) return true; - if(fromScalarType==pvString) return true; - if(toScalarType==pvString) return true; - return false; -} - -void Convert::copyScalar(PVScalarPtr const & from, PVScalarPtr const & to) -{ - if(to->isImmutable()) { - if(from==to) return; - string message("Convert.copyScalar destination is immutable"); - throw std::invalid_argument(message); - } - to->assign(*from.get()); -} - -bool Convert::isCopyScalarArrayCompatible(ScalarArrayConstPtr const &fromArray, - ScalarArrayConstPtr const &toArray) -{ - ScalarType fromType = fromArray->getElementType(); - ScalarType toType = toArray->getElementType(); - if(fromType==toType) return true; - if(ScalarTypeFunc::isNumeric(fromType) - && ScalarTypeFunc::isNumeric(toType)) return true; - if(toType==pvString) return true; - if(fromType==pvString) return true; - return false; -} - -bool Convert::isCopyStructureCompatible( - StructureConstPtr const &fromStruct, StructureConstPtr const &toStruct) -{ - FieldConstPtrArray const & fromFields = fromStruct->getFields(); - FieldConstPtrArray const & toFields = toStruct->getFields(); - size_t length = fromStruct->getNumberFields(); - if(length!=toStruct->getNumberFields()) return false; - for(size_t i=0; igetType(); - Type toType = to->getType(); - if(fromType!=toType) return false; - switch(fromType) { - case scalar: - { - ScalarConstPtr xxx = static_pointer_cast(from); - ScalarConstPtr yyy = static_pointer_cast(to); - if(!isCopyScalarCompatible(xxx,yyy)) return false; - } - break; - case scalarArray: - { - ScalarArrayConstPtr xxx = static_pointer_cast(from); - ScalarArrayConstPtr yyy = static_pointer_cast(to); - if(!isCopyScalarArrayCompatible(xxx,yyy)) return false; - } - break; - case structure: - { - StructureConstPtr xxx = static_pointer_cast(from); - StructureConstPtr yyy = static_pointer_cast(to); - if(!isCopyStructureCompatible(xxx,yyy)) return false; - } - break; - case structureArray: - { - StructureArrayConstPtr xxx = static_pointer_cast(from); - StructureArrayConstPtr yyy = static_pointer_cast(to); - if(!isCopyStructureArrayCompatible(xxx,yyy)) return false; - } - case union_: - { - UnionConstPtr xxx = static_pointer_cast(from); - UnionConstPtr yyy = static_pointer_cast(to); - if(!isCopyUnionCompatible(xxx,yyy)) return false; - } - break; - case unionArray: - { - UnionArrayConstPtr xxx = static_pointer_cast(from); - UnionArrayConstPtr yyy = static_pointer_cast(to); - if(!isCopyUnionArrayCompatible(xxx,yyy)) return false; - } - break; - } - } - return true; -} - -void Convert::copyStructure(PVStructurePtr const & from, PVStructurePtr const & to) -{ - if(to->isImmutable()) { - if(from==to) return; - throw std::invalid_argument("Convert.copyStructure destination is immutable"); - } - if(from==to) return; - PVFieldPtrArray const & fromDatas = from->getPVFields(); - PVFieldPtrArray const & toDatas = to->getPVFields(); - if(from->getStructure()->getNumberFields() - != to->getStructure()->getNumberFields()) { - string message("Convert.copyStructure Illegal copyStructure"); - throw std::invalid_argument(message); - } - size_t numberFields = from->getStructure()->getNumberFields(); - if(numberFields>=2) { - string name0 = fromDatas[0]->getFieldName(); - string name1 = fromDatas[1]->getFieldName(); - // look for enumerated structure and copy choices first - if(name0.compare("index")==0 && name1.compare("choices")==0) { - FieldConstPtr fieldIndex = fromDatas[0]->getField(); - FieldConstPtr fieldChoices = fromDatas[1]->getField(); - if(fieldIndex->getType()==scalar - && fieldChoices->getType()==scalarArray) { - PVScalarPtr pvScalar = static_pointer_cast(fromDatas[0]); - PVScalarArrayPtr pvArray = - static_pointer_cast(fromDatas[1]); - if((pvScalar->getScalar()->getScalarType()==pvInt) - && (pvArray->getScalarArray()->getElementType()==pvString)) { - PVScalarArrayPtr toArray = - static_pointer_cast(toDatas[1]); - toArray->assign(*pvArray.get()); - PVScalarPtr toScalar = static_pointer_cast(toDatas[0]); - copyScalar(pvScalar,toScalar); - return; - } - } - } - } - for(size_t i=0; i < numberFields; i++) { - PVFieldPtr fromData = fromDatas[i]; - PVFieldPtr toData = toDatas[i]; - Type fromType = fromData->getField()->getType(); - Type toType = toData->getField()->getType(); - if(fromType!=toType) { - string message("Convert.copyStructure Illegal copyStructure"); - throw std::invalid_argument(message); - } - if(toData->isImmutable()) { - if(fromData==toData) return; - throw std::invalid_argument("Convert.copyStructure destination is immutable"); - } - switch(fromType) { - case scalar: - { - PVScalarPtr xxx = static_pointer_cast(fromData); - PVScalarPtr yyy = static_pointer_cast(toData); - copyScalar(xxx,yyy); - break; - } - case scalarArray: - { - PVScalarArrayPtr fromArray = static_pointer_cast(fromData); - PVScalarArrayPtr toArray = static_pointer_cast(toData); - toArray->assign(*fromArray.get()); - break; - } - case structure: - { - PVStructurePtr xxx = static_pointer_cast(fromData); - PVStructurePtr yyy = static_pointer_cast(toData); - copyStructure(xxx,yyy); - break; - } - case structureArray: - { - PVStructureArrayPtr fromArray = - static_pointer_cast(fromData); - PVStructureArrayPtr toArray = - static_pointer_cast(toData); - copyStructureArray(fromArray,toArray); - break; - } - case union_: - { - PVUnionPtr xxx = static_pointer_cast(fromData); - PVUnionPtr yyy = static_pointer_cast(toData); - copyUnion(xxx,yyy); - break; - } - case unionArray: - { - PVUnionArrayPtr fromArray = - static_pointer_cast(fromData); - PVUnionArrayPtr toArray = - static_pointer_cast(toData); - copyUnionArray(fromArray,toArray); - break; - } - } - } -} - -bool Convert::isCopyUnionCompatible( - UnionConstPtr const &from, UnionConstPtr const &to) -{ - return *(from.get()) == *(to.get()); -} - -static PVDataCreatePtr pvDataCreate = getPVDataCreate(); - -void Convert::copyUnion(PVUnionPtr const & from, PVUnionPtr const & to) -{ - if(to->isImmutable()) { - if(from==to) return; - throw std::invalid_argument("Convert.copyUnion destination is immutable"); - } - if(from==to) return; - if(!isCopyUnionCompatible(from->getUnion(), to->getUnion())) { - throw std::invalid_argument("Illegal copyUnion"); - } - - PVFieldPtr fromValue = from->get(); - if (from->getUnion()->isVariant()) - { - if (fromValue.get() == 0) - to->set(PVField::shared_pointer()); - else - { - PVFieldPtr toValue = to->get(); - if (toValue.get() == 0 || *toValue->getField() != *fromValue->getField()) - { - toValue = pvDataCreate->createPVField(fromValue->getField()); - to->set(toValue); - } - copy(fromValue, toValue); - to->postPut(); - } - } - else - { - if (fromValue.get() == 0) - to->select(PVUnion::UNDEFINED_INDEX); - else - { - copy(fromValue, to->select(from->getSelectedIndex())); - } - to->postPut(); - } -} - -bool Convert::isCopyStructureArrayCompatible( - StructureArrayConstPtr const &from, StructureArrayConstPtr const &to) -{ - StructureConstPtr xxx = from->getStructure(); - StructureConstPtr yyy = to->getStructure(); - return isCopyStructureCompatible(xxx,yyy); -} - -void Convert::copyStructureArray( - PVStructureArrayPtr const & from, PVStructureArrayPtr const & to) -{ - if(from==to) { - return; - } else if(to->isImmutable()) { - throw std::invalid_argument("Convert.copyStructureArray destination is immutable"); - } - to->replace(from->view()); -} - -bool Convert::isCopyUnionArrayCompatible( - UnionArrayConstPtr const &from, UnionArrayConstPtr const &to) -{ - UnionConstPtr xxx = from->getUnion(); - UnionConstPtr yyy = to->getUnion(); - return isCopyUnionCompatible(xxx,yyy); -} - -void Convert::copyUnionArray( - PVUnionArrayPtr const & from, PVUnionArrayPtr const & to) -{ - if(from==to) { - return; - } else if(to->isImmutable()) { - throw std::invalid_argument("Convert.copyUnionArray destination is immutable"); - } - to->replace(from->view()); -} - void Convert::newLine(string *buffer, int indentLevel) { *buffer += "\n"; diff --git a/src/factory/FieldCreateFactory.cpp b/src/factory/FieldCreateFactory.cpp index 3f4c250..c26dd34 100644 --- a/src/factory/FieldCreateFactory.cpp +++ b/src/factory/FieldCreateFactory.cpp @@ -22,7 +22,6 @@ #define epicsExportSharedSymbols #include #include -#include #include #include diff --git a/src/factory/PVDataCreateFactory.cpp b/src/factory/PVDataCreateFactory.cpp index e8eb148..a622384 100644 --- a/src/factory/PVDataCreateFactory.cpp +++ b/src/factory/PVDataCreateFactory.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -537,7 +536,7 @@ PVFieldPtr PVDataCreate::createPVField(PVFieldPtr const & fieldToClone) StructureArrayConstPtr structureArray = from->getStructureArray(); PVStructureArrayPtr to = createPVStructureArray( structureArray); - getConvert()->copyStructureArray(from, to); + to->copyUnchecked(*from); return to; } case union_: @@ -552,7 +551,7 @@ PVFieldPtr PVDataCreate::createPVField(PVFieldPtr const & fieldToClone) = static_pointer_cast(fieldToClone); UnionArrayConstPtr unionArray = from->getUnionArray(); PVUnionArrayPtr to = createPVUnionArray(unionArray); - getConvert()->copyUnionArray(from, to); + to->copyUnchecked(*from); return to; } } @@ -602,7 +601,7 @@ PVScalarPtr PVDataCreate::createPVScalar(PVScalarPtr const & scalarToClone) { ScalarType scalarType = scalarToClone->getScalar()->getScalarType(); PVScalarPtr pvScalar = createPVScalar(scalarType); - getConvert()->copyScalar(scalarToClone, pvScalar); + pvScalar->copyUnchecked(*scalarToClone); return pvScalar; } @@ -712,7 +711,7 @@ PVStructurePtr PVDataCreate::createPVStructure(PVStructurePtr const & structToCl } StructureConstPtr structure = structToClone->getStructure(); PVStructurePtr pvStructure(new PVStructure(structure)); - getConvert()->copyStructure(structToClone,pvStructure); + pvStructure->copyUnchecked(*structToClone); return pvStructure; } diff --git a/src/factory/PVField.cpp b/src/factory/PVField.cpp index ee9c911..04a1769 100644 --- a/src/factory/PVField.cpp +++ b/src/factory/PVField.cpp @@ -16,7 +16,6 @@ #include #include #include -#include using std::tr1::const_pointer_cast; using std::size_t; diff --git a/src/factory/PVStructure.cpp b/src/factory/PVStructure.cpp index e127730..841e919 100644 --- a/src/factory/PVStructure.cpp +++ b/src/factory/PVStructure.cpp @@ -16,7 +16,6 @@ #define epicsExportSharedSymbols #include #include -#include #include #include @@ -388,8 +387,7 @@ void PVStructure::copy(const PVStructure& from) if(isImmutable()) throw std::invalid_argument("destination is immutable"); - // TODO relaxed compare? - if(*getStructure().get() != *from.getStructure().get()) + if(*getStructure() != *from.getStructure()) throw std::invalid_argument("structure definitions do not match"); copyUnchecked(from); @@ -405,7 +403,7 @@ void PVStructure::copyUnchecked(const PVStructure& from) size_t fieldsSize = fromPVFields.size(); for(size_t i = 0; icopyUnchecked(*fromPVFields[i].get()); + toPVFields[i]->copyUnchecked(*fromPVFields[i]); } } @@ -448,11 +446,11 @@ void PVStructure::copyUnchecked(const PVStructure& from, const BitSet& maskBitSe // serialize field or fields if(inumberFields==1) { - toPVFields[i]->copyUnchecked(*pvField.get()); + toPVFields[i]->copyUnchecked(*pvField); } else { PVStructure::shared_pointer fromPVStructure = std::tr1::static_pointer_cast(pvField); PVStructure::shared_pointer toPVStructure = std::tr1::static_pointer_cast(toPVFields[i]); - toPVStructure->copyUnchecked(*fromPVStructure.get(), maskBitSet, inverse); + toPVStructure->copyUnchecked(*fromPVStructure, maskBitSet, inverse); } } } diff --git a/src/factory/PVStructureArray.cpp b/src/factory/PVStructureArray.cpp index 9c0722f..2345044 100644 --- a/src/factory/PVStructureArray.cpp +++ b/src/factory/PVStructureArray.cpp @@ -14,7 +14,6 @@ #define epicsExportSharedSymbols #include -#include #include #include @@ -247,8 +246,7 @@ 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()) + if(*getStructureArray() != *from.getStructureArray()) throw std::invalid_argument("structureArray definitions do not match"); copyUnchecked(from); diff --git a/src/factory/PVUnion.cpp b/src/factory/PVUnion.cpp index 10d3094..b7102dc 100644 --- a/src/factory/PVUnion.cpp +++ b/src/factory/PVUnion.cpp @@ -16,7 +16,6 @@ #define epicsExportSharedSymbols #include #include -#include #include #include @@ -224,7 +223,7 @@ void PVUnion::copy(const PVUnion& from) if(isImmutable()) throw std::invalid_argument("destination is immutable"); - if(*getUnion().get() != *from.getUnion().get()) + if(*getUnion() != *from.getUnion()) throw std::invalid_argument("union definitions do not match"); copyUnchecked(from); @@ -246,12 +245,12 @@ void PVUnion::copyUnchecked(const PVUnion& from) if (toValue.get() == 0 || *toValue->getField() != *fromValue->getField()) { toValue = pvDataCreate->createPVField(fromValue->getField()); - toValue->copyUnchecked(*fromValue.get()); + toValue->copyUnchecked(*fromValue); set(toValue); } else { - toValue->copyUnchecked(*fromValue.get()); + toValue->copyUnchecked(*fromValue); postPut(); } } @@ -264,7 +263,7 @@ void PVUnion::copyUnchecked(const PVUnion& from) } else { - select(from.getSelectedIndex())->copyUnchecked(*fromValue.get()); + select(from.getSelectedIndex())->copyUnchecked(*fromValue); } postPut(); } diff --git a/src/factory/PVUnionArray.cpp b/src/factory/PVUnionArray.cpp index 425ab82..db46c08 100644 --- a/src/factory/PVUnionArray.cpp +++ b/src/factory/PVUnionArray.cpp @@ -14,7 +14,6 @@ #define epicsExportSharedSymbols #include -#include #include #include @@ -246,8 +245,7 @@ void PVUnionArray::copy(const PVUnionArray& from) if(isImmutable()) throw std::invalid_argument("destination is immutable"); - // TODO relaxed compare? - if(*getUnionArray().get() != *from.getUnionArray().get()) + if(*getUnionArray() != *from.getUnionArray()) throw std::invalid_argument("unionArray definitions do not match"); copyUnchecked(from); diff --git a/src/factory/StandardPVField.cpp b/src/factory/StandardPVField.cpp index f5738d6..3fff6fb 100644 --- a/src/factory/StandardPVField.cpp +++ b/src/factory/StandardPVField.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include diff --git a/src/misc/timer.cpp b/src/misc/timer.cpp index 6915471..b10f22f 100644 --- a/src/misc/timer.cpp +++ b/src/misc/timer.cpp @@ -14,9 +14,9 @@ #include #include +#include #define epicsExportSharedSymbols -#include #include using std::string; diff --git a/src/pv/convert.h b/src/pv/convert.h index 4e17b5a..a15b04e 100644 --- a/src/pv/convert.h +++ b/src/pv/convert.h @@ -163,128 +163,6 @@ public: std::size_t length, StringArray & to, std::size_t toOffset); - /** - * Are from and to valid arguments to copy. - * This first checks of both arguments have the same Type. - * Then calls one of isCopyScalarCompatible, - * isCopyArrayCompatible, or isCopyStructureCompatible. - * @param from The source. - * @param to The destination. - * @return (false,true) is the arguments (are not, are) compatible. - */ - bool isCopyCompatible(FieldConstPtr const & from, FieldConstPtr const & to); - /** - * Copy from a PVField to another PVField. - * This calls one on copyScalar, copyArray, copyStructure. - * The two arguments must be compatible. - * @param from The source. - * @param to The destination - * @throws std::invalid_argument if the arguments are not compatible. - */ - void copy(PVFieldPtr const & from, PVFieldPtr const & to); - /** - * Are from and to valid arguments to copyScalar. - * false will be returned if either argument is not a scalar as defined by Type.isScalar(). - * If both are scalars the return value is true if any of the following are true. - *
    - *
  • Both arguments are numeric.
  • - *
  • Both arguments have the same type.
  • - *
  • Either argument is a string.
  • - *
- * @param from The introspection interface for the from data. - * @param to The introspection interface for the to data.. - * @return (false,true) If the arguments (are not, are) compatible. - */ - bool isCopyScalarCompatible( - ScalarConstPtr const & from, - ScalarConstPtr const & to); - /** - * Copy from a scalar pv to another scalar pv. - * @param from the source. - * @param to the destination. - * @throws std::invalid_argument if the arguments are not compatible. - */ - void copyScalar(PVScalarPtr const & from, PVScalarPtr const & to); - /** - * Are from and to valid arguments to copyArray. - * The results are like isCopyScalarCompatible except that the tests are made on the elementType. - * @param from The from array. - * @param to The to array. - * @return (false,true) If the arguments (are not, are) compatible. - */ - bool isCopyScalarArrayCompatible( - ScalarArrayConstPtr const & from, - ScalarArrayConstPtr const & to); - /** - * Are from and to valid arguments for copyStructure. - * They are only compatible if they have the same Structure description. - * @param from from structure. - * @param to structure. - * @return (false,true) If the arguments (are not, are) compatible. - */ - bool isCopyStructureCompatible( - StructureConstPtr const & from, StructureConstPtr const & to); - /** - * Copy from a structure pv to another structure pv. - * NOTE: Only compatible nodes are copied. This means: - *
    - *
  • For scalar nodes this means that isCopyScalarCompatible is true.
  • - *
  • For array nodes this means that isCopyArrayCompatible is true.
  • - *
  • For structure nodes this means that isCopyStructureCompatible is true.
  • - *
  • Link nodes are not copied.
  • - *
- * @param from The source. - * @param to The destination. - * @throws std::invalid_argument if the arguments are not compatible. - */ - void copyStructure(PVStructurePtr const & from, PVStructurePtr const & to); - /** - * Are from and to valid for copyStructureArray. - * @param from The from StructureArray. - * @param to The to StructureArray. - * @return (false,true) If the arguments (are not, are) compatible. - */ - bool isCopyStructureArrayCompatible( - StructureArrayConstPtr const & from, StructureArrayConstPtr const & to); - /** - * Copy from a structure array to another structure array. - * @param from The source array. - * @param to The destination array. - */ - void copyStructureArray( - PVStructureArrayPtr const & from, PVStructureArrayPtr const & to); - /** - * Are from and to valid arguments for copyUnion. - * They are only compatible if they have the same Union description. - * @param from from union. - * @param to union. - * @return (false,true) If the arguments (are not, are) compatible. - */ - bool isCopyUnionCompatible( - UnionConstPtr const & from, UnionConstPtr const & to); - /** - * Copy from a union pv to another union pv. - * NOTE: Only compatible nodes are copied. - * @param from The source. - * @param to The destination. - * @throws std::invalid_argument if the arguments are not compatible. - */ - void copyUnion(PVUnionPtr const & from, PVUnionPtr const & to); - /** - * Are from and to valid for copyUnionArray. - * @param from The from UnionArray. - * @param to The to UnionArray. - * @return (false,true) If the arguments (are not, are) compatible. - */ - bool isCopyUnionArrayCompatible( - UnionArrayConstPtr const & from, UnionArrayConstPtr const & to); - /** - * Copy from a union array to another union array. - * @param from The source array. - * @param to The destination array. - */ - void copyUnionArray( - PVUnionArrayPtr const & from, PVUnionArrayPtr const & to); /** * Convert a PV to a . * @param pv a PV