Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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;
27  // ========================================================================
28  template <typename ResultT>
29  inline StatusCode parse_( ResultT& result, const std::string& input ) {
30  Skipper skipper;
32  IteratorT iter = input.begin(), end = input.end();
33  return ( qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end ) ? StatusCode::SUCCESS
35  }
36  //=========================================================================
37  template <>
38  inline StatusCode parse_( std::string& result, const std::string& input ) {
39  Skipper skipper;
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
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:29
SkipperGrammar< IteratorT > Skipper
Definition: Factory.h:26
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
T end(T...args)
STL class.
std::string::const_iterator IteratorT
Definition: Factory.h:24
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
T begin(T...args)
dictionary g
Definition: gaudirun.py:516
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Helper functions to set/get the application return code.
Definition: __init__.py:1