EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
RawDataReader.h
1 // -*- c++ -*-
2 
3 #ifndef __RAW_DATA_READER_H__
4 #define __RAW_DATA_READER_H__
5 
6 // tools
7 #include "tools/ToolsConfig.h"
8 #include "tools/AutoPtr.h"
9 
10 // storage
11 #include "storage/DataReader.h"
12 #include "storage/CtrlInfo.h"
13 
16 
22 class RawDataReader : public DataReader
23 {
24 public:
25 
27  RawDataReader(Index &index);
28 
30  virtual ~RawDataReader();
31 
33  virtual const RawValue::Data *find(const stdString &channel_name,
34  const epicsTime *start);
35 
37  virtual const std::string& getName() const;
38 
40  virtual const RawValue::Data *next();
41 
43  virtual const RawValue::Data *get() const;
44 
46  virtual DbrType getType() const;
47 
49  virtual DbrCount getCount() const;
50 
52  virtual const CtrlInfo& getInfo() const;
53 
55  virtual bool changedType();
56 
58  virtual bool changedInfo();
59 
60 public:
61 
63  struct PrvData {
64 
65  void init();
66 
69 
72 
74  std::string channel_name;
75 
76  // Meta-info for current sample
77 
81  bool type_changed;
83  double period;
84 
87 
88  };
89 
90 protected:
91 
92  bool findDataBlock(const std::string& channel_name,
93  const epicsTime* start);
94 
95 protected:
96 
97  // Index
98  Index& index;
99 
100  PrvData prvData;
101 
102  DataReader* dataReader;
103 
104 };
105 
107 
108 #endif
unsigned short DbrType
DbrType is used to hold dbr_time_xxx types.
Definition: RawValue.h:24
bool type_changed
flag for type changed
Definition: RawDataReader.h:81
virtual const std::string & getName() const
Name of the channel, i.e. the one passed to find()
CtrlInfo ctrl_info
ctrl info
Definition: RawDataReader.h:80
Meta-information for values: Units, limits, etc .
Definition: CtrlInfo.h:75
bool ctrl_info_changed
flag for ctrl info changed
Definition: RawDataReader.h:82
Reads data from storage.
Definition: DataReader.h:23
virtual const CtrlInfo & getInfo() const
The meta information for the channel.
RawValueAutoPtr data
Current sample.
Definition: RawDataReader.h:86
double period
period
Definition: RawDataReader.h:83
An implementation of the DataReader for raw data.
Definition: RawDataReader.h:22
virtual DbrCount getCount() const
array size
virtual const RawValue::Data * next()
Obtain the next value.
DbrCount dbr_count
dbr count
Definition: RawDataReader.h:79
AutoPtr< Index::Result > index_result
Channel found in index.
Definition: RawDataReader.h:68
unsigned short DbrCount
DbrCount is used to hold the array size of CA channels.
Definition: RawValue.h:27
std::string channel_name
Name of channel from last find() call.
Definition: RawDataReader.h:74
AutoPtr< RTree::Datablock > datablock
Current data block info for that channel.
Definition: RawDataReader.h:71
DbrType dbr_type
dbr type
Definition: RawDataReader.h:78
virtual const RawValue::Data * find(const stdString &channel_name, const epicsTime *start)
Locate data.
Private Data of RawDataReader.
Definition: RawDataReader.h:63
virtual ~RawDataReader()
Destructor.
RawDataReader(Index &index)
Constructor.
virtual bool changedInfo()
next() updates this if ctrl_info changed.
Base interface for the archiver&#39;s indices.
Definition: Index.h:16
virtual bool changedType()
next() updates this if dbr_type/count changed.
virtual DbrType getType() const
The dbr_time_xxx type.
dbr_time_double Data
Type for accessing the raw data and its common fields.
Definition: RawValue.h:55
AutoPtr for RawValue.
Definition: RawValue.h:201