Belle II Software development
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#pragma once
9
10#include <string>
11
12#include <daq/dqm/DqmSharedMem.h>
13#include <framework/pcore/EvtMessage.h>
14
15#include "TMemFile.h"
16#include "TDirectory.h"
17
18namespace Belle2 {
23 class MsgHandler;
24
25 class DqmMemFile {
26 public:
27 enum {c_memFileSize = 128000000};
28 public:
29 DqmMemFile(std::string name = "dqmhisto",
30 const std::string& mode = "readonly", int size = c_memFileSize);
31 DqmMemFile(int shm_id, int sem_id, int size = c_memFileSize);
33
34 // Sender function
35 TMemFile* GetMemFile();
36 int UpdateSharedMem();
37 int ClearSharedMem();
38 TMemFile* LoadMemFile();
39
40 // Receiver functions
41 EvtMessage* StreamMemFile();
42
43 bool SaveToFile(std::string outfile);
44
45 private:
46 int StreamHistograms(TDirectory* curdir, MsgHandler* msg, int& nobjs);
47
48 private:
49 DqmSharedMem* m_shm;
50 TMemFile* m_memfile;
51 char* m_buf;
52 std::string m_name;
53 int m_size;
54 bool m_writeMode;
55 };
57}
58
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.