DABC (Data Acquisition Backbone Core)  2.9.9
Public Member Functions | Protected Attributes
hadaq::HldFile Class Reference

HLD file implementation. More...

#include <hadaq/HldFile.h>

Inheritance diagram for hadaq::HldFile:
dabc::BasicFile

Public Member Functions

void Close ()
 Close file. More...
 
bool eof () const
 When file open for reading, method returns true when file end was achieved. More...
 
uint32_t GetRunId () const
 Returns runid, assigned with the file. More...
 
 HldFile ()
 flag indicate that end-of-file was reached More...
 
bool OpenRead (const char *fname, const char *opt=0)
 Opened file for reading. More...
 
bool OpenWrite (const char *fname, uint32_t rid=0, const char *opt=0)
 Open file with specified name for writing. More...
 
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...
 
 ~HldFile ()
 
- Public Member Functions inherited from dabc::BasicFile
 BasicFile ()
 
bool eof () const
 
int GetIntPar (const char *parname)
 Return integer file parameter. More...
 
bool GetStrPar (const char *parname, char *sbuf, int sbuflen)
 Return string file parameter. More...
 
bool isOpened () const
 
bool isReading () const
 
bool IsRFIO ()
 Returns true when RFIO is used. More...
 
bool isWriting () const
 
void SetIO (FileInterface *_io, bool _ioowner=false)
 
 ~BasicFile ()
 

Protected Attributes

bool fEOF
 run number More...
 
uint32_t fRunNumber
 
- Protected Attributes inherited from dabc::BasicFile
FileInterface::Handle fd
 if true, io object owned by file More...
 
bool fReadingMode
 file descriptor More...
 
FileInterfaceio
 
bool iowoner
 interface to the file system More...
 

Additional Inherited Members

- Protected Member Functions inherited from dabc::BasicFile
void CheckIO ()
 
bool CloseBasicFile ()
 reading/writing mode More...
 

Detailed Description

HLD file implementation.

Definition at line 31 of file HldFile.h.

Constructor & Destructor Documentation

◆ HldFile()

hadaq::HldFile::HldFile ( )

flag indicate that end-of-file was reached

Definition at line 19 of file HldFile.cxx.

◆ ~HldFile()

hadaq::HldFile::~HldFile ( )

Definition at line 26 of file HldFile.cxx.

Member Function Documentation

◆ OpenWrite()

bool hadaq::HldFile::OpenWrite ( const char *  fname,
uint32_t  rid = 0,
const char *  opt = 0 
)

Open file with specified name for writing.

Definition at line 31 of file HldFile.cxx.

◆ OpenRead()

bool hadaq::HldFile::OpenRead ( const char *  fname,
const char *  opt = 0 
)

Opened file for reading.

Internal buffer required when data read partially and must be kept there.

Definition at line 63 of file HldFile.cxx.

◆ Close()

void hadaq::HldFile::Close ( )

Close file.

Definition at line 108 of file HldFile.cxx.

◆ GetRunId()

uint32_t hadaq::HldFile::GetRunId ( ) const
inline

Returns runid, assigned with the file.

Definition at line 51 of file HldFile.h.

◆ eof()

bool hadaq::HldFile::eof ( ) const
inline

When file open for reading, method returns true when file end was achieved.

Definition at line 54 of file HldFile.h.

◆ ReadBuffer()

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.

Definition at line 139 of file HldFile.cxx.

◆ WriteBuffer()

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.

Definition at line 126 of file HldFile.cxx.

Field Documentation

◆ fRunNumber

uint32_t hadaq::HldFile::fRunNumber
protected

Definition at line 33 of file HldFile.h.

◆ fEOF

bool hadaq::HldFile::fEOF
protected

run number

Definition at line 34 of file HldFile.h.


The documentation for this class was generated from the following files: