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
CommonParsers.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
\***********************************************************************************/
11
#pragma once
12
// ============================================================================
13
// Include files
14
// ============================================================================
15
// STD & STL
16
// ============================================================================
17
#include <list>
18
#include <map>
19
#include <set>
20
#include <string>
21
#include <vector>
22
23
// ============================================================================
24
#include "
GaudiKernel/HistoDef.h
"
25
#include "
GaudiKernel/Map.h
"
26
#include "
GaudiKernel/StatusCode.h
"
27
// ============================================================================
28
#define PARSERS_DECL_FOR_SINGLE( Type ) GAUDI_API StatusCode parse( Type& result, const std::string& input );
29
30
#define PARSERS_DECL_FOR_PAIR( FirstType, SecondType ) \
31
GAUDI_API StatusCode parse( std::pair<FirstType, SecondType>& result, const std::string& input );
32
33
#define PARSERS_DECL_FOR_LIST( InnerType ) \
34
GAUDI_API StatusCode parse( std::vector<InnerType>& result, const std::string& input );
35
// ============================================================================
67
// ============================================================================
68
namespace
Gaudi
{
69
// ==========================================================================
70
class
Histo1DDef;
71
// ==========================================================================
72
namespace
Parsers {
73
// ========================================================================
84
PARSERS_DECL_FOR_SINGLE
(
bool
)
85
// ========================================================================
97
PARSERS_DECL_FOR_SINGLE
(
char
)
99
PARSERS_DECL_FOR_SINGLE
(
unsigned
char
)
101
PARSERS_DECL_FOR_SINGLE
(
signed
char
)
102
// ========================================================================
114
PARSERS_DECL_FOR_SINGLE
(
int
)
116
PARSERS_DECL_FOR_SINGLE
(
short
)
118
PARSERS_DECL_FOR_SINGLE
(
unsigned
short
)
120
PARSERS_DECL_FOR_SINGLE
(
unsigned
int
)
122
PARSERS_DECL_FOR_SINGLE
(
long
)
124
PARSERS_DECL_FOR_SINGLE
(
unsigned
long
)
126
PARSERS_DECL_FOR_SINGLE
(
long
long
)
128
PARSERS_DECL_FOR_SINGLE
(
unsigned
long
long
)
129
// ========================================================================
141
PARSERS_DECL_FOR_SINGLE
(
double
)
143
PARSERS_DECL_FOR_SINGLE
(
float
)
145
PARSERS_DECL_FOR_SINGLE
(
long
double
)
146
// ========================================================================
158
PARSERS_DECL_FOR_SINGLE
(
std::string
)
159
// ========================================================================
160
161
PARSERS_DECL_FOR_LIST
(
bool
)
162
PARSERS_DECL_FOR_LIST
(
char
)
163
PARSERS_DECL_FOR_LIST
(
unsigned
char
)
164
PARSERS_DECL_FOR_LIST
(
signed
char
)
165
166
PARSERS_DECL_FOR_LIST
(
int
)
167
PARSERS_DECL_FOR_LIST
(
short
)
168
PARSERS_DECL_FOR_LIST
(
unsigned
short
)
169
PARSERS_DECL_FOR_LIST
(
unsigned
int
)
170
PARSERS_DECL_FOR_LIST
(
long
)
171
PARSERS_DECL_FOR_LIST
(
unsigned
long
)
172
PARSERS_DECL_FOR_LIST
(
long
long
)
173
PARSERS_DECL_FOR_LIST
(
unsigned
long
long
)
174
175
PARSERS_DECL_FOR_LIST
(
double
)
176
PARSERS_DECL_FOR_LIST
(
float
)
177
PARSERS_DECL_FOR_LIST
(
long
double
)
178
179
PARSERS_DECL_FOR_LIST
(
std::string
)
180
// ========================================================================
181
// Advanced parses
182
// ========================================================================
195
PARSERS_DECL_FOR_PAIR
(
double
,
double
)
196
// ========================================================================
209
PARSERS_DECL_FOR_PAIR
(
int
,
int
)
210
// ========================================================================
224
GAUDI_API
StatusCode
parse
(
std::vector
<
std::pair<double, double>
>& result,
const
std::string
& input );
225
// ========================================================================
239
GAUDI_API
StatusCode
parse
(
std::vector
<
std::pair<int, int>
>& result,
const
std::string
& input );
240
// ========================================================================
241
// vector< vector< TYPE > >
242
// ========================================================================
255
GAUDI_API
StatusCode
parse
(
std::vector
<
std::vector<std::string>
>& result,
const
std::string
& input );
256
// ========================================================================
269
GAUDI_API
StatusCode
parse
(
std::vector
<
std::vector<double>
>& result,
const
std::string
& input );
270
// ========================================================================
271
// map< TYPE, TYPE >
272
// ========================================================================
285
GAUDI_API
StatusCode
parse
(
std::map<int, int>
& result,
const
std::string
& input );
286
// ========================================================================
300
GAUDI_API
StatusCode
parse
(
std::map<int, double>
& result,
const
std::string
& input );
301
// ========================================================================
314
GAUDI_API
StatusCode
parse
(
std::map<std::string, std::string>
& result,
const
std::string
& input );
315
GAUDI_API
StatusCode
parse
(
std::map
<
std::string
,
std::string
,
std::less<>
>& result,
const
std::string
& input );
316
// ========================================================================
330
GAUDI_API
StatusCode
parse
(
std::map<std::string, int>
& result,
const
std::string
& input );
331
// ========================================================================
345
GAUDI_API
StatusCode
parse
(
std::map<std::string, double>
& result,
const
std::string
& input );
346
// ========================================================================
362
GAUDI_API
StatusCode
parse
(
std::map
<
std::string
,
std::vector<std::string>
>& result,
const
std::string
& input );
363
// ========================================================================
379
GAUDI_API
StatusCode
parse
(
std::map
<
std::string
,
std::vector<int>
>& result,
const
std::string
& input );
380
// ========================================================================
396
GAUDI_API
StatusCode
parse
(
std::map
<
std::string
,
std::vector<double>
>& result,
const
std::string
& input );
397
// ========================================================================
405
GAUDI_API
StatusCode
parse
(
std::map<int, std::string>
& result,
const
std::string
& input );
406
// ========================================================================
414
GAUDI_API
StatusCode
parse
(
std::map<unsigned int, std::string>
& result,
const
std::string
& input );
415
// ========================================================================
420
GAUDI_API
StatusCode
parse
(
std::map<std::string, unsigned int>
& result,
const
std::string
& input );
421
// ========================================================================
426
template
<
typename
K,
typename
V,
typename
M>
427
GAUDI_API
StatusCode
parse
(
GaudiUtils::Map<K, V, M>
& result,
const
std::string
& input ) {
428
return
parse
( (M&)result, input );
429
}
430
// ========================================================================
457
GAUDI_API
StatusCode
parse
(
std::string
&
name
,
std::string
& value,
const
std::string
& input );
458
// ========================================================================
467
GAUDI_API
StatusCode
parse
(
Gaudi::Histo1DDef
& histo,
const
std::string
& input );
468
// ========================================================================
477
GAUDI_API
StatusCode
parse
(
std::map<std::string, Gaudi::Histo1DDef>
&
histos
,
const
std::string
& input );
478
// ========================================================================
490
GAUDI_API
StatusCode
parse
(
std::map
<
std::string
,
std::pair<double, double>
>& params,
const
std::string
& input );
491
// ========================================================================
499
template
<
class
T,
unsigned
int
N>
500
StatusCode
parse
( T ( &result )[
N
],
const
std::string
& input ) {
501
typedef
std::vector<T>
_Vct;
502
// create the temporary vector
503
_Vct tmp;
504
StatusCode
sc =
parse
( tmp, input );
505
if
( sc.
isFailure
() ) {
return
sc; }
// RETURN
506
if
(
N
!= tmp.size() ) {
return
StatusCode::FAILURE
; }
// RETURN
507
//
508
std::copy
( tmp.begin(), tmp.end(), result );
509
//
510
return
StatusCode::SUCCESS
;
// RETURN
511
}
512
// ========================================================================
520
template
<
unsigned
int
N>
521
StatusCode
parse
(
char
( &result )[
N
],
const
std::string
& input ) {
522
// clear the string
523
std::fill_n
( result,
N
,
' '
);
524
// create the temporary string
525
std::string
tmp;
526
StatusCode
sc =
parse
( tmp, input );
527
if
( sc.
isFailure
() ) {
return
sc; }
// RETURN
528
if
(
N
== tmp.
size
() ) {
529
std::copy
( tmp.
begin
(), tmp.
end
(), result );
530
}
else
if
(
N
+ 2 == tmp.
size
() && (
'\''
== tmp[0] ||
'\"'
== tmp[0] ) && ( tmp[0] == tmp[tmp.
size
() - 1] ) ) {
531
std::copy
( tmp.
begin
() + 1, tmp.
end
() - 1, result );
532
}
else
{
533
return
StatusCode::FAILURE
;
534
}
535
//
536
return
StatusCode::SUCCESS
;
// RETURN
537
}
538
// ========================================================================
539
}
// namespace Parsers
540
// ==========================================================================
541
}
// end of namespace Gaudi
PARSERS_DECL_FOR_LIST
#define PARSERS_DECL_FOR_LIST(InnerType)
Definition:
CommonParsers.h:33
std::string
STL class.
IOTest.N
N
Definition:
IOTest.py:110
bug_34121.name
name
Definition:
bug_34121.py:20
std::pair< double, double >
std::vector
STL class.
std::string::size
T size(T... args)
std::less
StatusCode.h
PARSERS_DECL_FOR_SINGLE
#define PARSERS_DECL_FOR_SINGLE(Type)
Definition:
CommonParsers.h:28
HistoDef.h
Gaudi::Histo1DDef
Definition:
HistoDef.h:41
StatusCode
Definition:
StatusCode.h:65
GaudiUtils::Map
Definition:
Map.h:91
std::copy
T copy(T... args)
std::map< int, int >
Gaudi
Header file for std:chrono::duration-based Counters.
Definition:
__init__.py:1
StatusCode::isFailure
bool isFailure() const
Definition:
StatusCode.h:129
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition:
StatusCode.h:100
compareRootHistos.histos
histos
Definition:
compareRootHistos.py:26
std::string::begin
T begin(T... args)
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition:
DODBasicMapper.cpp:21
PARSERS_DECL_FOR_PAIR
#define PARSERS_DECL_FOR_PAIR(FirstType, SecondType)
Definition:
CommonParsers.h:30
std::string::end
T end(T... args)
Map.h
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition:
StatusCode.h:101
std::fill_n
T fill_n(T... args)
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:81
GaudiKernel
include
Gaudi
Parsers
CommonParsers.h
Generated on Thu Jan 25 2024 17:52:21 for The Gaudi Framework by
1.8.18