Belle II Software  release-06-02-00
DqmMemFile.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 DQM_MEMFILE
9 #define DQM_MEMFILE
10 
11 #include <string>
12 
13 #include <daq/rfarm/manager/SharedMem.h>
14 #include <framework/pcore/EvtMessage.h>
15 
16 #include "TMemFile.h"
17 #include "TDirectory.h"
18 
19 #define MEMFILESIZE 128000000
20 
21 namespace Belle2 {
26  class MsgHandler;
27 
28  class DqmMemFile {
29  public:
30  DqmMemFile(std::string name = "dqmhisto",
31  std::string mode = "readonly", int size = MEMFILESIZE);
32  DqmMemFile(int shm_id, int sem_id,
33  std::string mode = "readonly", int size = MEMFILESIZE);
34  ~DqmMemFile();
35 
36  // Sender function
37  TMemFile* GetMemFile();
38  int UpdateSharedMem();
39  int ClearSharedMem();
40  TMemFile* LoadMemFile();
41 
42  // Receiver functions
43  EvtMessage* StreamMemFile();
44 
45  private:
46  int StreamHistograms(TDirectory* curdir, MsgHandler* msg, int& nobjs);
47 
48  private:
49  SharedMem* m_shm;
50  TMemFile* m_memfile;
51  char* m_buf;
52  std::string m_name;
53  int m_size;
54  int m_mode;
55  };
57 }
58 #endif
59 
Class to manage streamed object.
Definition: EvtMessage.h:59
A class to encode/decode an EvtMessage.
Definition: MsgHandler.h:103
Abstract base class for different kinds of events.