Belle II Software  release-08-01-10
RFSharedMem.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 RFSHAREDMEM_H
9 #define RFSHAREDMEM_H
10 
11 #define RFSHM_MAX_PROCESS 100
12 #define RFSHM_TYPE_SOCK2RB 1
13 #define RFSHM_TYPE_RB2SOCK 2
14 #define RFSHM_TYPE_STORE 3
15 #define RFSHM_TYPE_BASF2 4
16 #define RFSHM_TYPE_UNUSABLE -1
17 
18 #include "SharedMem.h"
19 
20 namespace Belle2 {
26  // Cell to exchange information of client and server
27  struct RfShm_Cell {
28  pid_t pid;
29  int type;
30  int command;
31  int par[2];
32  int retval;
33  int status;
34  int nevent;
35  int nqueue;
36  float flowrate;
37  float avesize;
38  float evtrate;
39  int elapsed;
40 
41  };
42 
43  // A collection of cells to be placed on a shared memory
44  struct RfShm_Data {
45  int ncell;
46  char nodename[16];
47  RfShm_Cell cell[RFSHM_MAX_PROCESS];
48  };
49 
50  // A class to manage cells
51  class RFSharedMem : public SharedMem {
52  public:
53  RFSharedMem(const char* name);
54  ~RFSharedMem();
55 
56  RfShm_Cell& GetCell(int id);
57  };
59 }
60 #endif
Abstract base class for different kinds of events.