diff --git a/pvDataApp/factory/Compare.cpp b/pvDataApp/factory/Compare.cpp index d47d533..f6780dc 100644 --- a/pvDataApp/factory/Compare.cpp +++ b/pvDataApp/factory/Compare.cpp @@ -109,7 +109,8 @@ bool compareScalar(const PVScalarValue* left, const PVScalarValue* right) template bool compareArray(const PVValueArray* left, const PVValueArray* right) { - return std::equal(left->get(), left->get()+left->getLength(), right->get()); + typename PVValueArray::const_svector lhs(left->view()), rhs(right->view()); + return std::equal(lhs.begin(), lhs.end(), rhs.begin()); } // partially typed comparisons diff --git a/pvDataApp/factory/PVScalarArray.cpp b/pvDataApp/factory/PVScalarArray.cpp index 86f1821..19d0339 100644 --- a/pvDataApp/factory/PVScalarArray.cpp +++ b/pvDataApp/factory/PVScalarArray.cpp @@ -28,16 +28,4 @@ namespace epics { namespace pvData { return static_pointer_cast(PVField::getField()); } - template<> - std::ostream& PVValueArray::dumpValue(std::ostream& o, size_t index) const - { - return o << static_cast(*(get() + index)); - } - - template<> - std::ostream& PVValueArray::dumpValue(std::ostream& o, size_t index) const - { - return o << static_cast(*(get() + index)); - } - }} diff --git a/pvDataApp/factory/printer.cpp b/pvDataApp/factory/printer.cpp index 23f4d72..ad455fe 100644 --- a/pvDataApp/factory/printer.cpp +++ b/pvDataApp/factory/printer.cpp @@ -118,13 +118,16 @@ void PrinterBase::impl_print(const PVField& pv) } case structureArray: { const PVStructureArray &fld = *static_cast(next); - const PVStructureArray::pointer vals = fld.get(); + PVStructureArray::const_svector vals(fld.view()); inprog.push_back(next); beginStructureArray(fld); - for(size_t i=0, nfld=fld.getLength(); iget()); + } todo.push_back(marker); break; diff --git a/pvDataApp/pv/pvData.h b/pvDataApp/pv/pvData.h index 257fd34..30165ff 100644 --- a/pvDataApp/pv/pvData.h +++ b/pvDataApp/pv/pvData.h @@ -1167,23 +1167,22 @@ public: std::ostream& dumpValue(std::ostream& o) const { + const_svector v(this->view()); + typename const_svector::const_iterator it(v.begin()), + end(v.end()); o << '['; - std::size_t len = this->getLength(); - bool first = true; - for (std::size_t i = 0; i < len; i++) - { - if (first) - first = false; - else - o << ','; - dumpValue(o, i); - } + if(it!=end) { + o << print_cast(*it++); + for(; it!=end; ++it) + o << ',' << print_cast(*it); + + } return o << ']'; } std::ostream& dumpValue(std::ostream& o, size_t index) const { - return o << *(this->get() + index); + return o << print_cast(this->view().at(index)); } protected: