This is Unofficial EPICS BASE Doxygen Site
epics::nt::NTNDArrayAttribute Class Reference

Convenience Class for NTNDArrayAttribute. More...

#include "ntndarrayAttribute.h"

Public Member Functions

 POINTER_DEFINITIONS (NTNDArrayAttribute)
 
bool isValid ()
 
 ~NTNDArrayAttribute ()
 
bool attachTimeStamp (epics::pvData::PVTimeStamp &pvTimeStamp) const
 
bool attachAlarm (epics::pvData::PVAlarm &pvAlarm) const
 
epics::pvData::PVStructurePtr getPVStructure () const
 
epics::pvData::PVStringPtr getDescriptor () const
 
epics::pvData::PVStructurePtr getTimeStamp () const
 
epics::pvData::PVStructurePtr getAlarm () const
 
epics::pvData::PVStringPtr getName () const
 
epics::pvData::PVUnionPtr getValue () const
 
epics::pvData::PVStringArrayPtr getTags () const
 
epics::pvData::PVIntPtr getSourceType () const
 
epics::pvData::PVStringPtr getSource () const
 

Static Public Member Functions

static shared_pointer wrap (epics::pvData::PVStructurePtr const &pvStructure)
 
static shared_pointer wrapUnsafe (epics::pvData::PVStructurePtr const &pvStructure)
 
static bool is_a (epics::pvData::StructureConstPtr const &structure)
 
static bool is_a (epics::pvData::PVStructurePtr const &pvStructure)
 
static bool isCompatible (epics::pvData::StructureConstPtr const &structure)
 
static bool isCompatible (epics::pvData::PVStructurePtr const &pvStructure)
 
static NTNDArrayAttributeBuilderPtr createBuilder ()
 

Static Public Attributes

static const std::string URI
 

Friends

class detail::NTNDArrayAttributeBuilder
 
class NTNDArray
 

Detailed Description

Convenience Class for NTNDArrayAttribute.

Author
dgh

Definition at line 125 of file ntndarrayAttribute.h.

Constructor & Destructor Documentation

epics::nt::NTNDArrayAttribute::~NTNDArrayAttribute ( )
inline

Destructor.

Definition at line 232 of file ntndarrayAttribute.h.

232 {}

Member Function Documentation

bool epics::nt::NTNDArrayAttribute::attachAlarm ( epics::pvData::PVAlarm pvAlarm) const

Attaches a PVAlarm to the wrapped PVStructure. Does nothing if no alarm field.

Parameters
pvAlarmthe PVAlarm that will be attached.
Returns
true if the operation was successfull (i.e. this instance has an alarm field), otherwise false.

Definition at line 184 of file ntndarrayAttribute.cpp.

185 {
186  PVStructurePtr al = getAlarm();
187  if (al)
188  return pvAlarm.attach(al);
189  else
190  return false;
191 }
bool attach(PVFieldPtr const &pvField)
Definition: pvAlarm.cpp:26
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Definition: pvData.h:87
epics::pvData::PVStructurePtr getAlarm() const
bool epics::nt::NTNDArrayAttribute::attachTimeStamp ( epics::pvData::PVTimeStamp pvTimeStamp) const

Attaches a PVTimeStamp to the wrapped PVStructure. Does nothing if no timeStamp field.

Parameters
pvTimeStampthe PVTimeStamp that will be attached.
Returns
true if the operation was successfull (i.e. this instance has a timeStamp field), otherwise false.

Definition at line 175 of file ntndarrayAttribute.cpp.

176 {
178  if (ts)
179  return pvTimeStamp.attach(ts);
180  else
181  return false;
182 }
epics::pvData::PVStructurePtr getTimeStamp() const
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Definition: pvData.h:87
bool attach(PVFieldPtr const &pvField)
Definition: pvTimeStamp.cpp:26
NTNDArrayAttributeBuilderPtr epics::nt::NTNDArrayAttribute::createBuilder ( )
static

Creates an NTNDArrayAttribute builder instance.

Returns
builder instance.

Definition at line 170 of file ntndarrayAttribute.cpp.

171 {
172  return NTNDArrayAttributeBuilderPtr(new detail::NTNDArrayAttributeBuilder());
173 }
std::tr1::shared_ptr< detail::NTNDArrayAttributeBuilder > NTNDArrayAttributeBuilderPtr
PVStructurePtr epics::nt::NTNDArrayAttribute::getAlarm ( ) const

Returns the alarm field.

