From 5ddcc709932066eb50b2000a4e23b3b80c2dbcfe Mon Sep 17 00:00:00 2001 From: Dave Hickin Date: Thu, 20 Aug 2015 16:16:34 +0100 Subject: [PATCH] Add getName() and getTags() functions to NTAttribute --- src/nt/ntattribute.cpp | 11 +++++++++++ src/nt/ntattribute.h | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/nt/ntattribute.cpp b/src/nt/ntattribute.cpp index f9a6d81..468b9d5 100644 --- a/src/nt/ntattribute.cpp +++ b/src/nt/ntattribute.cpp @@ -188,11 +188,22 @@ PVStructurePtr NTAttribute::getAlarm() const return pvNTAttribute->getSubField("alarm"); } + +PVStringPtr NTAttribute::getName() const +{ + return pvNTAttribute->getSubField("name"); +} + PVUnionPtr NTAttribute::getValue() const { return pvValue; } +PVStringArrayPtr NTAttribute::getTags() const +{ + return pvNTAttribute->getSubField("tags"); +} + NTAttribute::NTAttribute(PVStructurePtr const & pvStructure) : pvNTAttribute(pvStructure), pvValue(pvNTAttribute->getSubField("value")) { diff --git a/src/nt/ntattribute.h b/src/nt/ntattribute.h index 8d5bab7..b090660 100644 --- a/src/nt/ntattribute.h +++ b/src/nt/ntattribute.h @@ -210,12 +210,24 @@ public: */ epics::pvData::PVStructurePtr getAlarm() const; + /** + * Get the name field. + * @return The PVString for the name. + */ + epics::pvData::PVStringPtr getName() const; + /** * Get the value field. * @return The PVUnion for the values. */ epics::pvData::PVUnionPtr getValue() const; + /** + * Get the tags field. + * @return The PVStringArray for the tags, which may be null. + */ + epics::pvData::PVStringArrayPtr getTags() const; + private: NTAttribute(epics::pvData::PVStructurePtr const & pvStructure); epics::pvData::PVStructurePtr pvNTAttribute;