Belle II Software  release-08-01-10
RFSharedMem.cc
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 
9 #include "daq/rfarm/manager/RFSharedMem.h"
10 
11 #include <strings.h>
12 
13 using namespace std;
14 using namespace Belle2;
15 
16 RFSharedMem::RFSharedMem(const char* name) : SharedMem(name, sizeof(RfShm_Data))
17 {
18  RfShm_Data* rfshm = (RfShm_Data*) ptr();
19  if (SharedMem::IsCreated()) {
20  bzero((char*)rfshm, sizeof(RfShm_Data));
21  for (int i = 0; i < RFSHM_MAX_PROCESS; i++) {
22  (rfshm->cell[i]).pid = 0;
23  (rfshm->cell[i]).type = 0;
24  (rfshm->cell[i]).command = -1;
25  }
26  }
27 }
28 
29 RFSharedMem::~RFSharedMem()
30 {
31 }
32 
33 RfShm_Cell& RFSharedMem::GetCell(int id)
34 {
35  RfShm_Data* rfshm = (RfShm_Data*) ptr();
36  return rfshm->cell[id];
37 }
38 
Abstract base class for different kinds of events.