Revision: 1322
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1322&view=rev
Author: roman_yakovenko
Date: 2008-05-27 10:54:15 -0700 (Tue, 27 May 2008)
Log Message:
-----------
implement "abstract" property for PDB parser
Modified Paths:
--------------
pygccxml_dev/pygccxml/declarations/class_declaration.py
Modified: pygccxml_dev/pygccxml/declarations/class_declaration.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/class_declaration.py 2008-05-25 20:36:02 UTC (rev 1321)
+++ pygccxml_dev/pygccxml/declarations/class_declaration.py 2008-05-27 17:54:15 UTC (rev 1322)
@@ -13,6 +13,7 @@
"""
import scopedef
+import itertools
import compilers
import algorithm
import declaration
@@ -276,13 +277,28 @@
def _get_is_abstract(self):
if self.compiler == compilers.MSVC_PDB_9:
+ #prevent cyclic dependencies
import calldef
- import matchers #prevent cyclic dependencies
- m = matchers.virtuality_type_matcher_t( calldef.VIRTUALITY_TYPES.PURE_VIRTUAL )
- if self.calldefs( m, recursive=False, allow_empty=True ):
+ import function_traits
+ from matchers import virtuality_type_matcher_t as vtmatcher_t
+ filter_pv = vtmatcher_t( calldef.VIRTUALITY_TYPES.PURE_VIRTUAL )
+ if self.calldefs( filter_pv, recursive=False, allow_empty=True ):
return True
+ filter_npv = vtmatcher_t( calldef.VIRTUALITY_TYPES.VIRTUAL ) \
+ | vtmatcher_t( calldef.VIRTUALITY_TYPES.NOT_VIRTUAL )
+ pv_calldefs = []
+ npv_calldefs = []
+
+ npv_calldefs.extend( self.calldefs( filter_npv, recursive=False, allow_empty=True ) )
for base in self.recursive_bases:
- if base.related_class.calldefs( m, recursive=False, allow_empty=True ):
+ cls = base.related_class
+ pv_calldefs.extend( cls.calldefs( filter_pv, recursive=False, allow_empty=True ) )
+ npv_calldefs.extend( cls.calldefs( filter_npv, recursive=False, allow_empty=True ) )
+
+ for pure_virtual in pv_calldefs:
+ impl_found = filter( lambda f: function_traits.is_same_function( pure_virtual, f )
+ , npv_calldefs )
+ if not impl_found:
return True
return False
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|