Belle II Software development
|
Wrap an STL set to make it mergeable. More...
#include <SetMergeable.h>
Public Member Functions | |
template<class ... Args> | |
SetMergeable (Args &&... params) | |
Constructor, forwards all arguments to T constructor. | |
T & | get () |
Get the wrapped standard object. | |
const T & | get () const |
Get the wrapped standard object. | |
virtual void | merge (const Mergeable *other) override |
Merge object 'other' into this one. | |
virtual void | clear () override |
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 | |
ClassDefOverride (SetMergeable, 1) | |
Wrap an STL set to make it mergeable. | |
ClassDef (Mergeable, 0) | |
Abstract base class for objects that can be merged. | |
Private Attributes | |
T | m_wrapped |
Wrapped object. | |
Wrap an STL set to make it mergeable.
Should work out-of-the-box with std::set and 'similar' containers.
To use it to save data in your module:
create SetMergeable<X> in initalize (or in your constructor) of durability DataStore::c_Persistent, register it by calling registerInDataStore() and construct() the actual container.
Each template instance needs its own entry in framework/pcore/include/linkdef.h, please contact the framework librarian if your use case requires other classes than those in there.
Definition at line 35 of file SetMergeable.h.
|
inline |
Definition at line 37 of file SetMergeable.h.
|
inlinevirtual |
Definition at line 39 of file SetMergeable.h.
|
inlineexplicit |
Constructor, forwards all arguments to T constructor.
Definition at line 41 of file SetMergeable.h.
|
inlineoverridevirtual |
Clear content of this object (e.g.
set to zeroes).
Called after sending the objects to another process. If no clearing is performed, the same data (e.g. histogram entries) might be added again and again in each event.
Implements Mergeable.
Definition at line 72 of file SetMergeable.h.
|
inline |
|
inline |
|
inlineoverridevirtual |
Merge object 'other' into this one.
Your derived class should 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.
Implements Mergeable.
Definition at line 56 of file SetMergeable.h.
|
virtualinherited |
Allow merging using TFileMerger if saved directly to a file.
Definition at line 14 of file Mergeable.cc.
|
inlinevirtualinherited |
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.
|
inlinevirtualinherited |
Root-like Reset function for "template compatibility" with ROOT objects.
Alias for clear().
Definition at line 66 of file Mergeable.h.
|
inlinevirtualinherited |
Root-like SetDirectory function for "template compatibility" with ROOT objects.
Does nothing.
Definition at line 68 of file Mergeable.h.
|
private |
Wrapped object.
Definition at line 79 of file SetMergeable.h.