DABC (Data Acquisition Backbone Core)  2.9.9
GeneratorInput.h
Go to the documentation of this file.
1 // $Id: GeneratorInput.h 4781 2021-07-14 12:28:15Z linev $
2 
3 /************************************************************
4  * The Data Acquisition Backbone Core (DABC) *
5  ************************************************************
6  * Copyright (C) 2009 - *
7  * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
8  * Planckstr. 1, 64291 Darmstadt, Germany *
9  * Contact: http://dabc.gsi.de *
10  ************************************************************
11  * This software can be used under the GPL license *
12  * agreements as stated in LICENSE.txt file *
13  * which is part of the distribution. *
14  ************************************************************/
15 
16 #ifndef MBS_GeneratorInput
17 #define MBS_GeneratorInput
18 
19 #ifndef DABC_DataIO
20 #include "dabc/DataIO.h"
21 #endif
22 
23 namespace mbs {
24 
43  protected:
44  uint32_t fEventCount;
45  uint16_t fNumSubevents;
46  uint16_t fFirstProcId;
47  uint32_t fSubeventSize;
49  uint32_t fFullId;
50  uint64_t fTotalSize;
51  uint64_t fTotalSizeLimit;
52  double fGenerTimeout;
54 
55  public:
56  GeneratorInput(const dabc::Url& url);
57  virtual ~GeneratorInput() {}
58 
59  virtual bool Read_Init(const dabc::WorkerRef& wrk, const dabc::Command& cmd);
60 
61  virtual unsigned Read_Size();
62 
63  virtual unsigned Read_Complete(dabc::Buffer& buf);
64 
65  virtual double Read_Timeout() { return fGenerTimeout; }
66 
67  };
68 
69 }
70 
71 
72 #endif
Reference on memory from memory pool.
Definition: Buffer.h:135
Represents command with its arguments.
Definition: Command.h:99
Interface for implementing any kind of data input.
Definition: DataIO.h:61
Uniform Resource Locator interpreter.
Definition: Url.h:33
Reference on dabc::Worker
Definition: Worker.h:466
Input object for MBS-events generator.
uint32_t fEventCount
current event id
bool fIsGo4RandomFormat
is subevents should be filled with random numbers
virtual ~GeneratorInput()
virtual unsigned Read_Complete(dabc::Buffer &buf)
Complete reading of the buffer from source,.
virtual unsigned Read_Size()
Defines required buffer size for next operation.
uint32_t fSubeventSize
size of each subevent
uint16_t fNumSubevents
number of subevents to generate
double fGenerTimeout
timeout used to avoid 100% CPU load
uint16_t fFirstProcId
procid of first subevent
uint32_t fFullId
subevent id, if number subevents==1 and nonzero
GeneratorInput(const dabc::Url &url)
uint64_t fTotalSizeLimit
limit of generated events size
uint64_t fTotalSize
total size of generated events
virtual double Read_Timeout()
Provide timeout value.
virtual bool Read_Init(const dabc::WorkerRef &wrk, const dabc::Command &cmd)
Initialize data input, using port and command.
bool fTimeoutSwitch
boolean used to generate timeouts
Support for MBS - standard GSI DAQ.
Definition: api.h:36