Returns
the alarm field or null if no alarm field.

Definition at line 208 of file ntndarrayAttribute.cpp.

209 {
210  return pvNTNDArrayAttribute->getSubField<PVStructure>("alarm");
211 }
Data interface for a structure,.
Definition: pvData.h:712
PVStringPtr epics::nt::NTNDArrayAttribute::getDescriptor ( ) const

Returns the descriptor field.

Returns
the descriptor field.

Definition at line 198 of file ntndarrayAttribute.cpp.

199 {
200  return pvNTNDArrayAttribute->getSubField<PVString>("descriptor");
201 }
PVString is special case, since it implements SerializableArray.
Definition: pvData.h:521
PVStringPtr epics::nt::NTNDArrayAttribute::getName ( ) const

Returns the name field.

Returns
the name field.

Definition at line 214 of file ntndarrayAttribute.cpp.

215 {
216  return pvNTNDArrayAttribute->getSubField<PVString>("name");
217 }
PVString is special case, since it implements SerializableArray.
Definition: pvData.h:521
PVStructurePtr epics::nt::NTNDArrayAttribute::getPVStructure ( ) const

Returns the PVStructure wrapped by this instance.

Returns
the PVStructure wrapped by this instance.

Definition at line 193 of file ntndarrayAttribute.cpp.

194 {
195  return pvNTNDArrayAttribute;
196 }
PVStringPtr epics::nt::NTNDArrayAttribute::getSource ( ) const

Returns the source field.

Returns
the source field.

Definition at line 234 of file ntndarrayAttribute.cpp.

235 {
236  return pvNTNDArrayAttribute->getSubField<PVString>("source");
237 }
PVString is special case, since it implements SerializableArray.
Definition: pvData.h:521
PVIntPtr epics::nt::NTNDArrayAttribute::getSourceType ( ) const

Returns the sourceType field.

Returns
the sourceType field.

Definition at line 229 of file ntndarrayAttribute.cpp.

230 {
231  return pvNTNDArrayAttribute->getSubField<PVInt>("sourceType");
232 }
Class that holds the data for each possible scalar type.
Definition: pvData.h:54
PVStringArrayPtr epics::nt::NTNDArrayAttribute::getTags ( ) const

Returns the tags field.

Returns
the tags field or null if no such field.

Definition at line 224 of file ntndarrayAttribute.cpp.

225 {
226  return pvNTNDArrayAttribute->getSubField<PVStringArray>("tags");
227 }
template class for all extensions of PVArray.
Definition: pvData.h:55
PVStructurePtr epics::nt::NTNDArrayAttribute::getTimeStamp ( ) const

Returns the timeStamp field.

Returns
the timStamp field or null if no such field.

Definition at line 203 of file ntndarrayAttribute.cpp.

204 {
205  return pvNTNDArrayAttribute->getSubField<PVStructure>("timeStamp");
206 }
Data interface for a structure,.
Definition: pvData.h:712
PVUnionPtr epics::nt::NTNDArrayAttribute::getValue ( ) const

Returns the value field.

Returns
the value field.

Definition at line 219 of file ntndarrayAttribute.cpp.

220 {
221  return pvValue;
222 }
bool epics::nt::NTNDArrayAttribute::is_a ( epics::pvData::StructureConstPtr const &  structure)
static

Returns whether the specified Structure reports to be a compatible NTAttribute.

Checks if the specified Structure reports compatibility with this version of NTAttribute through its type ID, including checking version numbers. The return value does not depend on whether the structure is actually compatible in terms of its introspection type.

Parameters
structurethe Structure to test
Returns
(false,true) if the specified Structure (is not, is) a compatible NTAttribute

Definition at line 127 of file ntndarrayAttribute.cpp.

128 {
129  return NTUtils::is_a(structure->getID(), URI);
130 }
static const std::string URI
static bool is_a(const std::string &u1, const std::string &u2)
Definition: ntutils.cpp:14
bool epics::nt::NTNDArrayAttribute::is_a ( epics::pvData::PVStructurePtr const &  pvStructure)
static

Returns whether the specified PVStructure reports to be a compatible NTAttribute.

Checks if the specified PVStructure reports compatibility with this version of NTAttribute through its type ID, including checking version numbers. The return value does not depend on whether the structure is actually compatible in terms of its introspection type.

Parameters
pvStructurethe PVStructure to test
Returns
(false,true) if the specified PVStructure (is not, is) a compatible NTAttribute

Definition at line 132 of file ntndarrayAttribute.cpp.

