Belle II Software light-2406-ragdoll
|
Wrap an STL map to make it mergeable. More...
#include <MapMergeable.h>
Public Member Functions | |
template<class ... Args> | |
MapMergeable (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) |
Merge object 'other' into this one. | |
virtual void | clear () |
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 (MapMergeable, 1) | |
Wrap an STL map to make it mergeable. | |
Private Attributes | |
T | m_wrapped |
Wrapped object. | |
Wrap an STL map to make it mergeable.
Should work out-of-the-box with std::map and 'similar' containers.
To use it to save data in your module:
create MapMergeable<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 34 of file MapMergeable.h.
|
inline |
Definition at line 36 of file MapMergeable.h.
|
inlinevirtual |
Definition at line 38 of file MapMergeable.h.
|
inlineexplicit |
Constructor, forwards all arguments to T constructor.
Definition at line 40 of file MapMergeable.h.
|
inlinevirtual |
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 73 of file MapMergeable.h.
|
inline |
|
inline |
|
inlinevirtual |
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 55 of file MapMergeable.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 80 of file MapMergeable.h.