#include <framefast.hh>
Public Member Functions | |
| framereader () | |
| virtual | ~framereader () |
| bool | loadFile (const char *filename, bool map=true) |
| bool | loadFrame (const void *fdata, int len, bool ownit=false) |
| bool | loadFrame (basic_frame_storage *frame) |
| bool | loadFrame (frame_storage_ptr &frame) |
| bool | releaseFrame (frame_storage_ptr &frame) |
| void | unload () |
| bool | isFrame () |
| bool | getDict (dict_t &dict) |
| bool | getFrameHeader (frameheader_t &h, int fnum=0) |
| bool | getDetectorInfo (detector_t &det, int fnum=0, int dnum=0) |
| int | getDetectorInfoNum () |
| bool | getHistoryInfo (hist_t &hist, int fnum=0) |
| bool | getRawDataInfo (rawdata_t &raw, int fnum=0) |
| bool | getData (data_t &dat, int_8u_t pos, datatype_t dtype, frvect_t::datacopy cpy=frvect_t::fv_copy) |
| bool | getData (data_t &dat, const char *channel, int nframe=0, frvect_t::datacopy cpy=frvect_t::fv_copy) |
| int | copy (const char *chnname, real_4_t *x, int max) |
| int | copy (const char *chnname, real_8_t *x, int max) |
| int | copy (const char *chnname, int_2s_t *x, int max) |
| int | copy (const char *chnname, int_4s_t *x, int max) |
| std::ostream & | writeTOC (std::ostream &os) |
| std::ostream & | writeFileHeader (std::ostream &os) |
| int | length () const |
| const char * | frame () const |
| const char * | frameend () const |
| const char * | fname () const |
| std::string | guessFilename () |
| int | nframe () |
| Time | starttime (int framenum=0) |
| Interval | duration (int framenum=0) |
| Time | nexttime () |
| const toc_t * | getTOC () |
| void | setScanTOC (bool set=true) |
Protected Types | |
| enum | toc_status_t { kTOCUndefined = 0, kTOCNo, kTOCYes } |
| TOC status. More... | |
| enum | header_status_t { kFileHeaderUndefined = 0, kFileHeaderInvalid, kFileHeaderValid } |
| file header status More... | |
Protected Member Functions | |
| bool | newTOC () |
| new toc structure | |
| bool | freeTOC () |
| free TOC structure | |
| bool | readTOC () |
| read TOC structure | |
| bool | scanTOC () |
| regenerate TOC from raw frame file | |
| bool | newFileHeader () |
| new header structure | |
| bool | freeFileHeader () |
| free header | |
| bool | readFileHeader () |
| read header | |
| int | lookup (const char *chnname, int_8u_t *&ofs, datatype_t &dtype) |
| look up channel in TOC | |
Protected Attributes | |
| bool | fDebug |
| Debug flag. | |
| frame_storage_ptr | fFrame |
| Frame data. | |
| toc_t * | fTOC |
| Pointer to toc. | |
| toc_status_t | fHasTOC |
| Frame TOC status. | |
| bool | fForceScanToc |
| Force to rescan TOC. | |
| fileheader_t * | fFileHeader |
| Pointer to header. | |
| header_status_t | fHasFileHeader |
| Frame header status. | |
| frameheader_t * | fFrameHeader |
| Pointer to frameheader. | |
| bool | fSwap |
| Need to swap? (only valid after header was read successful). | |
enum framefast::framereader::toc_status_t [protected] |
enum framefast::framereader::header_status_t [protected] |
| framefast::framereader::framereader | ( | ) |
Constructs a fast frame reader. brief Default constructor.
| virtual framefast::framereader::~framereader | ( | ) | [virtual] |
Destructs a fast frame reader. brief Destructor.
| bool framefast::framereader::loadFile | ( | const char * | filename, | |
| bool | map = true | |||
| ) |
Loads a file into the fast frame reader (the file is not actually read, just mapped). brief Load a file.
| filename | Name of file | |
| map | Map the file into memory rather than read it |
| bool framefast::framereader::loadFrame | ( | const void * | fdata, | |
| int | len, | |||
| bool | ownit = false | |||
| ) |
Loads a memory object into the fast frame reader. brief Load a memory object.
| fdata | Pointer to frame data | |
| len | Length of data array (in bytes) | |
| ownit | The framereader will own the data |
| bool framefast::framereader::loadFrame | ( | basic_frame_storage * | frame | ) | [inline] |
Loads a frame into the fast frame reader. The frame storage object is adopted. brief Load a frame object.
| frame | frame object |
| bool framefast::framereader::loadFrame | ( | frame_storage_ptr & | frame | ) | [inline] |
Loads a frame into the fast frame reader. The frame storage object is adopted. brief Load a frame object.
| frame | frame object pointer |
| bool framefast::framereader::releaseFrame | ( | frame_storage_ptr & | frame | ) |
Releases a previously loaded frame form the fast frame reader. A frame storage pointer object is returned. brief Release a frame object.
| frame | frame object pointer (return) |
| void framefast::framereader::unload | ( | ) |
Unloads a frame form the fast frame reader. brief Unload a frame.
| bool framefast::framereader::isFrame | ( | ) |
Reads the frame header and checks for frame format. brief Checks frame.
| bool framefast::framereader::getDict | ( | dict_t & | dict | ) |
Get the dictionary. brief Get dictionary.
| dict | Dictionary (return) |
| bool framefast::framereader::getFrameHeader | ( | frameheader_t & | h, | |
| int | fnum = 0 | |||
| ) |
Get a frame header. brief Get a frame header.
| h | Frame header | |
| fnum | Frame number within file |
| bool framefast::framereader::getDetectorInfo | ( | detector_t & | det, | |
| int | fnum = 0, |
|||
| int | dnum = 0 | |||
| ) |
Get detector information. brief Get detector information.
| det | Detector information | |
| fnum | Frame number within file | |
| dnum | Detector number |
| int framefast::framereader::getDetectorInfoNum | ( | ) |
Get number of detector information. brief Get number of detectors.
| bool framefast::framereader::getHistoryInfo | ( | hist_t & | hist, | |
| int | fnum = 0 | |||
| ) |
Get history information. brief Get history information.
| hist | History information | |
| fnum | Frame number within file |
| bool framefast::framereader::getRawDataInfo | ( | rawdata_t & | raw, | |
| int | fnum = 0 | |||
| ) |
Get raw data information. brief Get raw data information.
| raw | Raw data information | |
| fnum | Frame number within file |
| bool framefast::framereader::getData | ( | data_t & | dat, | |
| int_8u_t | pos, | |||
| datatype_t | dtype, | |||
| frvect_t::datacopy | cpy = frvect_t::fv_copy | |||
| ) |
Get data from the specified position. brief Get data.
| dat | Data record | |
| pos | Position within frame | |
| dtype | Data type | |
| cpy | Copy data? |
| bool framefast::framereader::getData | ( | data_t & | dat, | |
| const char * | channel, | |||
| int | nframe = 0, |
|||
| frvect_t::datacopy | cpy = frvect_t::fv_copy | |||
| ) |
Get data for the specified channel and frame number. brief Get data.
| dat | Data record | |
| channel | Channel name | |
| nframe | Frame number | |
| cpy | Copy data? |
| int framefast::framereader::copy | ( | const char * | chnname, | |
| real_4_t * | x, | |||
| int | max | |||
| ) |
Copies channel data into a float array. A return value of -1 indicates that the frame does not contain a TOC; a return value of 0 indicates that the channel name was not found; a positive return value repesents the number of data points associated with this channel. The returned number of points can be larger than the maximum specified, however, only max points are actually copied into the array. If the array pointer is 0, just the number of points is returned. brief Get float data.
| chnname | Name of channel | |
| x | data array (destination) | |
| max | maximum length of data array |
| int framefast::framereader::copy | ( | const char * | chnname, | |
| real_8_t * | x, | |||
| int | max | |||
| ) |
Copies channel data into a double array. A return value of -1 indicates that the frame does not contain a TOC; a return value of 0 indicates that the channel name was not found; a positive return value repesents the number of data points associated with this channel. The returned number of points can be larger than the maximum specified, however, only max points are actually copied into the array. If the array pointer is 0, just the number of points is returned. brief Get double data.
| chnname | Name of channel | |
| x | data array (destination) | |
| max | maximum length of data array |
| int framefast::framereader::copy | ( | const char * | chnname, | |
| int_2s_t * | x, | |||
| int | max | |||
| ) |
Copies channel data into a short array. A return value of -1 indicates that the frame does not contain a TOC; a return value of 0 indicates that the channel name was not found; a positive return value repesents the number of data points associated with this channel. The returned number of points can be larger than the maximum specified, however, only max points are actually copied into the array. If the array pointer is 0, just the number of points is returned. brief Get short data.
| chnname | Name of channel | |
| x | data array (destination) | |
| max | maximum length of data array |
| int framefast::framereader::copy | ( | const char * | chnname, | |
| int_4s_t * | x, | |||
| int | max | |||
| ) |
Copies channel data into an integer array. A return value of -1 indicates that the frame does not contain a TOC; a return value of 0 indicates that the channel name was not found; a positive return value repesents the number of data points associated with this channel. The returned number of points can be larger than the maximum specified, however, only max points are actually copied into the array. If the array pointer is 0, just the number of points is returned. brief Get int data.
| chnname | Name of channel | |
| x | data array (destination) | |
| max | maximum length of data array |
| std::ostream& framefast::framereader::writeTOC | ( | std::ostream & | os | ) |
Writes the TOC to an output stream. brief Write TOC.
| os | Output stream |
| std::ostream& framefast::framereader::writeFileHeader | ( | std::ostream & | os | ) |
Writes the file header to an output stream. brief Write file header.
| os | Output stream |
| int framefast::framereader::length | ( | ) | const [inline] |
Gets the length of the frame. brief Length of frame.
| const char* framefast::framereader::frame | ( | ) | const [inline] |
Gets the pointer to the frame. brief Pointer of frame.
| const char* framefast::framereader::frameend | ( | ) | const [inline] |
Gets the pointer to the end of the frame. brief Pointer of frame end.
| const char* framefast::framereader::fname | ( | ) | const [inline] |
Gets the original name of the frame storage object. brief Origianl name of frame.
| std::string framefast::framereader::guessFilename | ( | ) |
Guess the basic filename from the detector information and the GPS time (doesn't include directory nor extension). Uses the original name if set. brief Guess filename.
| int framefast::framereader::nframe | ( | ) |
Gets the number of frames in the file. brief Number of frames.
| Time framefast::framereader::starttime | ( | int | framenum = 0 |
) |
Gets the start time of a frame. brief Start time of a frame.
| framenum | Frame number |
| Interval framefast::framereader::duration | ( | int | framenum = 0 |
) |
Gets the duration of a frame. brief Duration of a frame.
| framenum | Frame number |
| Time framefast::framereader::nexttime | ( | ) |
Gets the time of the next frame (in the next file). brief time of next frame.
| const toc_t* framefast::framereader::getTOC | ( | ) |
Gets the TOC. brief Get the TOC.
| void framefast::framereader::setScanTOC | ( | bool | set = true |
) | [inline] |
Enforce a rescan of the TOC. brief Rescan the TOC.
1.5.4