133 {
134  return is_a(pvStructure->getStructure());
135 }
static bool is_a(epics::pvData::StructureConstPtr const &structure)
bool epics::nt::NTNDArrayAttribute::isCompatible ( epics::pvData::StructureConstPtr const &  structure)
static

Returns whether the specified Structure is compatible with NTAttribute extended as required by NTNDArray.

Checks if the specified Structure is compatible with this version of NTAttribute extended as required by this version of NTNDArray through the introspection interface.

Parameters
structurethe Structure to test
Returns
(false,true) if the specified Structure (is not, is) a compatible NTAttribute

Definition at line 149 of file ntndarrayAttribute.cpp.

150 {
151  if (!structure)
152  return false;
153 
154  Result result(structure);
155  return isAttribute(result.is<Structure>()).valid();
156 }
pvac::PutEvent result
Definition: clientSync.cpp:117
This class implements introspection object for a structure.
Definition: pvIntrospect.h:697
bool valid(void) const
Definition: validator.h:77
bool epics::nt::NTNDArrayAttribute::isCompatible ( epics::pvData::PVStructurePtr const &  pvStructure)
static

Returns whether the specified PVStructure is compatible with NTAttribute extended as required by NTNDArray.

Checks if the specified PVStructure is compatible with this version of NTAttribute extended as required by this version of NTNDArray through the introspection interface.

Parameters
pvStructurethe PVStructure to test
Returns
(false,true) if the specified PVStructure (is not, is) a compatible NTAttribute

Definition at line 158 of file ntndarrayAttribute.cpp.

159 {
160  if(!pvStructure) return false;
161 
162  return isCompatible(pvStructure->getStructure());
163 }
static bool isCompatible(epics::pvData::StructureConstPtr const &structure)
bool epics::nt::NTNDArrayAttribute::isValid ( )

Returns whether the wrapped PVStructure is valid with respect to this version of NTAttribute extended as per this version of NTNDArray.

Unlike isCompatible(), isValid() may perform checks on the value data as well as the introspection data.

Returns
(false,true) if the wrapped PVStructure (is not, is) a valid NTNDArrayAttribute

Definition at line 165 of file ntndarrayAttribute.cpp.

166 {
167  return true;
168 }
epics::nt::NTNDArrayAttribute::POINTER_DEFINITIONS ( NTNDArrayAttribute  )
NTNDArrayAttribute::shared_pointer epics::nt::NTNDArrayAttribute::wrap ( epics::pvData::PVStructurePtr const &  pvStructure)
static

Creates an NTNDArrayAttribute wrapping the specified PVStructure if the latter is compatible.

Checks the supplied PVStructure is compatible with NTAttribute extended as required by NTNDArray and if so returns an NTNDArrayAttribute which wraps it. This method will return null if the structure is is not compatible or is null.

Parameters
pvStructurethe PVStructure to be wrapped
Returns
NTAttribute instance wrapping pvStructure on success, null otherwise

Definition at line 116 of file ntndarrayAttribute.cpp.

117 {
118  if(!isCompatible(pvStructure)) return shared_pointer();
119  return wrapUnsafe(pvStructure);
120 }
static shared_pointer wrapUnsafe(epics::pvData::PVStructurePtr const &pvStructure)
static bool isCompatible(epics::pvData::StructureConstPtr const &structure)
NTNDArrayAttribute::shared_pointer epics::nt::NTNDArrayAttribute::wrapUnsafe ( epics::pvData::PVStructurePtr const &  pvStructure)
static

Creates an NTNDArrayAttribute wrapping the specified PVStructure, regardless of the latter's compatibility.

No checks are made as to whether the specified PVStructure is compatible with NTAttribute extended as required by NTNDArray or is non-null.

Parameters
pvStructurethe PVStructure to be wrapped
Returns
NTAttribute instance wrapping pvStructure

Definition at line 122 of file ntndarrayAttribute.cpp.

123 {
124  return shared_pointer(new NTNDArrayAttribute(pvStructure));
125 }

Friends And Related Function Documentation

friend class detail::NTNDArrayAttributeBuilder
friend

Definition at line 311 of file ntndarrayAttribute.h.

friend class NTNDArray
friend

Definition at line 312 of file ntndarrayAttribute.h.

Member Data Documentation

const std::string epics::nt::NTNDArrayAttribute::URI
static

Definition at line 130 of file ntndarrayAttribute.h.


The documentation for this class was generated from the following files: