The Gaudi Framework
v36r1 (3e2fb5a8)
Factory.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 <map>
18
#include <string>
19
#include <vector>
20
// ============================================================================
21
// Boost:
22
// ============================================================================
23
#include <boost/mpl/assert.hpp>
24
#include <boost/type_traits.hpp>
25
// ============================================================================
26
// Gaudi
27
// ============================================================================
28
#include <
Gaudi/Parsers/Grammars.h
>
29
#include <
GaudiKernel/StatusCode.h
>
30
// ============================================================================
31
namespace
Gaudi
{
32
namespace
Parsers {
33
// ========================================================================
34
typedef
std::string::const_iterator
IteratorT
;
35
// typedef boost::spirit::ascii::space_type Skipper;
36
typedef
SkipperGrammar<IteratorT>
Skipper
;
37
// ========================================================================
38
template
<
typename
ResultT>
39
inline
StatusCode
parse_
( ResultT& result,
const
std::string
& input ) {
40
Skipper
skipper;
41
typename
Grammar_<IteratorT, ResultT, Skipper>::Grammar
g
;
42
IteratorT
iter = input.
begin
(),
end
= input.
end
();
43
return
( qi::phrase_parse( iter,
end
,
g
, skipper, result ) && ( iter ==
end
) ?
StatusCode::SUCCESS
44
:
StatusCode::FAILURE
);
45
}
46
//=========================================================================
47
template
<>
48
inline
StatusCode
parse_
(
std::string
& result,
const
std::string
& input ) {
49
Skipper
skipper;
50
Grammar_<IteratorT, std::string, Skipper>::Grammar
g
;
51
IteratorT
iter = input.
begin
(),
end
= input.
end
();
52
if
( !( qi::phrase_parse( iter,
end
,
g
, skipper, result ) && ( iter ==
end
) ) ) { result = input; }
53
//@attention always
54
return
StatusCode::SUCCESS
;
55
}
56
//=========================================================================
57
template
<
typename
ResultT>
58
inline
StatusCode
parse
( ResultT& result,
const
std::string
& input ) {
59
return
parse_
( result, input );
60
}
61
//=========================================================================
62
}
// namespace Parsers
63
}
// namespace Gaudi
Gaudi::Parsers::IteratorT
std::string::const_iterator IteratorT
Definition:
Factory.h:34
std::string
STL class.
Grammars.h
StatusCode.h
StatusCode
Definition:
StatusCode.h:65
gaudirun.g
dictionary g
Definition:
gaudirun.py:552
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition:
Factory.h:39
Gaudi::Parsers::SkipperGrammar
Definition:
Grammar.h:51
Gaudi
Header file for std:chrono::duration-based Counters.
Definition:
__init__.py:1
Gaudi::Parsers::Skipper
SkipperGrammar< IteratorT > Skipper
Definition:
Factory.h:36
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition:
StatusCode.h:100
Gaudi::Parsers::Grammar_
Definition:
Grammars.h:68
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
std::string::end
T end(T... args)
IOTest.end
end
Definition:
IOTest.py:123
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition:
StatusCode.h:101
GaudiKernel
include
Gaudi
Parsers
Factory.h
Generated on Tue Sep 21 2021 12:27:43 for The Gaudi Framework by
1.8.18