This is Unofficial EPICS BASE Doxygen Site
ntaggregate.h
Go to the documentation of this file.
1 /* ntaggregate.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 NTAGGREGATE_H
7 #define NTAGGREGATE_H
8 
9 #ifdef epicsExportSharedSymbols
10 # define ntaggregateEpicsExportSharedSymbols
11 # undef epicsExportSharedSymbols
12 #endif
13 
14 #ifdef ntaggregateEpicsExportSharedSymbols
15 # define epicsExportSharedSymbols
16 # undef ntaggregateEpicsExportSharedSymbols
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<NTAggregate> NTAggregatePtr;
27 
28 namespace detail {
29 
38  public std::tr1::enable_shared_from_this<NTAggregateBuilder>
39  {
40  public:
42 
47  shared_pointer addDispersion();
48 
53  shared_pointer addFirst();
54 
59  shared_pointer addFirstTimeStamp();
60 
65  shared_pointer addLast();
66 
71  shared_pointer addLastTimeStamp();
72 
77  shared_pointer addMax();
78 
83  shared_pointer addMin();
84 
89  shared_pointer addDescriptor();
90 
95  shared_pointer addAlarm();
96 
101  shared_pointer addTimeStamp();
102 
108  epics::pvData::StructureConstPtr createStructure();
109 
115  epics::pvData::PVStructurePtr createPVStructure();
116 
122  NTAggregatePtr create();
123 
130  shared_pointer add(std::string const & name, epics::pvData::FieldConstPtr const & field);
131 
132  private:
134 
135  void reset();
136 
137  bool dispersion;
138  bool first;
139  bool firstTimeStamp;
140  bool last;
141  bool lastTimeStamp;
142  bool max;
143  bool min;
144 
145  bool descriptor;
146  bool alarm;
147  bool timeStamp;
148 
149  // NOTE: this preserves order, however it does not handle duplicates
150  epics::pvData::StringArray extraFieldNames;
152 
153  friend class ::epics::nt::NTAggregate;
154  };
155 
156 }
157 
158 typedef std::tr1::shared_ptr<detail::NTAggregateBuilder> NTAggregateBuilderPtr;
159 
160 
167 {
168 public:
170 
171  static const std::string URI;
172 
184  static shared_pointer wrap(epics::pvData::PVStructurePtr const & pvStructure);
185 
195  static shared_pointer wrapUnsafe(epics::pvData::PVStructurePtr const & pvStructure);
196 
208  static bool is_a(epics::pvData::StructureConstPtr const & structure);
209 
221  static bool is_a(epics::pvData::PVStructurePtr const & pvStructure);
222 
232  static bool isCompatible(
234 
244  static bool isCompatible(
245  epics::pvData::PVStructurePtr const &pvStructure);
246 
256  bool isValid();
257 
262  static NTAggregateBuilderPtr createBuilder();
263 
268 
275  bool attachTimeStamp(epics::pvData::PVTimeStamp &pvTimeStamp) const;
276 
283  bool attachAlarm(epics::pvData::PVAlarm &pvAlarm) const;
284 
289  epics::pvData::PVStructurePtr getPVStructure() const;
290 
295  epics::pvData::PVStringPtr getDescriptor() const;
296 
301  epics::pvData::PVStructurePtr getTimeStamp() const;
302 
307  epics::pvData::PVStructurePtr getAlarm() const;
308 
313  epics::pvData::PVDoublePtr getValue() const;
314 
319  epics::pvData::PVLongPtr getN() const;
320 
325  epics::pvData::PVDoublePtr getDispersion() const;
326 
331  epics::pvData::PVDoublePtr getFirst() const;
332 
337  epics::pvData::PVStructurePtr getFirstTimeStamp() const;
338 
343  epics::pvData::PVDoublePtr getLast() const;
344 
349  epics::pvData::PVStructurePtr getLastTimeStamp() const;
350 
355  epics::pvData::PVDoublePtr getMax() const;
356 
361  epics::pvData::PVDoublePtr getMin() const;
362 
363 private:
364  NTAggregate(epics::pvData::PVStructurePtr const & pvStructure);
365  epics::pvData::PVStructurePtr pvNTAggregate;
367 
369 };
370 
371 }}
372 #endif /* NTAGGREGATE_H */
static const std::string URI
Definition: ntaggregate.h:171
#define max(x, y)
Definition: flexdef.h:81
#define min(x, y)
Definition: flexdef.h:78
TODO only here because of the Lockable.
Definition: ntaggregate.cpp:16
std::tr1::shared_ptr< const Structure > StructureConstPtr
Definition: pvIntrospect.h:162
std::tr1::shared_ptr< NTAggregate > NTAggregatePtr
Definition: ntaggregate.h:25
Mark external symbols and entry points for shared libraries.
Convenience Class for NTAggregate.
Definition: ntaggregate.h:166
std::tr1::shared_ptr< PVLong > PVLongPtr
Definition: pvData.h:508
std::tr1::shared_ptr< detail::NTAggregateBuilder > NTAggregateBuilderPtr
Definition: ntaggregate.h:158
#define POINTER_DEFINITIONS(clazz)
Definition: sharedPtr.h:198
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
Interface for in-line creating of NTAggregate.
Definition: ntaggregate.h:37
std::tr1::shared_ptr< PVDouble > PVDoublePtr
Definition: pvData.h:514