DABC (Data Acquisition Backbone Core)  2.9.9
Public Member Functions | Protected Member Functions | Friends

Interface for implementing any kind of data input. More...

#include <dabc/DataIO.h>

Inheritance diagram for dabc::DataInput:
dabc::FileInput ezca::EpicsInput mbs::ClientTransport mbs::GeneratorInput saftdabc::Input user::Input dabc::BinaryFileInput hadaq::HldInput mbs::LmdInput mbs::TextInput

Public Member Functions

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 unsigned Read_Start (Buffer &buf)
 Prepare buffer for reading (if required) More...
 
virtual bool Read_Stat (dabc::Command cmd)
 Provide timeout value. More...
 
virtual double Read_Timeout ()
 Provide timeout value. More...
 
Buffer ReadBuffer ()
 Reads complete buffer. More...
 
virtual ~DataInput ()
 

Protected Member Functions

virtual WorkerAddonRead_GetAddon ()
 Returns addon, provided by data input If specified, supposed that I/O object is double-deriver from DataInput and Addon. More...
 

Friends

class InputTransport
 

Detailed Description

Interface for implementing any kind of data input.

dabc::DataInput object used by dabc::InputTransport to perform data reading. Input consists from sequence of following calls:

Definition at line 61 of file DataIO.h.

Constructor & Destructor Documentation

◆ ~DataInput()

virtual dabc::DataInput::~DataInput ( )
inlinevirtual

Definition at line 72 of file DataIO.h.

Member Function Documentation

◆ Read_GetAddon()

virtual WorkerAddon* dabc::DataInput::Read_GetAddon ( )
inlineprotectedvirtual

Returns addon, provided by data input If specified, supposed that I/O object is double-deriver from DataInput and Addon.

Reimplemented in mbs::ClientTransport.

Definition at line 68 of file DataIO.h.

◆ Read_Init()

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

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 in dabc::FileInput, dabc::BinaryFileInput, user::Input, saftdabc::Input, mbs::TextInput, mbs::LmdInput, mbs::GeneratorInput, hadaq::HldInput, and ezca::EpicsInput.

Definition at line 82 of file DataIO.h.

◆ Read_Size()

virtual unsigned dabc::DataInput::Read_Size ( )
inlinevirtual

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 in user::Input, saftdabc::Input, mbs::TextInput, mbs::LmdInput, mbs::GeneratorInput, mbs::ClientTransport, hadaq::HldInput, ezca::EpicsInput, and dabc::BinaryFileInput.

Definition at line 95 of file DataIO.h.

◆ Read_Start()

virtual unsigned dabc::DataInput::Read_Start ( Buffer buf)
inlinevirtual

Prepare buffer for reading (if required)

Returns
  • di_Ok - buffer must be filled in Read_Complete call
  • di_CallBack - input will do readout and activate transport via callback
  • di_Error (or other) - error, skip buffer

Reimplemented in user::Input, saftdabc::Input, and mbs::ClientTransport.

Definition at line 103 of file DataIO.h.

◆ Read_Complete()

virtual unsigned dabc::DataInput::Read_Complete ( Buffer buf)
inlinevirtual

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 in user::Input, saftdabc::Input, mbs::TextInput, mbs::LmdInput, mbs::GeneratorInput, mbs::ClientTransport, hadaq::HldInput, ezca::EpicsInput, and dabc::BinaryFileInput.

Definition at line 114 of file DataIO.h.

◆ Read_Timeout()

virtual double dabc::DataInput::Read_Timeout ( )
inlinevirtual

Provide timeout value.

Returns
timeout in seconds

When Read_Size or Read_Complete operations returns di_RepeatTimeout argument, specified timeout will be used before next operation will be done

Reimplemented in user::Input, saftdabc::Input, mbs::GeneratorInput, mbs::ClientTransport, and ezca::EpicsInput.

Definition at line 122 of file DataIO.h.

◆ Read_Stat()

virtual bool dabc::DataInput::Read_Stat ( dabc::Command  cmd)
inlinevirtual

Provide timeout value.

Take statistic from DataInput object

Reimplemented in dabc::FileInput.

Definition at line 128 of file DataIO.h.

◆ ReadBuffer()

dabc::Buffer dabc::DataInput::ReadBuffer ( )

Reads complete buffer.

Perform consequent call of Read_Size(), Read_Start() and Read_Complete() methods

Returns
filled buffer

Definition at line 21 of file DataIO.cxx.

Friends And Related Function Documentation

◆ InputTransport

friend class InputTransport
friend

Definition at line 62 of file DataIO.h.


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