#include <framefast.hh>
Public Types | |
| enum | framepos { framebegin = 0, framebusy, framebreak, frameend } |
| frame position More... | |
| typedef std::deque< framebuffer_t > | framebufferlist |
| Set of frame buffers. | |
| typedef std::vector< detector_t > | detector_array_t |
| Set of detector information. | |
Public Member Functions | |
| framewriter (int nFrameLen=1, int nFrame=1, int compress=0, int version=kDefaultFrameVersion) | |
| ~framewriter () | |
| framepos | status () |
| bool | setFormat (int nFrameLen=1, int nFrame=1, int compress=0, int version=kDefaultFrameVersion) |
| int | frameLength () const |
| bool | setTime (const Time &time) |
| bool | setDetectorInfo (const detector_t &det) |
| bool | addDetectorInfo (const detector_t &det) |
| const detector_t * | getDetectorInfo (int dnum=0) const |
| const toc_t * | getTOC () const |
| int | nframe () const |
| Time | starttime (int framenum=0) const |
| Interval | duration (int framenum=0) const |
| Time | nexttime () const |
| bool | addData (const adcdata_t &adc, const frvect_t &vect) |
| bool | next () |
| bool | next (const Time &nextframe) |
| bool | write (basic_frameout *out) |
| bool | getBuffers (framebufferlist &bufs) |
| int | buffers () const |
| const char * | framebuffer (int buffer) const |
| int | bufferlen (int buffer) const |
| int | total () const |
| void | purge () |
| void | setFilename (const char *filename) |
| const char * | getFilename () const |
| std::string | guessFilename () const |
| void | setFrameNum (int num) |
| int | getFrameNum () const |
| void | setRunNum (int num) |
| int | getRunNum () const |
Protected Member Functions | |
| framebuffer_t * | currentBuffer () |
| get the current buffer | |
| bool | appendBuffer (const char *dat, int len) |
| append data to output buffers | |
| bool | beginFile () |
| write frame file header | |
| bool | endFile () |
| write frame file trailer (TOC) | |
| bool | beginFrame () |
| write frame header | |
| bool | endFrame () |
| write frame trailer | |
Protected Attributes | |
| bool | fSwap |
| Swap byte order? | |
| int | fVersion |
| Version. | |
| framepos | fFramePos |
| Frame position. | |
| Time | fTime |
| Start time of frame. | |
| Time | fNext |
| Time of next frame. | |
| int | fRunNum |
| Run number. | |
| int | fFrameNum |
| Frame number. | |
| int | fFrameLen |
| Frame length in seconds. | |
| int | fNFrame |
| Number of frames per file. | |
| int | fCompress |
| compression scheme? | |
| int | fN |
| Current frame counter. | |
| int | fTotal |
| Total byte count written into the frame buffers so far. | |
| framebufferlist | fFrameBuffer |
| Data buffer. | |
| detector_array_t | fDetector |
| Detector information. | |
| toc_t | fTOC |
| Table of contents. | |
| std::string | fFilename |
| File name. | |
| ptr_struct | fPtr [9] |
Classes | |
| class | framebuffer_t |
| Frame buffer (data container with smart pointer). More... | |
| framefast::framewriter::framewriter | ( | int | nFrameLen = 1, |
|
| int | nFrame = 1, |
|||
| int | compress = 0, |
|||
| int | version = kDefaultFrameVersion | |||
| ) | [explicit] |
Constructs a fast frame writer.
| nFrameLen | frame length in sec | |
| nFrame | Number of frames per file | |
| compress | Compress data vectors | |
| version | Frame specification version brief Default constructor. |
| framefast::framewriter::~framewriter | ( | ) |
Destructs a fast frame writer. brief Destructor.
| framepos framefast::framewriter::status | ( | ) | [inline] |
Returns the status of the frame writer. brief Status of frame writer.
| bool framefast::framewriter::setFormat | ( | int | nFrameLen = 1, |
|
| int | nFrame = 1, |
|||
| int | compress = 0, |
|||
| int | version = kDefaultFrameVersion | |||
| ) |
Set the frame format. brief Set the frame format.
| nFrame | Number of frames per file | |
| nFrameLen | Length of each frames (in sec) | |
| compress | Compress data vectors | |
| version | Frame specification version |
| int framefast::framewriter::frameLength | ( | ) | const [inline] |
Returns the length of frames. brief Length of frames.
| bool framefast::framewriter::setTime | ( | const Time & | time | ) |
Set the time of the next frame. brief Set the frame start time.
| time | Frame start time |
| bool framefast::framewriter::setDetectorInfo | ( | const detector_t & | det | ) |
Set the detector information. brief Set the detector information.
| det | Detector information |
| bool framefast::framewriter::addDetectorInfo | ( | const detector_t & | det | ) |
Add a detector information. brief Add a detector information.
| det | Detector information |
| const detector_t* framefast::framewriter::getDetectorInfo | ( | int | dnum = 0 |
) | const [inline] |
Get the detector information. brief Get the detector information.
| dnum | Detector number |
| const toc_t* framefast::framewriter::getTOC | ( | ) | const [inline] |
Get the table of contents. brief Get the table of contents.
| int framefast::framewriter::nframe | ( | ) | const |
Gets the number of frames in the file. brief Number of frames.
| Time framefast::framewriter::starttime | ( | int | framenum = 0 |
) | const |
Gets the start time of a frame. brief Start time of a frame.
| framenum | Frame number |
| Interval framefast::framewriter::duration | ( | int | framenum = 0 |
) | const |
Gets the duration of a frame. brief Duration of a frame.
| framenum | Frame number |
| Time framefast::framewriter::nexttime | ( | ) | const |
Gets the time of the next frame (in the next file) brief time of next frame.
Add an ADC data vector to the frame. brief Add ADC data.
| adc | ADC structure | |
| vect | Vector structure containing the data |
| bool framefast::framewriter::next | ( | ) |
Moves to the next frame. This will write the current frame into a memory buffer and add it to the frame buffers. During the first call the frame file header gets written first, whereas during the last call the table of contents and the end-of-file marker is appended. The time is increased by the frame length. brief Move to the next frame.
| bool framefast::framewriter::next | ( | const Time & | nextframe | ) |
Moves to the next frame. This will write the current frame into a memory buffer and add it to the frame buffers. During the first call the frame file header gets written first, whereas during the last call the table of contents and the end-of-file marker is appended. The argument specifies for the start time of the next frame. brief Move to the next frame.
| nextframe | Start time of next frame |
| bool framefast::framewriter::write | ( | basic_frameout * | out | ) |
Writes the frame buffers to an output. This will purge the buffers from the frame writer. brief Write a frame.
| bool framefast::framewriter::getBuffers | ( | framebufferlist & | bufs | ) | [inline] |
Get the frame buffers. This will automatically purge the buffers from the frame writer and transfer ownership of the buffers to the caller. brief Get the frame buffers.
| int framefast::framewriter::buffers | ( | ) | const [inline] |
Get the number of frame buffers already written. brief Get the number of buffers.
| const char* framefast::framewriter::framebuffer | ( | int | buffer | ) | const [inline] |
Get a pointer to the frame buffer. brief Get the buffer pointer.
| buffer | Buffer number |
| int framefast::framewriter::bufferlen | ( | int | buffer | ) | const [inline] |
Get the length of the frame buffer. brief Get the frame buffer length.
| buffer | Buffer number |
| int framefast::framewriter::total | ( | ) | const [inline] |
Get the total number of bytes written so far. brief Total frame size.
| void framefast::framewriter::purge | ( | ) | [inline] |
Purge the current frame buffers. brief Purge frame buffers.
| void framefast::framewriter::setFilename | ( | const char * | filename | ) | [inline] |
Set the output file name. brief Set filename.
| filename | Name of file |
| const char* framefast::framewriter::getFilename | ( | ) | const [inline] |
Get the output file name. brief Get filename.
| std::string framefast::framewriter::guessFilename | ( | ) | const |
Guess the basic filename from the detector information and the GPS time (doesn't include directory nor extension). brief Guess filename.
| void framefast::framewriter::setFrameNum | ( | int | num | ) | [inline] |
Set the frame number. brief Set the frame number.
| num | frame number |
| int framefast::framewriter::getFrameNum | ( | ) | const [inline] |
Get the frame number. brief Get frame number.
| void framefast::framewriter::setRunNum | ( | int | num | ) | [inline] |
Set the run number. brief Set the run number.
| num | run number |
| int framefast::framewriter::getRunNum | ( | ) | const [inline] |
Get the run number. brief Get run number.
ptr_struct framefast::framewriter::fPtr[9] [protected] |
Pointers to Frame header, detector info, history info, raw data, ADC data, data vector, End of frame, TOC, End of file
1.5.4