[Rivet-svn] r4293 - trunk/src/Core

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed May 15 12:04:58 BST 2013


Author: buckley
Date: Wed May 15 12:04:58 2013
New Revision: 4293

Log:
More yaml-cpp v3 and a couple of fixes to the v5 code

Modified:
   trunk/src/Core/AnalysisInfo.cc

Modified: trunk/src/Core/AnalysisInfo.cc
==============================================================================
--- trunk/src/Core/AnalysisInfo.cc	Wed May 15 11:58:49 2013	(r4292)
+++ trunk/src/Core/AnalysisInfo.cc	Wed May 15 12:04:58 2013	(r4293)
@@ -77,7 +77,7 @@
     #define TRY_GETINFO_SEQ(KEY, VAR) try { \
         if (const YAML::Node* VAR = doc.FindValue(KEY)) {                                       \
           for (size_t i = 0; i < VAR.size(); ++i) {                     \
-            string val; VAR[i] >> val; ai->_ ## VAR += val;             \
+            string val; (*VAR)[i] >> val; ai->_ ## VAR += val;          \
           } } } catch (...) { THROW_INFOERR(KEY); }
     #elif YAMLCPP_API_VERSION == 5
     #define TRY_GETINFO_SEQ(KEY, VAR) try { \
@@ -96,10 +96,12 @@
     // A boolean with some name flexibility
     try {
       #if YAMLCPP_API_VERSION == 3
-      /// @todo Fix
+      bool val;
+      if (const YAML::Node n = doc.FindValue("NeedsCrossSection")) { *n >> val; ai->_needsCrossSection = val; }
+      if (const YAML::Node n = doc.FindValue("NeedCrossSection")) { *n >> val; ai->_needsCrossSection = val; }
       #elif YAMLCPP_API_VERSION == 5
       if (doc["NeedsCrossSection"]) ai->_needsCrossSection = doc["NeedsCrossSection"].as<bool>();
-      else if (doc["NeedsCrossSection"]) ai->_needsCrossSection = doc["NeedCrossSection"].as<bool>();
+      else if (doc["NeedCrossSection"]) ai->_needsCrossSection = doc["NeedCrossSection"].as<bool>();
       #endif
     } catch (...) {
       THROW_INFOERR("NeedsCrossSection|NeedCrossSection");


More information about the Rivet-svn mailing list