Belle II Software  release-08-01-10
Mergeable.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 
9 #pragma once
10 
11 #include <TObject.h>
12 
13 class TCollection;
14 class TDirectory;
15 
16 namespace Belle2 {
31  class Mergeable : public TObject {
32  public:
33  Mergeable() { }
34  virtual ~Mergeable() { }
35 
43  virtual void merge(const Mergeable* other) = 0;
44 
51  virtual void clear() = 0;
52 
58  virtual void removeSideEffects() {}
59 
64  virtual Long64_t Merge(TCollection* hlist);
66  virtual void Reset() {clear();}
68  virtual void SetDirectory(TDirectory*) {}
69  private:
71  };
73 }
Abstract base class for objects that can be merged.
Definition: Mergeable.h:31
virtual void SetDirectory(TDirectory *)
Root-like SetDirectory function for "template compatibility" with ROOT objects.
Definition: Mergeable.h:68
ClassDef(Mergeable, 0)
Abstract base class for objects that can be merged.
virtual Long64_t Merge(TCollection *hlist)
Allow merging using TFileMerger if saved directly to a file.
Definition: Mergeable.cc:14
virtual void merge(const Mergeable *other)=0
Merge object 'other' into this one.
virtual void Reset()
Root-like Reset function for "template compatibility" with ROOT objects.
Definition: Mergeable.h:66
virtual void clear()=0
Clear content of this object (e.g.
virtual void removeSideEffects()
An ugly little method that is called before event() for input and worker processes.
Definition: Mergeable.h:58
Abstract base class for different kinds of events.