Belle II Software
release-05-02-19
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
h
i
l
m
n
p
r
s
t
v
w
Enumerations
Enumerator
c
d
f
p
t
u
v
w
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
z
Related Functions
b
c
d
g
i
o
r
s
t
Files
File List
File Members
All
Functions
SetMergeable.h
1
#pragma once
2
/**************************************************************************
3
* BASF2 (Belle Analysis Framework 2) *
4
* Copyright(C) 2014 - Belle II Collaboration *
5
* *
6
* Author: The Belle II Collaboration *
7
* Contributors: Thomas Keck *
8
* *
9
* This software is provided "as is" without any warranty. *
10
**************************************************************************/
11
12
#include <framework/pcore/Mergeable.h>
13
14
namespace
Belle2
{
36
template
<
class
T>
class
SetMergeable :
public
Mergeable {
37
public
:
38
SetMergeable() :
m_wrapped
() { }
39
40
virtual
~SetMergeable() { }
42
template
<
class
...Args>
explicit
SetMergeable(Args&& ... params) :
m_wrapped
(std::forward<Args>(params)...) { }
43
45
T&
get
() {
return
m_wrapped
; }
46
48
const
T&
get
()
const
{
return
m_wrapped
; }
49
57
virtual
void
merge
(
const
Mergeable* other)
override
58
{
59
auto
* otherMergeable =
static_cast<
const
SetMergeable*
>
(other);
60
for
(
const
auto
& element : otherMergeable->get()) {
61
auto
it =
m_wrapped
.find(element);
62
if
(it ==
m_wrapped
.end()) {
63
m_wrapped
.insert(element);
64
}
65
}
66
}
67
73
virtual
void
clear
()
override
74
{
75
m_wrapped
.clear();
76
}
77
78
private
:
80
T
m_wrapped
;
81
82
ClassDefOverride
(
SetMergeable
, 1);
83
};
85
}
Belle2::SetMergeable
Wrap an STL set to make it mergeable.
Definition:
SetMergeable.h:44
Belle2::SetMergeable::merge
virtual void merge(const Mergeable *other) override
Merge object 'other' into this one.
Definition:
SetMergeable.h:65
Belle2::SetMergeable::get
T & get()
Get the wrapped standard object.
Definition:
SetMergeable.h:53
Belle2
Abstract base class for different kinds of events.
Definition:
MillepedeAlgorithm.h:19
Belle2::SetMergeable::ClassDefOverride
ClassDefOverride(SetMergeable, 1)
Wrap an STL set to make it mergeable.
Belle2::SetMergeable::clear
virtual void clear() override
Clear content of this object (e.g.
Definition:
SetMergeable.h:81
Belle2::SetMergeable::m_wrapped
T m_wrapped
Wrapped object.
Definition:
SetMergeable.h:88
framework
pcore
include
SetMergeable.h
Generated on Tue Jan 4 2022 02:57:00 for Belle II Software by
1.8.17