9 #include <daq/rfarm/event/modules/Ds2RbufModule.h>
11 #include <framework/datastore/DataStore.h>
30 setDescription(
"Encode DataStore into RingBuffer");
32 vector<string> emptyvector;
33 addParam(
"RingBufferName", m_rbufname,
"Name of RingBuffer",
34 string(
"OutputRbuf"));
35 addParam(
"CompressionLevel", m_compressionLevel,
"Compression level",
37 addParam(
"saveObjs", m_saveobjs,
"List of objects to be sent", emptyvector);
41 m_compressionLevel = 0;
44 B2INFO(
"Ds2Rbuf: Constructor done.");
48 Ds2RbufModule::~Ds2RbufModule()
52 void Ds2RbufModule::initialize()
58 m_streamer->setStreamingObjects(m_saveobjs);
60 B2INFO(
"Ds2Rbuf initialized.");
64 void Ds2RbufModule::beginRun()
66 B2INFO(
"Ds2Rbuf: beginRun called.");
70 void Ds2RbufModule::event()
73 EvtMessage* msg = m_streamer->streamDataStore(DataStore::c_Event);
76 B2INFO(
"Ds2Rbuf: msgsize = " << msg->
size());
87 B2INFO(
"Ds2Rbuf: objs sent in buffer. Size = " << msg->
size());
97 void Ds2RbufModule::endRun()
101 printf(
"Ds2Rbuf: endRun called.....\n");
102 B2INFO(
"Ds2Rbuf: endRun done.");
106 void Ds2RbufModule::terminate()
112 B2INFO(
"Ds2Rbuf: terminate called");
Stream/restore DataStore objects to/from EvtMessage.
A class definition of an input module for Sequential ROOT I/O.
Class to manage streamed object.
int paddedSize() const
Same as size(), but as size of an integer array.
char * buffer()
Get buffer address.
int size() const
Get size of message including headers.
Class to manage a Ring Buffer placed in an IPC shared memory.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.