[pygccxml-commit] SF.net SVN: pygccxml: [574] pyplusplus_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2006-09-21 19:14:04
|
Revision: 574 http://svn.sourceforge.net/pygccxml/?rev=574&view=rev Author: roman_yakovenko Date: 2006-09-21 12:13:52 -0700 (Thu, 21 Sep 2006) Log Message: ----------- fixing bug in associated_decl_creators functionality Modified Paths: -------------- pyplusplus_dev/pyplusplus/file_writers/class_multiple_files.py pyplusplus_dev/pyplusplus/file_writers/multiple_files.py pyplusplus_dev/pyplusplus/module_creator/creator.py pyplusplus_dev/unittests/algorithms_tester.py Modified: pyplusplus_dev/pyplusplus/file_writers/class_multiple_files.py =================================================================== --- pyplusplus_dev/pyplusplus/file_writers/class_multiple_files.py 2006-09-21 12:41:16 UTC (rev 573) +++ pyplusplus_dev/pyplusplus/file_writers/class_multiple_files.py 2006-09-21 19:13:52 UTC (rev 574) @@ -157,7 +157,7 @@ return patterns def split_internal_memfuns( self, class_creator ): - calldef_types = ( code_creators.mem_fun_t ) + calldef_types = ( code_creators.mem_fun_t, code_creators.mem_fun_overloads_t ) return self.split_internal_calldefs( class_creator, calldef_types, 'memfuns' ) def split_internal_v_memfuns( self, class_creator ): Modified: pyplusplus_dev/pyplusplus/file_writers/multiple_files.py =================================================================== --- pyplusplus_dev/pyplusplus/file_writers/multiple_files.py 2006-09-21 12:41:16 UTC (rev 573) +++ pyplusplus_dev/pyplusplus/file_writers/multiple_files.py 2006-09-21 19:13:52 UTC (rev 574) @@ -70,10 +70,10 @@ internal_creators = [] if isinstance( creator, code_creators.compound_t ): - internal_creators.extend( - filter( lambda acreator: isinstance( acreator, code_creators.compound_t ) + internal_creators.extend( + filter( lambda creator: isinstance( creator, code_creators.registration_based_t ) , code_creators.make_flatten( creator.creators ) ) ) - + map( lambda internal_creator: associated_creators.extend( internal_creator.associated_decl_creators ) , internal_creators ) #now associated_creators contains all code creators associated with the creator @@ -315,8 +315,8 @@ def split_free_functions( self ): """Write all free functions into a separate .h/.cpp file. """ - creators = filter( lambda x: isinstance(x, code_creators.free_function_t ) - , self.extmodule.body.creators ) + free_functions = ( code_creators.free_function_t, code_creators.free_fun_overloads_t ) + creators = filter( lambda x: isinstance(x, free_functions ), self.extmodule.body.creators ) self.split_creators( creators, '_free_functions', 'register_free_functions', -1 ) #TODO: move write_main to __init__ Modified: pyplusplus_dev/pyplusplus/module_creator/creator.py =================================================================== --- pyplusplus_dev/pyplusplus/module_creator/creator.py 2006-09-21 12:41:16 UTC (rev 573) +++ pyplusplus_dev/pyplusplus/module_creator/creator.py 2006-09-21 19:13:52 UTC (rev 574) @@ -646,11 +646,13 @@ if None is f.call_policies: f.call_policies = self.__call_policies_resolver( f ) self.register_opaque_type( f.return_type, f.call_policies ) + overloads_cls_creator = code_creators.free_fun_overloads_class_t( overloads ) self.__extmodule.adopt_declaration_creator( overloads_cls_creator ) overloads_reg = code_creators.free_fun_overloads_t( overloads_cls_creator ) self.curr_code_creator.adopt_creator( overloads_reg ) + overloads_reg.associated_decl_creators.append( overloads_cls_creator ) else: self.__types_db.update( self.curr_decl ) if None is self.curr_decl.call_policies: @@ -687,10 +689,11 @@ overloads_cls_creator = code_creators.mem_fun_overloads_class_t( overloads ) self.__extmodule.adopt_declaration_creator( overloads_cls_creator ) - cls_creator.associated_decl_creators.append( overloads_cls_creator ) - + overloads_reg = code_creators.mem_fun_overloads_t( overloads_cls_creator ) cls_creator.adopt_creator( overloads_reg ) + + overloads_reg.associated_decl_creators.append( overloads_cls_creator ) return exposed def visit_class(self ): Modified: pyplusplus_dev/unittests/algorithms_tester.py =================================================================== --- pyplusplus_dev/unittests/algorithms_tester.py 2006-09-21 12:41:16 UTC (rev 573) +++ pyplusplus_dev/unittests/algorithms_tester.py 2006-09-21 19:13:52 UTC (rev 574) @@ -125,6 +125,9 @@ CLASS_DEF = \ """ namespace tester{ + + void check_overload( int i=0, int j=1, int k=2 ); + struct b{ enum EColor{ red, blue }; enum EFruit{ apple, orange }; @@ -134,8 +137,10 @@ void do_nothing(){} - int do_somghing(){ return 1; } + int do_something(){ return 1; } + void check_overload( int i=0, int j=1, int k=2 ); + int m_dummy; struct b_nested{}; @@ -147,6 +152,7 @@ [ module_builder.create_text_fc( self.CLASS_DEF ) ] , gccxml_path=autoconfig.gccxml.executable ) mb.namespace( name='::tester' ).include() + mb.calldefs( 'check_overload' ).use_overload_macro = True b = mb.class_( 'b' ) b.add_declaration_code( '//hello world' ) nested = b.class_( 'b_nested' ) @@ -160,6 +166,9 @@ CLASS_DEF = \ """ namespace tester{ + + void check_overload( int i=0, int j=1, int k=2 ); + struct x{ enum EColor{ red, blue }; enum EFruit{ apple, orange }; @@ -169,7 +178,9 @@ void do_nothing(){} - int do_somghing(){ return 1; } + int do_something(){ return 1; } + + void check_overload( int i=0, int j=1, int k=2 ); int m_dummy; @@ -188,6 +199,7 @@ nested = x.class_( 'x_nested' ) nested.add_declaration_code( '//hello nested decl' ) nested.add_registration_code( '//hello nested reg', False ) + mb.calldefs( 'check_overload' ).use_overload_macro = True mb.build_code_creator('x_class_multi') mb.split_module( autoconfig.build_dir This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |