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.");
34RxModule::~RxModule() =
default;
44 while (!
m_rbuf->isDead()) {
47 B2DEBUG(35,
"Rx: got an event from RingBuffer, size=" << size);
63 B2DEBUG(32,
"Rx: grew receive buffer to " <<
m_evtbuf.size() <<
" words");
72 gSystem->Load(
"libdataobjects");
100 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.
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.
std::vector< int > m_evtbuf
Receive buffer in words, grown on demand by readEvent().
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.