Class Index Cross Index Namespace Index

Class FrameCPP::Version_3_4_5::DaqReader

Data Acquisition Reader
Contained in: FrameCPP::Version_3_4_5
Derived from: FrameCPP::Version_3_4_5::FrameReaderBase
Derived by: none

#include "../../../../../lib/framecpp/src/Version3_4_5/daqreader.hh"


public function member index:

inline DaqReader(std::istream& in, bool autoReset = false); Constructor
virtual ~DaqReader();
inline INT_4U adcDataVectorPtr(int offset); Given the offset find the ADC data vector ptr.
DaqFrame* readFrame(); Read a reference DaqFrame and build an update map along the way.
ObjectHeader readNextObjectHeader(); Overrides object header reader in the superclass.
 

Description:

Read the DaqFrame. readFrame() reads the frame fully and creates the structure map in it. If the frame file happen to have more than one frame in it, then the second and all subsequent frames have the same structure, which is different from the first frame's structure.


Function Member Descriptions:


FrameCPP::Version_3_4_5::DaqReader::DaqReader - Constructor


inline DaqReader(std::istream& in, bool autoReset = false);

Exceptions:
ExceptionDescription
read_failure
read_failure



FrameCPP::Version_3_4_5::DaqReader::~DaqReader


virtual ~DaqReader();
Destructor

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::DaqReader::adcDataVectorPtr - Given the offset find the ADC data vector ptr.


inline INT_4U adcDataVectorPtr(int offset);



FrameCPP::Version_3_4_5::DaqReader::readFrame - Read a reference DaqFrame and build an update map along the way.


DaqFrame* readFrame();

Return value:
Frame*

Exceptions:
ExceptionDescription
bad_allocMemory allocation failed.
read_failureRead failure.



FrameCPP::Version_3_4_5::DaqReader::readNextObjectHeader - Overrides object header reader in the superclass.


ObjectHeader readNextObjectHeader();

Exceptions:
ExceptionDescription
read_failure



Variable Member Descriptions:


FrameCPP::Version_3_4_5::DaqReader::classInstanceMultimap -

std::multimap<INT_2U, INT_2U> classInstanceMultimap;
Multimap is constructed to allow a lookup of all the instances of a particular class. The mapping works like this: classId -> instanceId. Now, if you need to find all the instance of, say, ADC class, you go and iterate over IMI for ID_ADCDATA, then for every instance Id found yo can get the offset from the instanceOffsetMap, using OMI.


FrameCPP::Version_3_4_5::DaqReader::instanceOffsetMap -

std::map<INT_4U, adc_map_info_struct> instanceOffsetMap;
Mapping works like this: (classId << 16 | instanceId) -> offset. classId identifies a type of structure, instanceId is ++ for every newly output structure of class classId. `offset' is a number of bytes to the start of the structure. (classId, instanceID) pairs are found in the frame image and are specified in the documentation as PTR_STRUCT. The pair serves as a pointer. Map allows a quick lookup of the offset to the start of a structure knowing the instance and class IDs.