diff --git a/src/nt/nttable.cpp b/src/nt/nttable.cpp index 6dc9006..abede47 100644 --- a/src/nt/nttable.cpp +++ b/src/nt/nttable.cpp @@ -203,6 +203,11 @@ PVStringArrayPtr NTTable::getLabels() const return pvNTTable->getSubField("labels"); } +StringArray const & NTTable::getColumnNames() const +{ + return pvNTTable->getStructure()->getFieldNames(); +} + PVFieldPtr NTTable::getColumn(std::string const & columnName) const { return pvNTTable->getSubField("value." + columnName); diff --git a/src/nt/nttable.h b/src/nt/nttable.h index 20ede95..683ec35 100644 --- a/src/nt/nttable.h +++ b/src/nt/nttable.h @@ -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.