9#include <daq/rfarm/event/modules/Rbuf2RbufModule.h>
13#include "framework/datastore/StoreObjPtr.h"
14#include "framework/dataobjects/EventMetaData.h"
44 B2INFO(
"Rx: Constructor done.");
48Rbuf2RbufModule::~Rbuf2RbufModule()
54 gSystem->Load(
"libdataobjects");
69 B2INFO(
"Rx initialized.");
75 B2INFO(
"beginRun called.");
87 int* evtbuf =
new int[MAXEVTSIZE];
90 while ((size = m_rbufin->
remq(evtbuf)) == 0) {
97 int stat = m_rbufout->
insq(evtbuf, size);
106 evtmetadata->setExperiment(1);
107 evtmetadata->setRun(1);
108 evtmetadata->setEvent(
m_nrecv);
112 B2INFO(
"Rbuf2Rbuf: RingBuffer copied!!");
121 B2INFO(
"Rbuf2Rbuf: endRun done.");
127 B2INFO(
"Rbuf2Rbuf: terminate called");
void setDescription(const std::string &description)
Sets the description of the module.
std::string m_name_rbufout
Output RingBuffer ID.
Rbuf2RbufModule()
Constructor / Destructor.
void initialize() override
Module functions to be called from main process.
void event() override
This method is the core of the module.
void endRun() override
This method is called if the current run ends.
void terminate() override
This method is called at the end of the event processing.
StoreObjPtr< EventMetaData > m_eventMetaData
EventMetaData.
void beginRun() override
Module functions to be called from event process.
int m_nrecv
No. of sent events.
std::string m_name_rbufin
Input RingBuffer ID.
Class to manage a Ring Buffer placed in an IPC shared memory.
int insq(const int *buf, int size, bool checkTx=false)
Append a buffer to the RingBuffer.
int remq(int *buf)
Pick up a buffer from the RingBuffer.
bool create(bool replace=false)
Create a default object in the data store.
Type-safe access to single objects in the data store.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.