Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:14:31

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 //==========================================================================
0011 #include "Parsers/spirit/ParsersStandardMiscCommon.h"
0012 
0013 #if defined(DD4HEP_HAVE_ALL_PARSERS)
0014 /// Namespace for the AIDA detector description toolkit
0015 namespace dd4hep {
0016   /// Namespace for the AIDA detector for utilities using boost::spirit parsers
0017   namespace Parsers {
0018 
0019     template <> int parse(std::map<unsigned int, std::string>& result, const std::string& input) {
0020       return parse_(result, input);
0021     }
0022   }
0023 }
0024 #endif
0025 #if 0
0026 /// Namespace for the AIDA detector description toolkit
0027 namespace dd4hep {
0028   /// Namespace for the AIDA detector for utilities using boost::spirit parsers
0029   namespace Parsers {
0030 
0031     template <> int parse(std::string& name, std::string& value, const std::string& input ) {
0032       Skipper skipper;
0033       KeyValueGrammar<IteratorT, Skipper> g;
0034       KeyValueGrammar<IteratorT, Skipper>::ResultT result;
0035       std::string::const_iterator iter = input.begin();
0036       bool parse_result = qi::phrase_parse(iter, input.end(), g, skipper,
0037                                            result) && (iter==input.end());
0038       if (parse_result) {
0039         name = result.first;
0040         value = result.second;
0041       }
0042       return parse_result;
0043     }
0044 
0045     template <> int parse(std::map<std::string, std::pair<double, double> >& result, const std::string& input) {
0046       return parse_(result, input);
0047     }
0048   }
0049 }
0050 #endif