[yoda-svn] r475 - trunk/pyext/yoda/include

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Jul 2 23:32:33 BST 2012


Author: davemallows
Date: Mon Jul  2 23:32:33 2012
New Revision: 475

Log:
Fixed AnalysisObject's annotations support

Modified:
   trunk/pyext/yoda/include/10-AnalysisObject.pyx

Modified: trunk/pyext/yoda/include/10-AnalysisObject.pyx
==============================================================================
--- trunk/pyext/yoda/include/10-AnalysisObject.pyx	Mon Jul  2 22:55:02 2012	(r474)
+++ trunk/pyext/yoda/include/10-AnalysisObject.pyx	Mon Jul  2 23:32:33 2012	(r475)
@@ -1,7 +1,7 @@
 cdef extern from "YODA/AnalysisObject.h" namespace "YODA":
     cdef cppclass cAnalysisObject "YODA::AnalysisObject":
         string type()
-        map[string, string] annotations
+        map[string, string] annotations()
 
 ctypedef cAnalysisObject* AOptr 
 
@@ -19,13 +19,17 @@
         return self.thisptr.type().c_str()
 
     def annotations(self):
-        d = dict()
+        stuff = dict()
         cdef map[string, string] annotations = self.thisptr.annotations()
+        cdef pair[string, string] obj
 
+        # TODO: clean up some of this, as required
         it = annotations.begin()
         while it != annotations.end():
-            d[deref(it).first.c_str()] = deref(it).second.c_str()
+            obj = deref(it)
+            d[obj.first.c_str()] = obj.second.c_str()
             inc(it)
+
         return d
 
     def __dealloc__(self):


More information about the yoda-svn mailing list