The Gaudi Framework
master (e68eea06)
Loading...
Searching...
No Matches
Factory.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 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 <
Gaudi/Parsers/Grammars.h
>
14
#include <
GaudiKernel/StatusCode.h
>
15
#include <string>
16
#include <string_view>
17
18
namespace
Gaudi::Parsers
{
19
typedef
std::string_view::const_iterator
IteratorT
;
20
typedef
SkipperGrammar<IteratorT>
Skipper
;
21
template
<
typename
ResultT>
22
inline
StatusCode
parse_
( ResultT& result, std::string_view input ) {
23
Skipper
skipper;
24
typename
Grammar_<IteratorT, ResultT, Skipper>::Grammar
g;
25
IteratorT
iter = input.begin(), end = input.end();
26
return
( qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end ) ?
StatusCode::SUCCESS
27
:
StatusCode::FAILURE
);
28
}
29
template
<>
30
inline
StatusCode
parse_
( std::string& result, std::string_view input ) {
31
Skipper
skipper;
32
Grammar_<IteratorT, std::string, Skipper>::Grammar
g;
33
IteratorT
iter = input.begin(), end = input.end();
34
if
( !( qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end ) ) ) { result = input; }
35
//@attention always
36
return
StatusCode::SUCCESS
;
37
}
38
template
<
typename
ResultT>
39
inline
StatusCode
parse
( ResultT& result, std::string_view input ) {
40
return
parse_
( result, input );
41
}
42
}
// namespace Gaudi::Parsers
Grammars.h
StatusCode.h
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition
StatusCode.h:99
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition
StatusCode.h:100
Gaudi::Parsers
Definition
DODBasicMapper.cpp:17
Gaudi::Parsers::Skipper
SkipperGrammar< IteratorT > Skipper
Definition
Factory.h:20
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, std::string_view input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition
DODBasicMapper.cpp:21
Gaudi::Parsers::IteratorT
std::string_view::const_iterator IteratorT
Definition
Factory.h:19
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, std::string_view input)
Definition
Factory.h:22
Gaudi::Parsers::Grammar_
Definition
Grammars.h:55
Gaudi::Parsers::SkipperGrammar
Definition
Grammars.h:72
GaudiKernel
include
Gaudi
Parsers
Factory.h
Generated on Tue Nov 18 2025 10:07:19 for The Gaudi Framework by
1.13.1