Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
v38r0 (2143aa4c)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace 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
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
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
Typedefs
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Classes
Class List
Class Index
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
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
Enumerations
a
c
d
e
f
i
l
m
n
o
p
q
r
s
t
v
Enumerator
a
b
c
d
e
f
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Properties
Related Functions
:
a
b
c
d
e
g
h
i
m
o
p
r
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
_
b
c
e
f
g
h
i
l
m
n
o
p
r
s
t
u
z
Variables
a
b
c
d
e
g
h
i
m
o
p
r
s
t
v
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Enumerations
Enumerator
c
e
f
p
u
v
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
SerializeSTL.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
22
#ifndef GAUDIKERNEL_SERIALIZESTL_H_
23
#define GAUDIKERNEL_SERIALIZESTL_H_
24
25
#include "
GaudiKernel/HashMap.h
"
26
#include "
GaudiKernel/Map.h
"
27
#include <array>
28
#include <list>
29
#include <map>
30
#include <ostream>
31
#include <utility>
32
#include <vector>
33
34
namespace
GaudiUtils
{
36
template
<
class
T1,
class
T2>
37
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
std::pair<T1, T2>
& p );
38
40
template
<
class
T,
class
ALLOC>
41
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
std::vector<T, ALLOC>
&
v
);
42
44
template
<
class
T, std::
size_t
N>
45
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
std::array<T, N>
&
v
);
46
48
template
<
class
T,
class
ALLOC>
49
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
std::list<T, ALLOC>
&
l
);
50
52
template
<
class
T1,
class
T2,
class
COMP,
class
ALLOC>
53
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
std::map<T1, T2, COMP, ALLOC>
&
m
);
54
56
template
<
class
K,
class
T,
class
M>
57
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
GaudiUtils::Map<K, T, M>
&
m
);
58
60
template
<
class
K,
class
T,
class
H,
class
M>
61
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
GaudiUtils::HashMap<K, T, H, M>
&
m
);
62
63
namespace
details
{
64
65
struct
IdentityOutputter
{
66
template
<
typename
T>
67
std::ostream
&
operator()
(
std::ostream
& os, T&&
t
)
const
{
68
return
os << std::forward<T>(
t
);
69
}
70
};
71
72
template
<
typename
Stream,
typename
Iterator,
typename
Separator,
typename
OutputElement = IdentityOutputter>
73
Stream&
ostream_joiner
( Stream& os,
Iterator
first,
Iterator
last, Separator sep,
74
OutputElement
output
= OutputElement{} ) {
75
if
( first != last )
output
( os, *first++ );
76
while
( first != last )
output
( os << sep, *first++ );
77
return
os;
78
}
79
80
template
<
typename
Stream,
typename
Container,
typename
Separator,
typename
OutputElement = IdentityOutputter>
81
Stream&
ostream_joiner
( Stream& os,
const
Container&
c
, Separator sep, OutputElement
output
= OutputElement{} ) {
82
using
std::begin
,
std::end
;
83
return
ostream_joiner
( os,
begin
(
c
),
end
(
c
), sep,
output
);
84
}
85
}
// namespace details
86
87
template
<
class
T1,
class
T2>
88
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
std::pair<T1, T2>
& p ) {
89
return
s
<<
'('
<< p.first <<
", "
<< p.second <<
')'
;
90
}
91
92
template
<
class
T,
class
ALLOC>
93
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
std::vector<T, ALLOC>
&
v
) {
94
return
details::ostream_joiner
(
s
<<
'['
,
v
,
", "
) <<
']'
;
95
}
96
97
template
<
class
T, std::
size_t
N>
98
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
std::array<T, N>
&
v
) {
99
return
details::ostream_joiner
(
s
<<
'['
,
v
,
", "
) <<
']'
;
100
}
101
102
template
<
class
T,
class
ALLOC>
103
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
std::list<T, ALLOC>
&
l
) {
104
return
details::ostream_joiner
(
s
<<
'['
,
l
,
", "
) <<
']'
;
105
}
106
107
template
<
class
T1,
class
T2,
class
COMP,
class
ALLOC>
108
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
std::map<T1, T2, COMP, ALLOC>
&
m
) {
109
return
details::ostream_joiner
(
s
<<
"{"
,
m
,
", "
,
110
[](
std::ostream
& os,
const
std::pair<const T1, T2>
& p ) ->
std::ostream
& {
111
return
os << p.first <<
": "
<< p.second;
112
} )
113
<<
"}"
;
114
}
115
116
template
<
class
K,
class
T,
class
M>
117
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
GaudiUtils::Map<K, T, M>
&
m
) {
118
// Serialize the internal map.
119
return
s << static_cast<const M&>(
m
);
120
}
121
124
template
<
class
K,
class
T,
class
H,
class
M>
125
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
GaudiUtils::HashMap<K, T, H, M>
&
m
) {
126
// Copy the hash map into a map to have it ordered by key.
127
return
s << GaudiUtils::Map<K, T>(
m
.begin(),
m
.end() );
128
}
129
130
}
// namespace GaudiUtils
131
132
#endif
/*GAUDIKERNEL_SERIALIZESTL_H_*/
std::list
STL class.
std::pair
gaudirun.s
string s
Definition:
gaudirun.py:346
std::vector
STL class.
gaudirun.c
c
Definition:
gaudirun.py:525
gaudirun.output
output
Definition:
gaudirun.py:521
HashMap.h
bug_34121.t
t
Definition:
bug_34121.py:30
GaudiUtils::details::IdentityOutputter::operator()
std::ostream & operator()(std::ostream &os, T &&t) const
Definition:
SerializeSTL.h:67
GaudiUtils::operator<<
std::ostream & operator<<(std::ostream &s, const std::pair< T1, T2 > &p)
Serialize an std::pair in a python like format. E.g. "(1, 2)".
Definition:
SerializeSTL.h:88
details
Definition:
AnyDataWrapper.h:18
Gaudi::Units::m
constexpr double m
Definition:
SystemOfUnits.h:108
std::ostream
STL class.
CLHEP::begin
double * begin(CLHEP::HepVector &v)
Definition:
TupleAlg.cpp:45
GaudiUtils::details::IdentityOutputter
Definition:
SerializeSTL.h:65
std::array
STL class.
GaudiUtils::Map
Definition:
Map.h:91
std::map
STL class.
gaudirun.l
dictionary l
Definition:
gaudirun.py:580
std::begin
T begin(T... args)
Properties.v
v
Definition:
Properties.py:122
std::end
T end(T... args)
Map.h
GaudiUtils::HashMap
Definition:
HashMap.h:83
IOTest.end
end
Definition:
IOTest.py:123
GaudiUtils
Definition:
GaudiHistoID.h:145
GaudiUtils::details::ostream_joiner
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition:
SerializeSTL.h:73
Iterator
boost::spirit::classic::position_iterator2< ForwardIterator > Iterator
Definition:
Iterator.h:28
GaudiKernel
include
GaudiKernel
SerializeSTL.h
Generated on Thu Jan 25 2024 17:52:22 for The Gaudi Framework by
1.8.18