|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Reads datagrams sequentially from a file descriptor into a single internal buffer of maxDgramSize bytes. More...
#include <XtcFileIterator.hh>
Public Member Functions | |
| XtcFileIterator (int fd, size_t maxDgramSize) | |
| Store fd and allocate the internal buffer of maxDgramSize bytes. | |
| ~XtcFileIterator () | |
| Free the internal buffer; fd is not closed. | |
| Dgram * | next () |
| Read the next Dgram header (sizeof(Dgram) bytes) and then its xtc payload into the internal buffer. | |
| void | rewind () |
| Seek fd back to offset 0 with lseek(); the result is not checked. | |
| size_t | size () const |
| Return the buffer size maxDgramSize given to the constructor. | |
Reads datagrams sequentially from a file descriptor into a single internal buffer of maxDgramSize bytes.
| XtcData::XtcFileIterator::XtcFileIterator | ( | int | fd, |
| size_t | maxDgramSize | ||
| ) |
Store fd and allocate the internal buffer of maxDgramSize bytes.
The file descriptor is not opened or closed by this class.
| XtcData::XtcFileIterator::~XtcFileIterator | ( | ) |
Free the internal buffer; fd is not closed.
| Dgram * XtcData::XtcFileIterator::next | ( | ) |
Read the next Dgram header (sizeof(Dgram) bytes) and then its xtc payload into the internal buffer.
Only a header read returning 0 is treated as end of file; failed or short header reads are not checked.
| void XtcData::XtcFileIterator::rewind | ( | ) |
Seek fd back to offset 0 with lseek(); the result is not checked.
|
inline |
Return the buffer size maxDgramSize given to the constructor.