stream
0.10.0
stream analysis framework
|
Reading of HLD files. More...
#include <hadaq/HldFile.h>
Public Member Functions | |
bool | OpenWrite (const char *fname, uint32_t rid=0) |
Open file with specified name for writing. | |
bool | OpenRead (const char *fname) |
Opened file for reading. More... | |
void | Close () |
Close file. | |
uint32_t | GetRunId () const |
Returns runid, assigned with the file. | |
bool | eof () const |
When file open for reading, method returns true when file end was achieved. | |
bool | ReadBuffer (void *ptr, uint32_t *bufsize, bool onlyevent=false) |
Read one or several elements to provided user buffer When called, bufsize should has available buffer size, after call contains actual size read. More... | |
bool | WriteBuffer (void *buf, uint32_t bufsize) |
Write user buffer to file without reformatting User must be aware about correct formatting of data. More... | |
![]() | |
void | SetIO (FileInterface *_io, bool _ioowner=false) |
bool | isOpened () const |
bool | isReading () const |
bool | isWriting () const |
bool | eof () const |
int | GetIntPar (const char *parname) |
Return integer file parameter. | |
bool | GetStrPar (const char *parname, char *sbuf, int sbuflen) |
Return string file parameter. | |
bool | IsRFIO () |
Returns true when RFIO is used. | |
Protected Attributes | |
uint32_t | fRunNumber |
! run number | |
bool | fEOF |
! flag indicate that end-of-file was reached | |
![]() | |
FileInterface * | io |
! interface to the file system | |
bool | iowoner |
! if true, io object owned by file | |
FileInterface::Handle | fd |
! file descriptor | |
bool | fReadingMode |
! reading/writing mode | |
Additional Inherited Members | |
![]() | |
bool | CloseBasicFile () |
void | CheckIO () |
Reading of HLD files.
bool hadaq::HldFile::OpenRead | ( | const char * | fname | ) |
Opened file for reading.
Internal buffer required when data read partially and must be kept there.
bool hadaq::HldFile::ReadBuffer | ( | void * | ptr, |
uint32_t * | bufsize, | ||
bool | onlyevent = false |
||
) |
Read one or several elements to provided user buffer When called, bufsize should has available buffer size, after call contains actual size read.
If /param onlyevent=true, the only hadaq element will be read. Returns true if any data were successfully read.
bool hadaq::HldFile::WriteBuffer | ( | void * | buf, |
uint32_t | bufsize | ||
) |
Write user buffer to file without reformatting User must be aware about correct formatting of data.
Returns true if data was written.