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

Text LMD input. More...

#include <mbs/TextInput.h>

Inheritance diagram for mbs::TextInput:
dabc::FileInput dabc::DataInput

Public Member Functions

virtual unsigned FillRawData (const char *str, void *rawdata, unsigned maxsize)
 
virtual unsigned RawDataSize ()
 
virtual unsigned Read_Complete (dabc::Buffer &buf)
 Complete reading of the buffer from source,. More...
 
virtual bool Read_Init (const dabc::WorkerRef &wrk, const dabc::Command &cmd)
 Initialize data input, using port and command. More...
 
virtual unsigned Read_Size ()
 Defines required buffer size for next operation. More...
 
 TextInput (const dabc::Url &url)
 
virtual ~TextInput ()
 
- 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

char * fCharBuffer
 
int fCharBufferLength
 
std::string fDataFormat
 
unsigned fDataUnitSize
 
uint32_t fEventCounter
 
std::ifstream fFile
 
int fFormatId
 
int fNumData
 
int fNumHeaderLines
 
- 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

Text LMD input.

Provides way to read text files and convert data into MBS event structure

Definition at line 33 of file TextInput.h.

Constructor & Destructor Documentation

◆ TextInput()

mbs::TextInput::TextInput ( const dabc::Url url)

Definition at line 24 of file TextInput.cxx.

◆ ~TextInput()

mbs::TextInput::~TextInput ( )
virtual

Definition at line 42 of file TextInput.cxx.

Member Function Documentation

◆ CloseFile()

bool mbs::TextInput::CloseFile ( )
protected

Definition at line 93 of file TextInput.cxx.

◆ OpenNextFile()

bool mbs::TextInput::OpenNextFile ( )
protected

Definition at line 73 of file TextInput.cxx.

◆ Read_Init()

bool mbs::TextInput::Read_Init ( const dabc::WorkerRef wrk,
const dabc::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 49 of file TextInput.cxx.

◆ Read_Size()

unsigned mbs::TextInput::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 100 of file TextInput.cxx.

◆ Read_Complete()

unsigned mbs::TextInput::Read_Complete ( dabc::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 110 of file TextInput.cxx.

◆ RawDataSize()

unsigned mbs::TextInput::RawDataSize ( )
virtual

Return raw data size (upper limit), required for single event

Definition at line 171 of file TextInput.cxx.

◆ FillRawData()

unsigned mbs::TextInput::FillRawData ( const char *  str,
void *  rawdata,
unsigned  maxsize 
)
virtual

Decode raw data from text string into subevent, Return actual filled event size, 0 - error

Definition at line 178 of file TextInput.cxx.

Field Documentation

◆ fDataFormat

std::string mbs::TextInput::fDataFormat
protected

Definition at line 35 of file TextInput.h.

◆ fNumData

int mbs::TextInput::fNumData
protected

Definition at line 36 of file TextInput.h.

◆ fNumHeaderLines

int mbs::TextInput::fNumHeaderLines
protected

Definition at line 37 of file TextInput.h.

◆ fCharBufferLength

int mbs::TextInput::fCharBufferLength
protected

Definition at line 38 of file TextInput.h.

◆ fFile

std::ifstream mbs::TextInput::fFile
protected

Definition at line 40 of file TextInput.h.

◆ fCharBuffer

char* mbs::TextInput::fCharBuffer
protected

Definition at line 41 of file TextInput.h.

◆ fEventCounter

uint32_t mbs::TextInput::fEventCounter
protected

Definition at line 42 of file TextInput.h.

◆ fFormatId

int mbs::TextInput::fFormatId
protected

Definition at line 43 of file TextInput.h.

◆ fDataUnitSize

unsigned mbs::TextInput::fDataUnitSize
protected

Definition at line 44 of file TextInput.h.


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