The Gaudi Framework  v30r4 (9b837755)
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 {
23  namespace Parsers
24  {
25  // ========================================================================
26  typedef std::string::const_iterator IteratorT;
27  // typedef boost::spirit::ascii::space_type Skipper;
29  // ========================================================================
30  template <typename ResultT>
31  inline StatusCode parse_( ResultT& result, const std::string& input )
32  {
33  Skipper skipper;
35  IteratorT iter = input.begin(), end = input.end();
36  return ( qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end ) ? StatusCode::SUCCESS
38  }
39  //=========================================================================
40  template <>
41  inline StatusCode parse_( std::string& result, const std::string& input )
42  {
43  Skipper skipper;
45  IteratorT iter = input.begin(), end = input.end();
46  if ( !( qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end ) ) ) {
47  result = input;
48  }
49  //@attention always
50  return StatusCode::SUCCESS;
51  }
52  //=========================================================================
53  template <typename ResultT>
54  inline StatusCode parse( ResultT& result, const std::string& input )
55  {
56  return parse_( result, input );
57  }
58  //=========================================================================
59  } /* Parsers */
60 } /* Gaudi */
constexpr static const auto FAILURE
Definition: StatusCode.h:88
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:31
SkipperGrammar< IteratorT > Skipper
Definition: Factory.h:28
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:26
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
T begin(T...args)
dictionary g
Definition: gaudirun.py:452
Helper functions to set/get the application return code.
Definition: __init__.py:1