Belle II Software development
RawRevSock2Rb.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#pragma once
9
10#include <string>
11
12#include "framework/pcore/RingBuffer.h"
13#include "daq/dataflow/RSocketLib.h"
14#include "daq/rfarm/manager/RFFlowStat.h"
15
16#define MAXBUFSIZE 20000000
17#define RBUFSIZE 100000000
18
20public:
22 RawRevSock2Rb(const std::string& rbuf, const std::string& src, int port, std::string shmname, int id);
23 ~RawRevSock2Rb(void);
25 RawRevSock2Rb(const RawRevSock2Rb&) = delete;
26
29
31 int ReceiveEvent(void);
32
34 int Reconnect(int ntry);
35
36private:
37 Belle2::RingBuffer* m_rbuf;
38 Belle2::RSocketRecv* m_sock;
39 Belle2::RFFlowStat* m_flow;
40 char* m_evtbuf;
41 int* m_buf;
42
43};
44
Class to manage a Ring Buffer placed in an IPC shared memory.
Definition RingBuffer.h:39
int ReceiveEvent(void)
Event function.
RawRevSock2Rb(const RawRevSock2Rb &)=delete
Copy constructor (disabled).
RawRevSock2Rb & operator=(const RawRevSock2Rb &)=delete
Operator = (disabled).
int Reconnect(int ntry)
Reconnect.
RawRevSock2Rb(const std::string &rbuf, const std::string &src, int port, std::string shmname, int id)
Constuctor and Destructor.