NTScalr value is cached
This commit is contained in:
@@ -206,11 +206,11 @@ PVStructurePtr NTScalar::getControl() const
|
||||
|
||||
PVFieldPtr NTScalar::getValue() const
|
||||
{
|
||||
return pvNTScalar->getSubField("value");
|
||||
return pvValue;
|
||||
}
|
||||
|
||||
NTScalar::NTScalar(PVStructurePtr const & pvStructure) :
|
||||
pvNTScalar(pvStructure)
|
||||
pvNTScalar(pvStructure), pvValue(pvNTScalar->getSubField("value"))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@@ -229,16 +229,13 @@ public:
|
||||
template<typename PVT>
|
||||
std::tr1::shared_ptr<PVT> getValue() const
|
||||
{
|
||||
epics::pvData::PVFieldPtr pvField = getValue();
|
||||
if (pvField.get())
|
||||
return std::tr1::dynamic_pointer_cast<PVT>(pvField);
|
||||
else
|
||||
return std::tr1::shared_ptr<PVT>();
|
||||
return std::tr1::dynamic_pointer_cast<PVT>(pvValue);
|
||||
}
|
||||
|
||||
private:
|
||||
NTScalar(epics::pvData::PVStructurePtr const & pvStructure);
|
||||
epics::pvData::PVStructurePtr pvNTScalar;
|
||||
epics::pvData::PVFieldPtr pvValue;
|
||||
friend class detail::NTScalarBuilder;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user