[pypy-svn] r75991 - in pypy/branch/reflex-support/pypy/module/cppyy: include src

antocuni at codespeak.net antocuni at codespeak.net
Wed Jul 7 18:28:03 CEST 2010


Author: antocuni
Date: Wed Jul  7 18:28:02 2010
New Revision: 75991

Modified:
   pypy/branch/reflex-support/pypy/module/cppyy/include/cppyy.h
   pypy/branch/reflex-support/pypy/module/cppyy/src/reflexcwrapper.cxx
Log:
lookup and print the property "MethPtrGetter" for methods; so far it's unused
and it's always empty, because genreflex.py does not generate this information
yet.



Modified: pypy/branch/reflex-support/pypy/module/cppyy/include/cppyy.h
==============================================================================
--- pypy/branch/reflex-support/pypy/module/cppyy/include/cppyy.h	(original)
+++ pypy/branch/reflex-support/pypy/module/cppyy/include/cppyy.h	Wed Jul  7 18:28:02 2010
@@ -5,5 +5,6 @@
 #include "Reflex/Member.h"
 #include "Reflex/Object.h"
 #include "Reflex/Builder/TypeBuilder.h"
+#include "Reflex/PropertyList.h"
 
 #endif // CPPYY_CPPYY

Modified: pypy/branch/reflex-support/pypy/module/cppyy/src/reflexcwrapper.cxx
==============================================================================
--- pypy/branch/reflex-support/pypy/module/cppyy/src/reflexcwrapper.cxx	(original)
+++ pypy/branch/reflex-support/pypy/module/cppyy/src/reflexcwrapper.cxx	Wed Jul  7 18:28:02 2010
@@ -50,12 +50,26 @@
     t.Destruct(self, true);
 }
 
+typedef void* (*MethPtrGetter)(void*);
+static MethPtrGetter get_methptr_getter(Reflex::Member m)
+{
+  Reflex::PropertyList plist = m.Properties();
+  if (plist.HasProperty("MethPtrGetter")) {
+    Reflex::Any& value = plist.PropertyValue("MethPtrGetter");
+    return (MethPtrGetter)Reflex::any_cast<void*>(value);
+  }
+  else
+    return 0;
+}
+
 
 int num_methods(void* handle) {
     Reflex::Type t((Reflex::TypeName*)handle);
     for (int i = 0; i < (int)t.FunctionMemberSize(); i++) {
         Reflex::Member m = t.FunctionMemberAt(i);
         std::cout << i << " " << m.Name() << std::endl;
+        std::cout << "    " << "Stubfunction:  " << (void*)m.Stubfunction() << std::endl;
+        std::cout << "    " << "MethPtrGetter: " << (void*)get_methptr_getter(m) << std::endl;
         for (int j = 0; j < (int)m.FunctionParameterSize(); j++) {
             Reflex::Type at = m.TypeOf().FunctionParameterAt(j);
             std::cout << "    " << j << " " << at.Name() << std::endl;



More information about the Pypy-commit mailing list