Project
Loading...
Searching...
No Matches
Mergeable.h
Go to the documentation of this file.
1// Copyright 2019-2024 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
12#ifndef ALICEO2_MERGERS_H
13#define ALICEO2_MERGERS_H
14
19
20#include <concepts>
21
22class TObject;
23class TH1;
24class TCollection;
25class TObjArray;
26class TH1;
27class TTree;
28class THnBase;
29class TEfficiency;
30class TGraph;
31class TCanvas;
32
33namespace o2::mergers
34{
35
36class MergeInterface;
37
38template <typename T, typename... Ts>
39constexpr bool IsDerivedFrom = (std::derived_from<T, Ts> || ...);
40
41// \brief Concept to be used to test if some parameter is mergeable
42//
43// \parameter T type to be restricted
44template <typename T>
45concept Mergeable = IsDerivedFrom<std::remove_pointer_t<T>, mergers::MergeInterface, TCollection, TH1, TTree, TGraph, TEfficiency, THnBase, TCanvas>;
46
47// \brief runtime check whether TObject is mergeable
48bool isMergeable(TObject* obj);
49
50} // namespace o2::mergers
51
52#endif
bool isMergeable(TObject *obj)
Definition Mergeable.cxx:26
constexpr bool IsDerivedFrom
Definition Mergeable.h:39