This is Unofficial EPICS BASE Doxygen Site
ntattribute.h
Go to the documentation of this file.
1 /* ntattribute.h */
2 /*
3  * Copyright information and license terms for this software can be
4  * found in the file LICENSE that is included with the distribution
5  */
6 #ifndef NTATTRIBUTE_H
7 #define NTATTRIBUTE_H
8 
9 #ifdef epicsExportSharedSymbols
10 # define ntattributeEpicsExportSharedSymbols
11 # undef epicsExportSharedSymbols
12 #endif
13 
14 #ifdef ntattributeEpicsExportSharedSymbols
15 # define epicsExportSharedSymbols
16 # undef ntattributeEpicsExportSharedSymbols
17 #endif
18 
19 #include <pv/ntfield.h>
20 
21 #include <shareLib.h>
22 
23 namespace epics { namespace nt {
24 
26 typedef std::tr1::shared_ptr<NTAttribute> NTAttributePtr;
27 
28 namespace detail {
29 
38  public std::tr1::enable_shared_from_this<NTAttributeBuilder>
39  {
40  public:
42 
47  shared_pointer addTags();
48 
53  shared_pointer addDescriptor();
54 
59  shared_pointer addAlarm();
60 
65  shared_pointer addTimeStamp();
66 
72  epics::pvData::StructureConstPtr createStructure();
73 
79  epics::pvData::PVStructurePtr createPVStructure();
80 
86  NTAttributePtr create();
87 
94  shared_pointer add(std::string const & name, epics::pvData::FieldConstPtr const & field);
95 
96  protected://private:
98 
99  void reset();
100 
101  bool tags;
103  bool alarm;
104  bool timeStamp;
105 
106  // NOTE: this preserves order, however it does not handle duplicates
109 
110  friend class ::epics::nt::NTAttribute;
111  };
112 
113 }
114 
115 typedef std::tr1::shared_ptr<detail::NTAttributeBuilder> NTAttributeBuilderPtr;
116 
117 
118 
125 {
126 public:
128 
129  static const std::string URI;
130 
142  static shared_pointer wrap(epics::pvData::PVStructurePtr const & pvStructure);
143 
153  static shared_pointer wrapUnsafe(epics::pvData::PVStructurePtr const & pvStructure);
154 
166  static bool is_a(epics::pvData::StructureConstPtr const & structure);
167 
179  static bool is_a(epics::pvData::PVStructurePtr const & pvStructure);
180 
190  static bool isCompatible(
192 
202  static bool isCompatible(
203  epics::pvData::PVStructurePtr const &pvStructure);
204 
214  bool isValid();
215 
220  static NTAttributeBuilderPtr createBuilder();
221 
226 
233  bool attachTimeStamp(epics::pvData::PVTimeStamp &pvTimeStamp) const;
234 
241  bool attachAlarm(epics::pvData::PVAlarm &pvAlarm) const;
242 
247  epics::pvData::PVStructurePtr getPVStructure() const;
248 
253  epics::pvData::PVStringPtr getDescriptor() const;
254 
259  epics::pvData::PVStructurePtr getTimeStamp() const;
260 
265  epics::pvData::PVStructurePtr getAlarm() const;
266 
271  epics::pvData::PVStringPtr getName() const;
272 
277  epics::pvData::PVUnionPtr getValue() const;
278 
283  epics::pvData::PVStringArrayPtr getTags() const;
284 
285 private:
286  NTAttribute(epics::pvData::PVStructurePtr const & pvStructure);
287  epics::pvData::PVStructurePtr pvNTAttribute;
289 
291 };
292 
293 }}
294 #endif /* NTATTRIBUTE_H */
Interface for in-line creating of NTAttribute.
Definition: ntattribute.h:37
TODO only here because of the Lockable.
Definition: ntaggregate.cpp:16
std::tr1::shared_ptr< const Structure > StructureConstPtr
Definition: pvIntrospect.h:162
Mark external symbols and entry points for shared libraries.
epics::pvData::StringArray extraFieldNames
Definition: ntattribute.h:107
std::tr1::shared_ptr< PVStringArray > PVStringArrayPtr
Definition: pvData.h:1464
std::tr1::shared_ptr< detail::NTAttributeBuilder > NTAttributeBuilderPtr
Definition: ntattribute.h:115
std::tr1::shared_ptr< PVUnion > PVUnionPtr
Definition: pvData.h:107
#define POINTER_DEFINITIONS(clazz)
Definition: sharedPtr.h:198
static const std::string URI
Definition: ntattribute.h:129
Methods for accessing a timeStamp structure.
Definition: pvTimeStamp.h:38
#define epicsShareClass
Definition: shareLib.h:206
Methods for accessing an alarm structure.
Definition: pvAlarm.h:37
std::vector< FieldConstPtr > FieldConstPtrArray
Definition: pvIntrospect.h:146
std::tr1::shared_ptr< const Field > FieldConstPtr
Definition: pvIntrospect.h:137
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Definition: pvData.h:87
std::tr1::shared_ptr< PVString > PVStringPtr
Definition: pvData.h:540
std::vector< std::string > StringArray
Definition: pvType.h:110
Convenience Class for NTAttribute.
Definition: ntattribute.h:124
std::tr1::shared_ptr< NTAttribute > NTAttributePtr
Definition: ntattribute.h:25
epics::pvData::FieldConstPtrArray extraFields
Definition: ntattribute.h:108