Belle II Software  release-08-01-10
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 
21 namespace Belle2 {
27  class RFFlowStat {
28  public:
29  RFFlowStat(const char* shmname, int id, RingBuffer* rbuf); // Constructor for fillter
30  RFFlowStat(const char* shmname); // Constructor for retriever
31  ~RFFlowStat();
32 
33  // functions for filler
34  void log(int size);
35 
36  void clear(int id);
37 
38  // functions for retriever
39  RfShm_Cell& getinfo(int id);
40  void fillNodeInfo(int id, RfNodeInfo* info, bool inout);
41  void fillProcessStatus(RfNodeInfo* info, int pid_input = 0, int pid_output = 0,
42  int pid_basf2 = 0, int pid_hserver = 0, int pid_hrelay = 0);
43 
44  private:
45  RFSharedMem* m_rfshm;
46  RfShm_Cell* m_cell;
47  RingBuffer* m_rbuf;
48  float m_flowsize;
49  int m_nevtint;
50  int m_interval;
51  struct timeval m_t0;
52 
53  };
55 }
56 #endif
Class to manage a Ring Buffer placed in an IPC shared memory.
Definition: RingBuffer.h:39
Abstract base class for different kinds of events.