Belle II Software development
MergeableNamed.h
1#pragma once
2/**************************************************************************
3 * basf2 (Belle II Analysis Software Framework) *
4 * Author: The Belle II Collaboration *
5 * *
6 * See git log for contributors and copyright holders. *
7 * This file is licensed under LGPL-3.0, see LICENSE.md. *
8 **************************************************************************/
9
10#include <TNamed.h>
11
12class TCollection;
13class TDirectory;
14
15namespace Belle2 {
29 class MergeableNamed : public TNamed {
30 public:
31 MergeableNamed() : TNamed() { }
32 virtual ~MergeableNamed() { }
33
41 virtual void merge(const MergeableNamed* other) = 0;
42
44 virtual void clear() = 0;
45
46 // Make a new
47// virtual TObject* clone() const = 0;
48
50 virtual Long64_t Merge(TCollection* hlist);
52 virtual void Reset() {clear();}
54// virtual TObject* Clone(const char* newname = "") const {clone();}
56 virtual void SetDirectory(TDirectory*) {}
57 private:
59 };
61}
Abstract base class for objects that can be merged but also named.
virtual void SetDirectory(TDirectory *)
Root-like Clone function for "template compatibility" with ROOT objects.
virtual Long64_t Merge(TCollection *hlist)
Allow merging using TFileMerger if saved directly to a file.
virtual void Reset()
Root-like Reset function for "template compatibility" with ROOT objects.
virtual void clear()=0
Clear content of this object (e.g. set to zeroes). Called by the Reset() function.
ClassDef(MergeableNamed, 0)
Abstract base class for objects that can be merged and named.
virtual void merge(const MergeableNamed *other)=0
Merge object 'other' into this one.
Abstract base class for different kinds of events.