don't use deprecated PVValueArray<T>::get()
This commit is contained in:
@@ -109,7 +109,8 @@ bool compareScalar(const PVScalarValue<T>* left, const PVScalarValue<T>* right)
|
||||
template<typename T>
|
||||
bool compareArray(const PVValueArray<T>* left, const PVValueArray<T>* right)
|
||||
{
|
||||
return std::equal(left->get(), left->get()+left->getLength(), right->get());
|
||||
typename PVValueArray<T>::const_svector lhs(left->view()), rhs(right->view());
|
||||
return std::equal(lhs.begin(), lhs.end(), rhs.begin());
|
||||
}
|
||||
|
||||
// partially typed comparisons
|
||||
|
||||
@@ -28,16 +28,4 @@ namespace epics { namespace pvData {
|
||||
return static_pointer_cast<const ScalarArray>(PVField::getField());
|
||||
}
|
||||
|
||||
template<>
|
||||
std::ostream& PVValueArray<int8>::dumpValue(std::ostream& o, size_t index) const
|
||||
{
|
||||
return o << static_cast<int>(*(get() + index));
|
||||
}
|
||||
|
||||
template<>
|
||||
std::ostream& PVValueArray<uint8>::dumpValue(std::ostream& o, size_t index) const
|
||||
{
|
||||
return o << static_cast<unsigned int>(*(get() + index));
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
@@ -118,13 +118,16 @@ void PrinterBase::impl_print(const PVField& pv)
|
||||
}
|
||||
case structureArray: {
|
||||
const PVStructureArray &fld = *static_cast<const PVStructureArray*>(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(); i<nfld; i++)
|
||||
todo.push_back(vals[i].get());
|
||||
for(PVStructureArray::const_svector::const_iterator it=vals.begin();
|
||||
it!=vals.end(); ++it)
|
||||
{
|
||||
todo.push_back(it->get());
|
||||
}
|
||||
|
||||
todo.push_back(marker);
|
||||
break;
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user