Belle II Software  release-05-01-25
MergeableNamed.h
1 #pragma once
2 /**************************************************************************
3  * BASF2 (Belle Analysis Framework 2) *
4  * Copyright(C) 2017 - Belle II Collaboration *
5  * *
6  * Author: The Belle II Collaboration *
7  * Contributors: David Dossett *
8  * Christian Pulvermacher *
9  * *
10  * This software is provided "as is" without any warranty. *
11  **************************************************************************/
12 
13 #include <TNamed.h>
14 
15 class TCollection;
16 class TDirectory;
17 
18 namespace Belle2 {
32  class MergeableNamed : public TNamed {
33  public:
34  MergeableNamed() : TNamed() { }
35  virtual ~MergeableNamed() { }
36 
44  virtual void merge(const MergeableNamed* other) = 0;
45 
47  virtual void clear() = 0;
48 
49  // Make a new
50 // virtual TObject* clone() const = 0;
51 
53  virtual Long64_t Merge(TCollection* hlist);
55  virtual void Reset() {clear();}
57 // virtual TObject* Clone(const char* newname = "") const {clone();}
59  virtual void SetDirectory(TDirectory*) {}
60  private:
62  };
64 }
Belle2::MergeableNamed
Abstract base class for objects that can be merged but also named.
Definition: MergeableNamed.h:32
Belle2::MergeableNamed::Merge
virtual Long64_t Merge(TCollection *hlist)
Allow merging using TFileMerger if saved directly to a file.
Definition: MergeableNamed.cc:7
Belle2::MergeableNamed::merge
virtual void merge(const MergeableNamed *other)=0
Merge object 'other' into this one.
Belle2::MergeableNamed::clear
virtual void clear()=0
Clear content of this object (e.g. set to zeroes). Called by the Reset() function.
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::MergeableNamed::Reset
virtual void Reset()
Root-like Reset function for "template compatibility" with ROOT objects.
Definition: MergeableNamed.h:55
Belle2::MergeableNamed::SetDirectory
virtual void SetDirectory(TDirectory *)
Root-like Clone function for "template compatibility" with ROOT objects.
Definition: MergeableNamed.h:59
Belle2::MergeableNamed::ClassDef
ClassDef(MergeableNamed, 0)
Abstract base class for objects that can be merged and named.