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

Binary file input object. More...

#include <dabc/BinaryFileIO.h>

Inheritance diagram for dabc::BinaryFileInput:
dabc::FileInput dabc::DataInput

Public Member Functions

 BinaryFileInput (const dabc::Url &url)
 
virtual unsigned Read_Complete (Buffer &buf)
 Complete reading of the buffer from source,. More...
 
virtual bool Read_Init (const WorkerRef &wrk, const Command &cmd)
 Initialize data input, using port and command. More...
 
virtual unsigned Read_Size ()
 Defines required buffer size for next operation. More...
 
virtual ~BinaryFileInput ()
 
- Public Member Functions inherited from dabc::FileInput
virtual bool Read_Stat (dabc::Command cmd)
 Provide timeout value. More...
 
void SetIO (dabc::FileInterface *io)
 
virtual ~FileInput ()
 
- Public Member Functions inherited from dabc::DataInput
virtual unsigned Read_Start (Buffer &buf)
 Prepare buffer for reading (if required) More...
 
virtual double Read_Timeout ()
 Provide timeout value. More...
 
Buffer ReadBuffer ()
 Reads complete buffer. More...
 
virtual ~DataInput ()
 

Protected Member Functions

bool CloseFile ()
 
bool OpenNextFile ()
 
- Protected Member Functions inherited from dabc::FileInput
void ClearCurrentFileName ()
 
const std::string & CurrentFileName () const
 
 FileInput (const dabc::Url &url)
 
bool InitFilesList ()
 
bool TakeNextFileName ()
 
- Protected Member Functions inherited from dabc::DataInput
virtual WorkerAddonRead_GetAddon ()
 Returns addon, provided by data input If specified, supposed that I/O object is double-deriver from DataInput and Addon. More...
 

Protected Attributes

uint64_t fCurrentBufSize
 
uint64_t fCurrentBufType
 
BinaryFile fFile
 
- Protected Attributes inherited from dabc::FileInput
std::string fCurrentName
 
std::string fFileName
 
dabc::Reference fFilesList
 
dabc::FileInterfacefIO
 
bool fLoop
 read file(s) in endless loop More...
 
double fReduce
 factor to reduce buffer size when reading More...
 

Detailed Description

Binary file input object.

Implements dabc::DataInput for binary dabc files.

Definition at line 36 of file BinaryFileIO.h.

Constructor & Destructor Documentation

◆ BinaryFileInput()

dabc::BinaryFileInput::BinaryFileInput ( const dabc::Url url)

Definition at line 18 of file BinaryFileIO.cxx.

◆ ~BinaryFileInput()

dabc::BinaryFileInput::~BinaryFileInput ( )
virtual

Definition at line 26 of file BinaryFileIO.cxx.

Member Function Documentation

◆ OpenNextFile()

bool dabc::BinaryFileInput::OpenNextFile ( )
protected

Definition at line 38 of file BinaryFileIO.cxx.

◆ CloseFile()

bool dabc::BinaryFileInput::CloseFile ( )
protected

Definition at line 55 of file BinaryFileIO.cxx.

◆ Read_Init()

bool dabc::BinaryFileInput::Read_Init ( const WorkerRef wrk,
const Command cmd 
)
virtual

Initialize data input, using port and command.

This is generic virtual method to initialize input, using configurations from Port and (or) from the Command

Parameters
[in]wrkreference on input port
[in]cmdreference on command object
Returns
false when method fails

Reimplemented from dabc::FileInput.

Definition at line 31 of file BinaryFileIO.cxx.

◆ Read_Size()

unsigned dabc::BinaryFileInput::Read_Size ( )
virtual

Defines required buffer size for next operation.

Returns
  • 0..di_ValidSize - size of buffer for next read operation (di_ValidSize = 0xFFFFFFF0)
  • di_EndOfStream - this is end of stream, normal close of the input
  • di_DfltBufSize - any non-zero buffer can be provided
  • di_Repeat - nothing to read now, try again as soon as possible
  • di_RepeatTimeOut - nothing to read now, try again after timeout
  • di_CallBack - input will activate transport via callback
  • di_Error - error, close input

Reimplemented from dabc::DataInput.

Definition at line 62 of file BinaryFileIO.cxx.

◆ Read_Complete()

unsigned dabc::BinaryFileInput::Read_Complete ( Buffer buf)
virtual

Complete reading of the buffer from source,.

Returns
  • di_Ok - buffer filled and ready
  • di_EndOfStream - this is end of stream, normal close of the input
  • di_SkipBuffer - skip buffer
  • di_Error - error, skip buffer and close input
  • di_Repeat - not ready, call again as soon as possible
  • di_RepeatTimeOut - not ready, call again after timeout

Reimplemented from dabc::DataInput.

Definition at line 79 of file BinaryFileIO.cxx.

Field Documentation

◆ fFile

BinaryFile dabc::BinaryFileInput::fFile
protected

Definition at line 38 of file BinaryFileIO.h.

◆ fCurrentBufSize

uint64_t dabc::BinaryFileInput::fCurrentBufSize
protected

Definition at line 40 of file BinaryFileIO.h.

◆ fCurrentBufType

uint64_t dabc::BinaryFileInput::fCurrentBufType
protected

Definition at line 41 of file BinaryFileIO.h.


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