Belle II Software development
RFFlowStat.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#ifndef FLOWSTAT_H
9#define FLOWSTAT_H
10
11#include <sys/time.h>
12
13#include "framework/pcore/RingBuffer.h"
14#include "daq/rfarm/manager/RFSharedMem.h"
15#include "daq/rfarm/manager/RfNodeInfo.h"
16
17#define RF_INPUT_ID 51
18#define RF_OUTPUT_ID 52
19#define RF_ROI_ID 53
20
21namespace Belle2 {
26
27 class RFFlowStat {
28 public:
29 RFFlowStat(const char* shmname, int id, RingBuffer* rbuf); // Constructor for fillter
30 explicit RFFlowStat(const char* shmname); // Constructor for retriever
31 ~RFFlowStat();
33 RFFlowStat(const RFFlowStat&) = delete;
34
36 RFFlowStat& operator=(const RFFlowStat&) = delete;
37
38 // functions for filler
39 void log(int size);
40
41 void clear(int id);
42
43 // functions for retriever
44 RfShm_Cell& getinfo(int id);
45 void fillNodeInfo(int id, RfNodeInfo* info, bool inout);
46 static void fillProcessStatus(RfNodeInfo* info, int pid_input = 0, int pid_output = 0,
47 int pid_basf2 = 0, int pid_hserver = 0, int pid_hrelay = 0);
48
49 private:
50 RFSharedMem* m_rfshm;
51 RfShm_Cell* m_cell = nullptr;
52 RingBuffer* m_rbuf = nullptr;
53 float m_flowsize = 0.0;
54 int m_nevtint = 0;
55 int m_interval = 0;
56 struct timeval m_t0;
57
58 };
59
60}
61#endif
RFFlowStat(const RFFlowStat &)=delete
Copy constructor (disabled).
RFFlowStat & operator=(const RFFlowStat &)=delete
Operator = (disabled).
Class to manage a Ring Buffer placed in an IPC shared memory.
Definition RingBuffer.h:39
Abstract base class for different kinds of events.