Belle II Software development
FastRbuf2DsModule.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#ifndef FASTRBUF2DSMODULE_H
10#define FASTRBUF2DSMODULE_H
11
12#include <framework/core/Module.h>
13#include <framework/pcore/RingBuffer.h>
14
15#include <pthread.h>
16
17#include <string>
18
19#include <framework/pcore/DataStoreStreamer.h>
20//#include <framework/datastore/DataStore.h>
21
22#define RBUFSIZE 100000000
23#define MAXEVTSIZE 400000000
24
25
26namespace Belle2 {
34 class FastRbuf2DsModule : public Module {
35
36 // Public functions
37 public:
38
41 virtual ~FastRbuf2DsModule();
42
44 void initialize() override;
45
47 void beginRun() override;
48 void event() override;
49 void endRun() override;
50 void terminate() override;
51
53 void ReadRbufInThread();
54
55 // Data members
56 private:
57
59 std::string m_rbufname;
60 RingBuffer* m_rbuf;
61
63 pthread_t m_thr_input;
64
67
70
73
76
77 };
78
80} // end namespace Belle2
81
82#endif // MODULEHELLO_H
Stream/restore DataStore objects to/from EvtMessage.
A class definition of an input module for Sequential ROOT I/O.
DataStoreStreamer * m_streamer
DataStore streamer.
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.
pthread_t m_thr_input
Input thread ID.
void terminate() override
This method is called at the end of the event processing.
void beginRun() override
Module functions to be called from event process.
int m_nrecv
No. of sent events.
int m_compressionLevel
Compression Level.
std::string m_rbufname
RingBuffer ID.
FastRbuf2DsModule()
Constructor / Destructor.
void ReadRbufInThread()
Function to read event from RB.
int m_numThread
Number of decoder threads.
Base class for Modules.
Definition: Module.h:72
Class to manage a Ring Buffer placed in an IPC shared memory.
Definition: RingBuffer.h:39
Abstract base class for different kinds of events.