EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | List of all members
DataReader Class Referenceabstract

Reads data from storage. More...

#include <DataReader.h>

Inheritance diagram for DataReader:
AverageReader PlotReader RawDataReader RawDataReaderEA3 ShallowIndexRawDataReader LinearReader

Public Member Functions

virtual const RawValue::Datafind (const stdString &channel_name, const epicsTime *start)=0
 Locate data. More...
 
virtual const stdString & getName () const =0
 Name of the channel, i.e. the one passed to find()
 
virtual const RawValue::Datanext ()=0
 Obtain the next value. More...
 
virtual const RawValue::Dataget () const =0
 Current value. More...
 
virtual DbrType getType () const =0
 The dbr_time_xxx type.
 
virtual DbrCount getCount () const =0
 array size
 
virtual const CtrlInfogetInfo () const =0
 The meta information for the channel.
 
void toString (stdString &text) const
 Convert current value to string. More...
 
virtual bool changedType ()=0
 next() updates this if dbr_type/count changed. More...
 
virtual bool changedInfo ()=0
 next() updates this if ctrl_info changed. More...
 

Detailed Description

Reads data from storage.

The data reader interfaces to the Index/DataFile and returns a stream of RawValue values.

Member Function Documentation

virtual bool DataReader::changedInfo ( )
pure virtual

next() updates this if ctrl_info changed.

Returns
Returns whether the ctrl_info changed or not AND(!) resets the flag!!

Implemented in PlotReader, AverageReader, RawDataReaderEA3, RawDataReader, and ShallowIndexRawDataReader.

virtual bool DataReader::changedType ( )
pure virtual

next() updates this if dbr_type/count changed.

Returns
Returns whether the type changed or not AND!! resets the flag!!

Implemented in PlotReader, AverageReader, RawDataReaderEA3, RawDataReader, and ShallowIndexRawDataReader.

virtual const RawValue::Data* DataReader::find ( const stdString &  channel_name,
const epicsTime *  start 
)
pure virtual

Locate data.

Positions reader on given channel and start time.

Specifically: If a value with the exact start time exists, it will be returned. Otherwise the value just before the start time is returned, so that the user can then decide if and how that value might extrapolate onto the start time.

Parameters
channel_name,:Name of the channel
start,:start time or 0 for first value
Returns
Returns pointer to first value, or 0 if the channel was found but there was no data.
Exceptions
GenericExceptionon error, including file access issues or the fact that a channel doesn't exist.

Implemented in RawDataReader, and RawDataReaderEA3.

virtual const RawValue::Data* DataReader::get ( ) const
pure virtual

Current value.

Same as the last find() or next() result. Undefined when find() or next() returned 0.

Implemented in PlotReader, AverageReader, RawDataReaderEA3, RawDataReader, and ShallowIndexRawDataReader.

virtual const RawValue::Data* DataReader::next ( )
pure virtual

Obtain the next value.

After a successful call to find() for the first value, this routine returns the following values with each call. When no more data is available, 0 is returned. Any calls to next() after either find() or next() return 0 to indicate the end of the available data will result in exceptions.

Precondition
find()
Returns
Returns next value or 0. The caller must neither mofify nor delete the data!
Exceptions
GenericExceptionon error: File access, called after reaching the end of data.

Implemented in PlotReader, AverageReader, RawDataReader, ShallowIndexRawDataReader, RawDataReaderEA3, and LinearReader.

void DataReader::toString ( stdString &  text) const

Convert current value to string.

Formatted as "<time><tab><value><tab>status" or just "<time><tab><value>" if the status is empty.

Undefined behavior if there is no current value, i.e. find() or next() returned 0.


The documentation for this class was generated from the following file: