More efficient implementation of NTTable
Cache the value field. Allows simpler implementation of getColumn().
This commit is contained in:
@@ -245,11 +245,11 @@ StringArray const & NTTable::getColumnNames() const
|
||||
|
||||
PVFieldPtr NTTable::getColumn(std::string const & columnName) const
|
||||
{
|
||||
return pvNTTable->getSubField("value." + columnName);
|
||||
return pvValue->getSubField(columnName);
|
||||
}
|
||||
|
||||
NTTable::NTTable(PVStructurePtr const & pvStructure) :
|
||||
pvNTTable(pvStructure)
|
||||
pvNTTable(pvStructure), pvValue(pvNTTable->getSubField<PVStructure>("value"))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@@ -288,6 +288,7 @@ public:
|
||||
private:
|
||||
NTTable(epics::pvData::PVStructurePtr const & pvStructure);
|
||||
epics::pvData::PVStructurePtr pvNTTable;
|
||||
epics::pvData::PVStructurePtr pvValue;
|
||||
friend class detail::NTTableBuilder;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user