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;
50 B2DEBUG(35,
"Rx: got an event from RingBuffer, size=" << size);
69 gSystem->Load(
"libdataobjects");
97 B2DEBUG(32,
"Rx: terminate called");
Stream/restore DataStore objects to/from EvtMessage.
int restoreDataStore(EvtMessage *msg)
Restore DataStore objects 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.
int remq(int *buf)
Pick up a buffer from the RingBuffer.
bool isDead() const
If True, the ring buffer is empty and has no attached Tx modules (i.e.
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 endRun() override
This method is called if the current run ends.
virtual void terminate() override
This method is called at the end of the event processing.
RingBuffer * m_rbuf
attached RingBuffer.
virtual void beginRun() override
Called when entering a new run.
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.