The Gaudi Framework  v33r1 (b1225454)
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;
37  // ========================================================================
38  template <typename ResultT>
39  inline StatusCode parse_( ResultT& result, const std::string& input ) {
40  Skipper skipper;
42  IteratorT iter = input.begin(), end = input.end();
43  return ( qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end ) ? StatusCode::SUCCESS
45  }
46  //=========================================================================
47  template <>
48  inline StatusCode parse_( std::string& result, const std::string& input ) {
49  Skipper skipper;
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
StatusCode parse_(ResultT &result, const std::string &input)
Definition: Factory.h:39
SkipperGrammar< IteratorT > Skipper
Definition: Factory.h:36
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
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:34
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
def end
Definition: IOTest.py:123
T begin(T... args)
dictionary g
Definition: gaudirun.py:542
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1