Project
Loading...
Searching...
No Matches
GPUROOTDumpCore.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef GPUROOTDUMPCORE_H
16#define GPUROOTDUMPCORE_H
17
18#include "GPUCommonDef.h"
19#include <memory>
20#include <vector>
21
22class TFile;
23
24namespace o2::gpu
25{
26class GPUROOTDumpCore;
27
29{
30 public:
31 virtual void write() = 0;
32
33 protected:
35 std::weak_ptr<GPUROOTDumpCore> mCore;
36};
37
39{
40#if !defined(GPUCA_NO_ROOT) && !defined(GPUCA_GPUCODE)
41 friend class GPUReconstruction;
42 friend class GPUROOTDumpBase;
43
44 private:
45 struct GPUROOTDumpCorePrivate {
46 };
47
48 public:
51 GPUROOTDumpCore(GPUROOTDumpCorePrivate); // Cannot be declared private directly since used with new
53
54 private:
55 static std::shared_ptr<GPUROOTDumpCore> getAndCreate();
56 static std::weak_ptr<GPUROOTDumpCore> get() { return sInstance; }
57 static std::weak_ptr<GPUROOTDumpCore> sInstance;
58 std::unique_ptr<TFile> mFile;
59 std::vector<GPUROOTDumpBase*> mBranches;
60#endif
61};
62} // namespace o2::gpu
63
64#endif
std::weak_ptr< GPUROOTDumpCore > mCore
virtual void write()=0
GPUROOTDumpCore operator=(const GPUROOTDumpCore &)=delete
GPUROOTDumpCore(const GPUROOTDumpCore &)=delete