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

Input object for MBS-events generator. More...

#include <mbs/GeneratorInput.h>

Inheritance diagram for mbs::GeneratorInput:
dabc::DataInput

Public Member Functions

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

Protected Attributes

uint32_t fEventCount
 current event id More...
 
uint16_t fFirstProcId
 procid of first subevent More...
 
uint32_t fFullId
 subevent id, if number subevents==1 and nonzero More...
 
double fGenerTimeout
 timeout used to avoid 100% CPU load More...
 
bool fIsGo4RandomFormat
 is subevents should be filled with random numbers More...
 
uint16_t fNumSubevents
 number of subevents to generate More...
 
uint32_t fSubeventSize
 size of each subevent More...
 
bool fTimeoutSwitch
 boolean used to generate timeouts More...
 
uint64_t fTotalSize
 total size of generated events More...
 
uint64_t fTotalSizeLimit
 limit of generated events size More...
 

Additional Inherited Members

- 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...
 

Detailed Description

Input object for MBS-events generator.

It can generate MBS events for testing. Configuration in xml file look like:

<InputPort name="Input0" url="lmd://Generator?size=32&numsub=2&tmout=10" queue="5"/>

Following parameters are supported: numsub - number of subevents procid - procid of first subevent size - size of each subevent go4 - if true (default), generates go4-specific data, used in all examples fullid - fullid of first subevent total - size limit of generated events in MB tmout - delay between two generated buffers (in ms)

Definition at line 42 of file GeneratorInput.h.

Constructor & Destructor Documentation

◆ GeneratorInput()

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

Definition at line 39 of file GeneratorInput.cxx.

◆ ~GeneratorInput()

virtual mbs::GeneratorInput::~GeneratorInput ( )
inlinevirtual

Definition at line 57 of file GeneratorInput.h.

Member Function Documentation

◆ Read_Init()

bool mbs::GeneratorInput::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::DataInput.

Definition at line 63 of file GeneratorInput.cxx.

◆ Read_Size()

unsigned mbs::GeneratorInput::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 68 of file GeneratorInput.cxx.

◆ Read_Complete()

unsigned mbs::GeneratorInput::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 81 of file GeneratorInput.cxx.

◆ Read_Timeout()

virtual double mbs::GeneratorInput::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 from dabc::DataInput.

Definition at line 65 of file GeneratorInput.h.

Field Documentation

◆ fEventCount

uint32_t mbs::GeneratorInput::fEventCount
protected

current event id

Definition at line 44 of file GeneratorInput.h.

◆ fNumSubevents

uint16_t mbs::GeneratorInput::fNumSubevents
protected

number of subevents to generate

Definition at line 45 of file GeneratorInput.h.

◆ fFirstProcId

uint16_t mbs::GeneratorInput::fFirstProcId
protected

procid of first subevent

Definition at line 46 of file GeneratorInput.h.

◆ fSubeventSize

uint32_t mbs::GeneratorInput::fSubeventSize
protected

size of each subevent

Definition at line 47 of file GeneratorInput.h.

◆ fIsGo4RandomFormat

bool mbs::GeneratorInput::fIsGo4RandomFormat
protected

is subevents should be filled with random numbers

Definition at line 48 of file GeneratorInput.h.

◆ fFullId

uint32_t mbs::GeneratorInput::fFullId
protected

subevent id, if number subevents==1 and nonzero

Definition at line 49 of file GeneratorInput.h.

◆ fTotalSize

uint64_t mbs::GeneratorInput::fTotalSize
protected

total size of generated events

Definition at line 50 of file GeneratorInput.h.

◆ fTotalSizeLimit

uint64_t mbs::GeneratorInput::fTotalSizeLimit
protected

limit of generated events size

Definition at line 51 of file GeneratorInput.h.

◆ fGenerTimeout

double mbs::GeneratorInput::fGenerTimeout
protected

timeout used to avoid 100% CPU load

Definition at line 52 of file GeneratorInput.h.

◆ fTimeoutSwitch

bool mbs::GeneratorInput::fTimeoutSwitch
protected

boolean used to generate timeouts

Definition at line 53 of file GeneratorInput.h.


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