This is Unofficial EPICS BASE Doxygen Site
ntndarray.h
Go to the documentation of this file.
1 /* ntndarray.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 NTNDARRAY_H
7 #define NTNDARRAY_H
8 
9 #include <vector>
10 #include <string>
11 
12 #ifdef epicsExportSharedSymbols
13 # define ntndarrayEpicsExportSharedSymbols
14 # undef epicsExportSharedSymbols
15 #endif
16 
17 #include <pv/pvDisplay.h>
18 #include <pv/pvControl.h>
19 
20 #ifdef ntndarrayEpicsExportSharedSymbols
21 # define epicsExportSharedSymbols
22 # undef ntndarrayEpicsExportSharedSymbols
23 #endif
24 
25 #include <pv/ntfield.h>
26 
27 #include <shareLib.h>
28 
29 namespace epics { namespace nt {
30 
31 class NTNDArray;
32 typedef std::tr1::shared_ptr<NTNDArray> NTNDArrayPtr;
33 
34 namespace detail {
35 
44  public std::tr1::enable_shared_from_this<NTNDArrayBuilder>
45  {
46  public:
48 
53  shared_pointer addDescriptor();
54 
59  shared_pointer addAlarm();
60 
65  shared_pointer addTimeStamp();
66 
71  shared_pointer addDisplay();
72 
78  epics::pvData::StructureConstPtr createStructure();
79 
85  epics::pvData::PVStructurePtr createPVStructure();
86 
92  NTNDArrayPtr create();
93 
100  shared_pointer add(std::string const & name, epics::pvData::FieldConstPtr const & field);
101 
102  private:
104 
105  void reset();
106 
107  bool descriptor;
108  bool timeStamp;
109  bool alarm;
110  bool display;
111 
112  // NOTE: this preserves order, however it does not handle duplicates
113  epics::pvData::StringArray extraFieldNames;
115 
116  friend class ::epics::nt::NTNDArray;
117  };
118 
119 }
120 
121 typedef std::tr1::shared_ptr<detail::NTNDArrayBuilder> NTNDArrayBuilderPtr;
122 
129 {
130 public:
132 
133  static const std::string URI;
134 
146  static shared_pointer wrap(epics::pvData::PVStructurePtr const & pvStructure);
147 
157  static shared_pointer wrapUnsafe(epics::pvData::PVStructurePtr const & pvStructure);
158 
170  static bool is_a(epics::pvData::StructureConstPtr const & structure);
171 
183  static bool is_a(epics::pvData::PVStructurePtr const & pvStructure);
184 
194  static bool isCompatible(
196 
205  static bool isCompatible(
206  epics::pvData::PVStructurePtr const &pvStructure);
207 
217  bool isValid();
218 
223  static NTNDArrayBuilderPtr createBuilder();
224 
229 
236  bool attachTimeStamp(epics::pvData::PVTimeStamp &pvTimeStamp) const;
237 
244  bool attachDataTimeStamp(epics::pvData::PVTimeStamp &pvTimeStamp) const;
245 
252  bool attachAlarm(epics::pvData::PVAlarm &pvAlarm) const;
253 
258  epics::pvData::PVStructurePtr getPVStructure() const;
259 
264  epics::pvData::PVUnionPtr getValue() const;
265 
270  epics::pvData::PVStructurePtr getCodec() const;
271 
276  epics::pvData::PVLongPtr getCompressedDataSize() const;
277 
282  epics::pvData::PVLongPtr getUncompressedDataSize() const;
283 
288  epics::pvData::PVStructureArrayPtr getDimension() const;
289 
294  epics::pvData::PVIntPtr getUniqueId() const;
295 
300  epics::pvData::PVStructurePtr getDataTimeStamp() const;
301 
306  epics::pvData::PVStructureArrayPtr getAttribute() const;
307 
312  epics::pvData::PVStringPtr getDescriptor() const;
313 
318  epics::pvData::PVStructurePtr getTimeStamp() const;
319 
324  epics::pvData::PVStructurePtr getAlarm() const;
325 
332  bool attachDisplay(epics::pvData::PVDisplay &pvDisplay) const;
333 
338  epics::pvData::PVStructurePtr getDisplay() const;
339 
340 private:
341  NTNDArray(epics::pvData::PVStructurePtr const & pvStructure);
342 
343  epics::pvData::int64 getExpectedUncompressedSize();
344  epics::pvData::int64 getValueSize();
345  epics::pvData::int64 getValueTypeSize();
346 
347  epics::pvData::PVStructurePtr pvNTNDArray;
348 
350 };
351 
352 }}
353 #endif /* NTNDARRAY_H */
std::tr1::shared_ptr< PVInt > PVIntPtr
Definition: pvData.h:507
std::tr1::shared_ptr< detail::NTNDArrayBuilder > NTNDArrayBuilderPtr
Definition: ntndarray.h:121
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.
std::tr1::shared_ptr< PVLong > PVLongPtr
Definition: pvData.h:508
std::tr1::shared_ptr< PVUnion > PVUnionPtr
Definition: pvData.h:107
#define POINTER_DEFINITIONS(clazz)
Definition: sharedPtr.h:198
std::tr1::shared_ptr< PVStructureArray > PVStructureArrayPtr
Definition: pvData.h:100
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
Interface for in-line creating of NTNDArray.
Definition: ntndarray.h:43
std::tr1::shared_ptr< const Field > FieldConstPtr
Definition: pvIntrospect.h:137
static const std::string URI
Definition: ntndarray.h:133
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Definition: pvData.h:87
std::tr1::shared_ptr< NTNDArray > NTNDArrayPtr
Definition: ntndarray.h:31
int64_t int64
Definition: pvType.h:87
std::tr1::shared_ptr< PVString > PVStringPtr
Definition: pvData.h:540
Convenience Class for NTNDArray.
Definition: ntndarray.h:128
std::vector< std::string > StringArray
Definition: pvType.h:110
Methods for accessing an display structure.
Definition: pvDisplay.h:39