9#include <framework/pcore/RxModule.h>
10#include <framework/pcore/EvtMessage.h>
11#include <framework/pcore/DataStoreStreamer.h>
12#include <framework/core/RandomNumbers.h>
30 B2DEBUG(32,
"Rx: Constructor with RingBuffer done.");
36RxModule::~RxModule() =
default;
47 while (!
m_rbuf->isDead()) {
48 int size =
m_rbuf->remq(
reinterpret_cast<int*
>(evtbuf));
50 B2DEBUG(35,
"Rx: got an event from RingBuffer, size=" << size);
69 gSystem->Load(
"libdataobjects");
93 B2DEBUG(32,
"Rx: terminate called");
Stream/restore DataStore objects to/from EvtMessage.
@ c_DontWriteOut
Object/array should be NOT saved by output modules.
Class to manage streamed object.
static const unsigned int c_MaxEventSize
maximal EvtMessage size, in bytes (200MB).
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_Input
This module is an input module (reads data).
@ c_InternalSerializer
This module is an internal serializer/deserializer for parallel processing.
void setName(const std::string &name)
Set the name of the module.
void setType(const std::string &type)
Set the module type.
static RandomGenerator & getEventRandomGenerator()
return reference to the event dependent random generator
Class to manage a Ring Buffer placed in an IPC shared memory.
int shmid() const
Return ID of the shared memory.
DataStoreStreamer * m_streamer
Used for serialization.
virtual void initialize() override
Module functions to be called from main process.
void initStreamer()
initialize m_streamer.
virtual void event() override
This method is the core of the module.
virtual void terminate() override
This method is called at the end of the event processing.
RingBuffer * m_rbuf
attached RingBuffer.
int m_nrecv
Current event number.
void readEvent()
Gets data from m_rbuf and puts it into the data store.
StoreObjPtr< RandomGenerator > m_randomgenerator
Random Generator object to receive from TxModule.
bool m_handleMergeable
Whether to handle Mergeable objects.
int m_compressionLevel
Compression Level.
RxModule(RingBuffer *rbuf)
Constructor.
Abstract base class for different kinds of events.