Belle II Software  release-05-02-19
RFSharedMem.h
1 #ifndef RFSHAREDMEM_H
2 #define RFSHAREDMEM_H
3 //+
4 // File : RFSharedMem.h
5 // Description : Shared Memory manager for RFARM node control
6 //
7 // Author : Ryosuke Itoh, IPNS, KEK
8 // Date : 20 - June - 2013
9 //-
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
Belle2::RFSharedMem
Definition: RFSharedMem.h:51
Belle2::RfShm_Cell
Definition: RFSharedMem.h:27
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RfShm_Data
Definition: RFSharedMem.h:44
Belle2::SharedMem
Definition: SharedMem.h:20