normativeTypesCPP 6.0.2
ntmatrix.h
Go to the documentation of this file.
1/* ntmatrix.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 NTMATRIX_H
7#define NTMATRIX_H
8
9#ifdef epicsExportSharedSymbols
10# define ntmatrixEpicsExportSharedSymbols
11# undef epicsExportSharedSymbols
12#endif
13
14#include <pv/pvDisplay.h>
15
16#ifdef ntmatrixEpicsExportSharedSymbols
17# define epicsExportSharedSymbols
18# undef ntmatrixEpicsExportSharedSymbols
19#endif
20
21#include <pv/ntfield.h>
22
23#include <shareLib.h>
24
25
26namespace epics { namespace nt {
27
28class NTMatrix;
29typedef std::tr1::shared_ptr<NTMatrix> NTMatrixPtr;
30
31namespace detail {
32
40 class epicsShareClass NTMatrixBuilder :
41 public std::tr1::enable_shared_from_this<NTMatrixBuilder>
42 {
43 public:
45
50 shared_pointer addDim();
51
56 shared_pointer addDescriptor();
57
62 shared_pointer addAlarm();
63
68 shared_pointer addTimeStamp();
69
74 shared_pointer addDisplay();
75
81 epics::pvData::StructureConstPtr createStructure();
82
88 epics::pvData::PVStructurePtr createPVStructure();
89
95 NTMatrixPtr create();
96
103 shared_pointer add(std::string const & name, epics::pvData::FieldConstPtr const & field);
104
105 private:
107
108 void reset();
109
110 bool dim;
111 bool descriptor;
112 bool alarm;
113 bool timeStamp;
114 bool display;
115
116 // NOTE: this preserves order, however it does not handle duplicates
117 epics::pvData::StringArray extraFieldNames;
118 epics::pvData::FieldConstPtrArray extraFields;
119
120 friend class ::epics::nt::NTMatrix;
121 };
122
123}
124
125typedef std::tr1::shared_ptr<detail::NTMatrixBuilder> NTMatrixBuilderPtr;
126
127
128
134class epicsShareClass NTMatrix
135{
136public:
138
139 static const std::string URI;
140
152 static shared_pointer wrap(epics::pvData::PVStructurePtr const & pvStructure);
153
163 static shared_pointer wrapUnsafe(epics::pvData::PVStructurePtr const & pvStructure);
164
176 static bool is_a(epics::pvData::StructureConstPtr const & structure);
177
189 static bool is_a(epics::pvData::PVStructurePtr const & pvStructure);
190
200 static bool isCompatible(
201 epics::pvData::StructureConstPtr const &structure);
202
212 static bool isCompatible(
213 epics::pvData::PVStructurePtr const &pvStructure);
214
224 bool isValid();
225
230 static NTMatrixBuilderPtr createBuilder();
231
236
243 bool attachTimeStamp(epics::pvData::PVTimeStamp &pvTimeStamp) const;
244
251 bool attachAlarm(epics::pvData::PVAlarm &pvAlarm) const;
252
259 bool attachDisplay(epics::pvData::PVDisplay &pvDisplay) const;
260
265 epics::pvData::PVStructurePtr getPVStructure() const;
266
271 epics::pvData::PVStringPtr getDescriptor() const;
272
277 epics::pvData::PVStructurePtr getTimeStamp() const;
278
283 epics::pvData::PVStructurePtr getAlarm() const;
284
289 epics::pvData::PVStructurePtr getDisplay() const;
290
295 epics::pvData::PVDoubleArrayPtr getValue() const;
296
301 epics::pvData::PVIntArrayPtr getDim() const;
302
303private:
304 NTMatrix(epics::pvData::PVStructurePtr const & pvStructure);
305 epics::pvData::PVStructurePtr pvNTMatrix;
306 epics::pvData::PVDoubleArrayPtr pvValue;
307
309};
310
311}}
312#endif /* NTMATRIX_H */
Convenience Class for NTMatrix.
Definition ntmatrix.h:135
POINTER_DEFINITIONS(NTMatrix)
static bool isCompatible(epics::pvData::StructureConstPtr const &structure)
static bool is_a(epics::pvData::StructureConstPtr const &structure)
static const std::string URI
Definition ntmatrix.h:139
static bool is_a(epics::pvData::PVStructurePtr const &pvStructure)
static bool isCompatible(epics::pvData::PVStructurePtr const &pvStructure)
Interface for in-line creating of NTMatrix.
Definition ntmatrix.h:42
std::tr1::shared_ptr< NTMatrix > NTMatrixPtr
Definition ntmatrix.h:29
std::tr1::shared_ptr< detail::NTMatrixBuilder > NTMatrixBuilderPtr
Definition ntmatrix.h:125