Add getColumnNames() to NTTable

This commit is contained in:
Dave Hickin
2015-08-21 06:46:17 +01:00
parent da81f8db83
commit bc2622f70a
2 changed files with 12 additions and 0 deletions

View File

@@ -203,6 +203,11 @@ PVStringArrayPtr NTTable::getLabels() const
return pvNTTable->getSubField<PVStringArray>("labels");
}
StringArray const & NTTable::getColumnNames() const
{
return pvNTTable->getStructure()->getFieldNames();
}
PVFieldPtr NTTable::getColumn(std::string const & columnName) const
{
return pvNTTable->getSubField("value." + columnName);

View File

@@ -256,6 +256,13 @@ public:
*/
epics::pvData::PVStringArrayPtr getLabels() const;
/**
* Get the column names for the table.
* For each name, calling getColumn should return the column, which should not be null.
* @return The column names.
*/
epics::pvData::StringArray const & getColumnNames() const;
/**
* Get the PVField (column) for a field that follows the label field.
* @param columnName The name of the column.