| The Gaudi Framework v32r1 (f65d50dc)

Factory.h
Go to the documentation of this file.
1 #pragma once
2 // ============================================================================
3 // Include files
4 // ============================================================================
5 // STD & STL
6 // ============================================================================
7 #include <map>
8 #include <string>
9 #include <vector>
10 // ============================================================================
11 // Boost:
12 // ============================================================================
13 #include <boost/mpl/assert.hpp>
14 #include <boost/type_traits.hpp>
15 // ============================================================================
16 // Gaudi
17 // ============================================================================
18 #include <Gaudi/Parsers/Grammars.h>
19 #include <GaudiKernel/StatusCode.h>
20 // ============================================================================
21 namespace Gaudi {
22 namespace Parsers {
23 // ========================================================================
24 typedef std::string::const_iterator IteratorT;
25 // typedef boost::spirit::ascii::space_type Skipper;
26 typedef SkipperGrammar<IteratorT> Skipper;
27 // ========================================================================
28 template <typename ResultT>
29 inline StatusCode parse_( ResultT& result, const std::string& input ) {
30 Skipper skipper;
31 typename Grammar_<IteratorT, ResultT, Skipper>::Grammar g;
32 IteratorT iter = input.begin(), end = input.end();
33 return ( qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end ) ? StatusCode::SUCCESS
34 : StatusCode::FAILURE );
35 }
36 //=========================================================================
37 template <>
38 inline StatusCode parse_( std::string& result, const std::string& input ) {
39 Skipper skipper;
40 Grammar_<IteratorT, std::string, Skipper>::Grammar g;
41 IteratorT iter = input.begin(), end = input.end();
42 if ( !( qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end ) ) ) { result = input; }
43 //@attention always
44 return StatusCode::SUCCESS;
45 }
46 //=========================================================================
47 template <typename ResultT>
48 inline StatusCode parse( ResultT& result, const std::string& input ) {
49 return parse_( result, input );
50 }
51 //=========================================================================
52 } // namespace Parsers
53 } // namespace Gaudi
Gaudi::Parsers::parse_
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
Gaudi::Parsers::Skipper
SkipperGrammar< IteratorT > Skipper
Definition: Factory.h:26
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
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:11
std::string::end
T end(T... args)
std::string
STL class.
Gaudi::Parsers::IteratorT
std::string::const_iterator IteratorT
Definition: Factory.h:24
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
Grammars.h
Gaudi::Parsers::Grammar_
Definition: Grammars.h:58
IOTest.end
def end
Definition: IOTest.py:112
Gaudi::Parsers::SkipperGrammar
Definition: Grammar.h:41
std::string::begin
T begin(T... args)
gaudirun.g
dictionary g
Definition: gaudirun.py:520
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
StatusCode.h
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1