normativeTypesCPP 6.0.2
ntndarrayAttribute.h
Go to the documentation of this file.
1/* ntndarrayAttribute.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 NTNDARRAYATTRIBUTE_H
7#define NTNDARRAYATTRIBUTE_H
8
9#ifdef epicsExportSharedSymbols
10# define ntndarrayAttributeEpicsExportSharedSymbols
11# undef epicsExportSharedSymbols
12#endif
13
14#ifdef ntndarrayAttributeEpicsExportSharedSymbols
15# define epicsExportSharedSymbols
16# undef ntndarrayAttributeEpicsExportSharedSymbols
17#endif
18
19#include <pv/ntfield.h>
20
21#include <shareLib.h>
22
23namespace epics { namespace nt {
24
25struct Result;
26class NTNDArrayAttribute;
27typedef std::tr1::shared_ptr<NTNDArrayAttribute> NTNDArrayAttributePtr;
28
29namespace detail {
30
38 class epicsShareClass NTNDArrayAttributeBuilder :
39 public std::tr1::enable_shared_from_this<NTNDArrayAttributeBuilder>
40 {
41 public:
43
48 shared_pointer addTags();
49
54 shared_pointer addDescriptor();
55
60 shared_pointer addAlarm();
61
66 shared_pointer addTimeStamp();
67
73 epics::pvData::StructureConstPtr createStructure();
74
80 epics::pvData::PVStructurePtr createPVStructure();
81
87 NTNDArrayAttributePtr create();
88
95 shared_pointer add(std::string const & name, epics::pvData::FieldConstPtr const & field);
96
97 protected://private:
99
100 void reset();
101
102 bool tags;
104 bool alarm;
106
107 // NOTE: this preserves order, however it does not handle duplicates
108 epics::pvData::StringArray extraFieldNames;
109 epics::pvData::FieldConstPtrArray extraFields;
110
111 friend class ::epics::nt::NTNDArrayAttribute;
112 };
113
114}
115
116typedef std::tr1::shared_ptr<detail::NTNDArrayAttributeBuilder> NTNDArrayAttributeBuilderPtr;
117
118
119
125class epicsShareClass NTNDArrayAttribute
126{
127public:
129
130 static const std::string URI;
131
144 static shared_pointer wrap(epics::pvData::PVStructurePtr const & pvStructure);
145
156 static shared_pointer wrapUnsafe(epics::pvData::PVStructurePtr const & pvStructure);
157
169 static bool is_a(epics::pvData::StructureConstPtr const & structure);
170
182 static bool is_a(epics::pvData::PVStructurePtr const & pvStructure);
183
195 static bool isCompatible(
196 epics::pvData::StructureConstPtr const &structure);
197
209 static bool isCompatible(
210 epics::pvData::PVStructurePtr const &pvStructure);
211
221 bool isValid();
222
227 static NTNDArrayAttributeBuilderPtr createBuilder();
228
233
240 bool attachTimeStamp(epics::pvData::PVTimeStamp &pvTimeStamp) const;
241
248 bool attachAlarm(epics::pvData::PVAlarm &pvAlarm) const;
249
254 epics::pvData::PVStructurePtr getPVStructure() const;
255
260 epics::pvData::PVStringPtr getDescriptor() const;
261
266 epics::pvData::PVStructurePtr getTimeStamp() const;
267
272 epics::pvData::PVStructurePtr getAlarm() const;
273
278 epics::pvData::PVStringPtr getName() const;
279
284 epics::pvData::PVUnionPtr getValue() const;
285
290 epics::pvData::PVStringArrayPtr getTags() const;
291
296 epics::pvData::PVIntPtr getSourceType() const;
297
302 epics::pvData::PVStringPtr getSource() const;
303
304private:
305 NTNDArrayAttribute(epics::pvData::PVStructurePtr const & pvStructure);
306 static Result& isAttribute(Result& result);
307
308 epics::pvData::PVStructurePtr pvNTNDArrayAttribute;
309 epics::pvData::PVUnionPtr pvValue;
310
312 friend class NTNDArray;
313};
314
315}}
316#endif /* NTNDARRAYATTRIBUTE_H */
Convenience Class for NTNDArrayAttribute.
static bool is_a(epics::pvData::PVStructurePtr const &pvStructure)
static const std::string URI
POINTER_DEFINITIONS(NTNDArrayAttribute)
static bool isCompatible(epics::pvData::PVStructurePtr const &pvStructure)
static bool isCompatible(epics::pvData::StructureConstPtr const &structure)
static bool is_a(epics::pvData::StructureConstPtr const &structure)
Convenience Class for NTNDArray.
Definition ntndarray.h:129
Interface for in-line creating of NTAttribute extended as required by NTNDArray.
epics::pvData::FieldConstPtrArray extraFields
POINTER_DEFINITIONS(NTNDArrayAttributeBuilder)
std::tr1::shared_ptr< NTNDArrayAttribute > NTNDArrayAttributePtr
std::tr1::shared_ptr< detail::NTNDArrayAttributeBuilder > NTNDArrayAttributeBuilderPtr
Validation methods for NT types.
Definition validator.h:23