Add getName() and getTags() functions to NTAttribute

This commit is contained in:
Dave Hickin
2015-08-20 16:16:34 +01:00
parent dc93316856
commit 5ddcc70993
2 changed files with 23 additions and 0 deletions

View File

@@ -188,11 +188,22 @@ PVStructurePtr NTAttribute::getAlarm() const
return pvNTAttribute->getSubField<PVStructure>("alarm");
}
PVStringPtr NTAttribute::getName() const
{
return pvNTAttribute->getSubField<PVString>("name");
}
PVUnionPtr NTAttribute::getValue() const
{
return pvValue;
}
PVStringArrayPtr NTAttribute::getTags() const
{
return pvNTAttribute->getSubField<PVStringArray>("tags");
}
NTAttribute::NTAttribute(PVStructurePtr const & pvStructure) :
pvNTAttribute(pvStructure), pvValue(pvNTAttribute->getSubField<PVUnion>("value"))
{

View File

@@ -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;