Project
Loading...
Searching...
No Matches
CustomMergeableObject.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef ALICEO2_MERGEINTERFACEOVERRIDEEXAMPLE_H
13#define ALICEO2_MERGEINTERFACEOVERRIDEEXAMPLE_H
14
19
21
22namespace o2::mergers
23{
24
26{
27 public:
28 CustomMergeableObject(int secret = 9000) : MergeInterface(), mSecret(secret) {}
29 ~CustomMergeableObject() override = default;
30
31 void merge(MergeInterface* const other) override
32 {
33 mSecret += dynamic_cast<const CustomMergeableObject* const>(other)->getSecret();
34 }
35
36 int getSecret() const { return mSecret; }
37
39 {
40 return new CustomMergeableObject{mSecret};
41 }
42
43 private:
44 int mSecret = 0;
45
46 ClassDefOverride(CustomMergeableObject, 1);
47};
48
49} // namespace o2::mergers
50
51#endif //ALICEO2_MERGEINTERFACEOVERRIDEEXAMPLE_H
Definition of O2 Mergers merging interface, v0.1.
~CustomMergeableObject() override=default
MergeInterface * cloneMovingWindow() const override
Should return an object subset which is supposed to take part in generating moving windows.
void merge(MergeInterface *const other) override
Custom merge method.
An interface which allows to merge custom objects.
VectorOfTObjectPtrs other