EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
AverageReader.h
1 // -*- c++ -*-
2 
3 #ifndef __AVERAGE_READER_H__
4 #define __AVERAGE_READER_H__
5 
6 #include "storage/RawDataReader.h"
7 
10 
32 class AverageReader : public DataReader {
33 public:
34 
39  AverageReader(Index &index, double delta);
40 
42  const RawValue::Data *find(const std::string& channel_name,
43  const epicsTime* start);
44 
46  const std::string &getName() const;
47 
49  const RawValue::Data *next();
50 
52  const RawValue::Data *get() const;
53 
55  DbrType getType() const;
56 
58  DbrCount getCount() const;
59 
61  const CtrlInfo &getInfo() const;
62 
64  bool changedType();
65 
67  bool changedInfo();
68 
71  bool isRaw() const
72  { return is_raw; }
73 
76  double getMinimum() const
77  { return minimum; }
78 
81  double getMaximum() const
82  { return maximum; }
83 
84 protected:
85  RawDataReader reader;
86  double delta;
87 
88  // Current value of reader
89  const RawValue::Data *reader_data;
90 
91  // Current value of this AverageReader
92  epicsTime end_of_bin;
93  DbrType type;
94  DbrCount count;
95  CtrlInfo info;
96  bool type_changed;
97  bool ctrl_info_changed;
98  RawValueAutoPtr data;
99 
100  bool is_raw;
101  double minimum, maximum;
102 };
103 
105 
106 #endif
DbrType getType() const
Return the value type.
unsigned short DbrType
DbrType is used to hold dbr_time_xxx types.
Definition: RawValue.h:24
Meta-information for values: Units, limits, etc .
Definition: CtrlInfo.h:75
Reads data from storage.
Definition: DataReader.h:23
An implementation of the DataReader for raw data.
Definition: RawDataReader.h:22
bool isRaw() const
Definition: AverageReader.h:71
const RawValue::Data * find(const std::string &channel_name, const epicsTime *start)
Returns sample of the specified channel.
AverageReader(Index &index, double delta)
Create a reader for an index.
const CtrlInfo & getInfo() const
Returns CtrlInfo.
unsigned short DbrCount
DbrCount is used to hold the array size of CA channels.
Definition: RawValue.h:27
const RawValue::Data * next()
Returns the next sample.
double getMinimum() const
Definition: AverageReader.h:76
bool changedType()
Checks if type changed.
const std::string & getName() const
Returns the channel name.
Base interface for the archiver's indices.
Definition: Index.h:16
DbrCount getCount() const
Returns the count of the sample value.
dbr_time_double Data
Type for accessing the raw data and its common fields.
Definition: RawValue.h:55
Reads data from storage, averaging over the raw samples.
Definition: AverageReader.h:32
bool changedInfo()
Checks if CtrlInfo changed.
AutoPtr for RawValue.
Definition: RawValue.h:201
double getMaximum() const
Definition: AverageReader.h:81