Revision: 1295
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1295&view=rev
Author: roman_yakovenko
Date: 2008-04-04 12:35:03 -0700 (Fri, 04 Apr 2008)
Log Message:
-----------
implementing work around for BPL bug
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py
Modified: pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py
===================================================================
--- pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2008-04-01 19:05:50 UTC (rev 1294)
+++ pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2008-04-04 19:35:03 UTC (rev 1295)
@@ -481,8 +481,43 @@
or all_pure_virtual( f )
, list( not_reimplemented_funcs ) )
+
+ #Boost.Python is not able to call for non-virtual function, from the base
+ #class if there is a virtual function with the same within base class
+ #See override_bug tester for more information
+
+ def buggy_bpl_filter( f ):
+ if f.parent is self:
+ return False
+ if f.access_type != ACCESS_TYPES.PUBLIC:
+ return False
+ if f.virtuality != VIRTUALITY_TYPES.NOT_VIRTUAL:
+ return False
+ #we need to check that we don't have "same" function in this class
+ this_funs = self.decls( name=f.name
+ , decl_type=declarations.calldef_t
+ , recursive=False
+ , allow_empty=True )
+ for this_f in this_funs:
+ if is_same_function( this_f, f ):
+ #there is already the function in the class, so no need to redefined it
+ return False
+ else:
+ return True
+
+ tmp = {} # id : f
+ for redefined_f in functions:
+ #redefined is virtual, I am not interested in virtual functions
+ for rfo in redefined_f.overloads:
+ if id(rfo) in tmp:
+ continue
+ if buggy_bpl_filter( rfo ):
+ tmp[ id(rfo) ] = rfo
+ functions.extend( tmp.values() )
+
functions.sort( cmp=lambda f1, f2: cmp( ( f1.name, f1.location.as_tuple() )
, ( f2.name, f2.location.as_tuple() ) ) )
+
self._redefined_funcs = functions
return self._redefined_funcs
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|