[pygccxml-commit] SF.net SVN: pygccxml:[1781] pyplusplus_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2009-12-15 20:47:18
|
Revision: 1781 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1781&view=rev Author: roman_yakovenko Date: 2009-12-15 20:47:10 +0000 (Tue, 15 Dec 2009) Log Message: ----------- a few updates to FT input static matrix functionality Modified Paths: -------------- pyplusplus_dev/pyplusplus/function_transformers/transformers.py pyplusplus_dev/unittests/data/ft_input_static_matrix_to_be_exported.hpp pyplusplus_dev/unittests/ft_input_static_matrix_tester.py Modified: pyplusplus_dev/pyplusplus/function_transformers/transformers.py =================================================================== --- pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2009-12-15 20:44:50 UTC (rev 1780) +++ pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2009-12-15 20:47:10 UTC (rev 1781) @@ -569,7 +569,7 @@ return [ code_repository.convenience.file_name ] def __configure_sealed(self, controller): - global _seq2arr + global _pymatrix2cmatrix w_arg = controller.find_wrapper_arg( self.arg.name ) w_arg.type = declarations.dummy_type_t( "boost::python::object" ) @@ -592,7 +592,7 @@ def __configure_v_mem_fun_default( self, controller ): self.__configure_sealed( controller ) - def __configure_v_mem_fun_override( self, controller ): + def __configure_v_mem_fun_override( self, controller ): global _arr2seq pylist = controller.declare_py_variable( declarations.dummy_type_t( 'boost::python::list' ) , 'py_' + self.arg.name ) Modified: pyplusplus_dev/unittests/data/ft_input_static_matrix_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/ft_input_static_matrix_to_be_exported.hpp 2009-12-15 20:44:50 UTC (rev 1780) +++ pyplusplus_dev/unittests/data/ft_input_static_matrix_to_be_exported.hpp 2009-12-15 20:47:10 UTC (rev 1781) @@ -12,16 +12,31 @@ namespace ft{ -int sum( int m[2][3] ){ +template< int rows, int columns > +int sum_impl( const int m[rows][columns] ){ int result = 0; - for( int r = 0; r < 2; ++r ){ - for( int c = 0; c < 3; ++c ){ + for( int r = 0; r < rows; ++r ){ + for( int c = 0; c < columns; ++c ){ result += m[r][c]; } } return result; } +int sum( int m[2][3]){ + return sum_impl<2, 3>( m ); } +int sum_const( int m[2][3]){ + return sum_impl<2, 3>( m ); +} + +struct matrix_sum_t{ + virtual int calculate( const int m[3][5] ) const{ + return sum_impl<3,5>( m ); + } +}; + +} + #endif//__ft_input_static_matrix_to_be_exported_hpp__ Modified: pyplusplus_dev/unittests/ft_input_static_matrix_tester.py =================================================================== --- pyplusplus_dev/unittests/ft_input_static_matrix_tester.py 2009-12-15 20:44:50 UTC (rev 1780) +++ pyplusplus_dev/unittests/ft_input_static_matrix_tester.py 2009-12-15 20:47:10 UTC (rev 1781) @@ -23,8 +23,16 @@ def customize( self, mb ): mb.global_ns.calldefs().create_with_signature = True + mb.free_funs( 'sum_impl' ).exclude() + sum = mb.free_fun( 'sum' ) sum.add_transformation( ft.input_static_matrix('m', rows=2, columns=3) ) + + sum = mb.free_funs( lambda d: d.name in ('sum', 'sum_const' ) ) + sum.add_transformation( ft.input_static_matrix('m', rows=2, columns=3) ) + + calculate = mb.mem_fun( 'calculate' ) + calculate.add_transformation( ft.input_static_matrix('m', rows=3, columns=5) ) def run_tests(self, module): """Run the actual unit tests""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |