Belle II Software light-2406-ragdoll
|
Abstract base class for objects that can be merged. More...
#include <Mergeable.h>
Public Member Functions | |
virtual void | merge (const Mergeable *other)=0 |
Merge object 'other' into this one. | |
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. | |
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 | SetDirectory (TDirectory *) |
Root-like SetDirectory function for "template compatibility" with ROOT objects. | |
Private Member Functions | |
ClassDef (Mergeable, 0) | |
Abstract base class for objects that can be merged. | |
Abstract base class for objects that can be merged.
This is mainly intended for objects of c_Persistent durability in the data store, where those inheriting from this class will be merged when using parallel processing.
For storing TH1F, TNtuple and similar things, see RootMergeable<T>. For STL maps, see MapMergeable<T>.
The special handling for these objects is performed in DataStoreStreamer.
Definition at line 31 of file Mergeable.h.
|
inline |
Definition at line 33 of file Mergeable.h.
|
inlinevirtual |
Definition at line 34 of file Mergeable.h.
|
pure virtual |
Clear content of this object (e.g.
set to zeroes).
Called after sending the objects to another process and after forking processes to ensure there is at most one copy of the same data. If no clearing is performed, the same data (e.g. histogram entries) might be added again and again in each event.
Implemented in MapMergeable< T >, ProcessStatistics, BackgroundInfo, BackgroundMetaData, RootMergeable< T >, and SetMergeable< T >.
|
pure virtual |
Merge object 'other' into this one.
Your derived class must implement this function. You can static_cast 'other' to your own type (when called, this and other are guaranteed to point to objects of the same type).
Note that 'other' will be deleted after the merge, so make sure you copy all data from it that you will need.
Implemented in MapMergeable< T >, ProcessStatistics, BackgroundInfo, BackgroundMetaData, RootMergeable< T >, and SetMergeable< T >.
|
virtual |
Allow merging using TFileMerger if saved directly to a file.
Definition at line 14 of file Mergeable.cc.
|
inlinevirtual |
An ugly little method that is called before event() for input and worker processes.
Main use case is to detach any attached TFile from this object. In the output process, it can stay attached (and grow as much as it likes).
Reimplemented in RootMergeable< T >.
Definition at line 58 of file Mergeable.h.
|
inlinevirtual |
Root-like Reset function for "template compatibility" with ROOT objects.
Alias for clear().
Definition at line 66 of file Mergeable.h.
|
inlinevirtual |
Root-like SetDirectory function for "template compatibility" with ROOT objects.
Does nothing.
Definition at line 68 of file Mergeable.h.