[pygccxml-commit] SF.net SVN: pygccxml: [762] pyplusplus_dev_ft
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2006-11-28 21:23:48
|
Revision: 762 http://svn.sourceforge.net/pygccxml/?rev=762&view=rev Author: roman_yakovenko Date: 2006-11-28 13:23:41 -0800 (Tue, 28 Nov 2006) Log Message: ----------- adding support for virtual function part of transformer Modified Paths: -------------- pyplusplus_dev_ft/pyplusplus/code_creators/calldef_transformed.py pyplusplus_dev_ft/pyplusplus/code_creators/calldef_utils.py pyplusplus_dev_ft/pyplusplus/code_repository/convenience.py pyplusplus_dev_ft/pyplusplus/function_transformers/controllers.py pyplusplus_dev_ft/pyplusplus/function_transformers/function_transformation.py pyplusplus_dev_ft/pyplusplus/function_transformers/templates.py pyplusplus_dev_ft/pyplusplus/function_transformers/transformers.py pyplusplus_dev_ft/unittests/data/function_transformations_to_be_exported.hpp pyplusplus_dev_ft/unittests/function_transformations_tester.py Modified: pyplusplus_dev_ft/pyplusplus/code_creators/calldef_transformed.py =================================================================== --- pyplusplus_dev_ft/pyplusplus/code_creators/calldef_transformed.py 2006-11-28 14:01:48 UTC (rev 761) +++ pyplusplus_dev_ft/pyplusplus/code_creators/calldef_transformed.py 2006-11-28 21:23:41 UTC (rev 762) @@ -3,7 +3,6 @@ # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -import re import os import algorithm import code_creator @@ -17,9 +16,10 @@ #TODO: constructors also can have transformation defined. We should use make _init # function for this purpose -__REMOVE_DUPLICAET_LINESEP = re.compile( '(%s){2,}' % os.linesep ) def remove_duplicate_linesep( code ): - return __REMOVE_DUPLICAET_LINESEP.sub( os.linesep, code ) + lines = code.split( os.linesep ) + lines = filter( lambda line: line.strip(), lines ) + return os.linesep.join( lines ) class sealed_fun_transformed_t( calldef_t ): def __init__( self, function, wrapper=None ): @@ -260,25 +260,44 @@ def _get_alias_impl( self ): return self.wrapper.ft.alias - def create_function_type_alias_code( self, exported_class_alias=None ): - ftype = self.wrapper.function_type() - return 'typedef %s;' % ftype.create_typedef( self.function_type_alias, exported_class_alias ) + def create_function_type_alias_code( self, exported_class_alias=None ): + result = [] + ftype = self.declaration.function_type() + result.append( 'typedef %s;' % ftype.create_typedef( self.function_type_alias, exported_class_alias ) ) + if self.wrapper: + result.append( os.linesep ) + ftype = self.wrapper.function_type() + result.append( 'typedef %s;' % ftype.create_typedef( self.default_function_type_alias ) ) + return ''.join( result ) + + def create_doc(self): + return None + def create_function_ref_code(self, use_function_alias=False): - full_name = self.wrapper.full_name() - + result = [] if use_function_alias: - return '%s( &%s )' \ - % ( self.function_type_alias, full_name ) + result.append( '%s(&%s)' + % ( self.function_type_alias, declarations.full_name( self.declaration ) ) ) + if self.wrapper: + result.append( self.param_sep() ) + result.append( '%s(&%s)' + % ( self.default_function_type_alias, self.wrapper.default_full_name() ) ) elif self.declaration.create_with_signature: - func_type = self.wrapper.function_type() - return '(%s)( &%s )' % ( func_type, full_name ) + result.append( '(%s)(&%s)' + % ( self.declaration.function_type().decl_string + , declarations.full_name( self.declaration ) ) ) + if self.wrapper: + result.append( self.param_sep() ) + result.append( '(%s)(&%s)' + % ( self.wrapper.function_type().decl_string, self.wrapper.default_full_name() ) ) else: - return '&%s' % full_name + result.append( '&%s'% declarations.full_name( self.declaration ) ) + if self.wrapper: + result.append( self.param_sep() ) + result.append( '&%s' % self.wrapper.default_full_name() ) + return ''.join( result ) - def create_call_policies( self ): - return '' - class mem_fun_v_transformed_wrapper_t( calldef_wrapper_t ): def __init__( self, function ): calldef_wrapper_t.__init__( self, function=function ) @@ -291,54 +310,98 @@ def controller( self ): return self.ft.controller - def create_declaration(self, name): - template = 'static %(return_type)s %(name)s( %(args)s )' + def default_full_name(self): + return self.parent.full_name + '::default_' + self.declaration.alias + def function_type(self): + return declarations.member_function_type_t( + return_type=self.declaration.return_type + , class_inst=declarations.dummy_type_t( self.parent.full_name ) + , arguments_types=map( lambda arg: arg.type, self.declaration.arguments ) + , has_const=self.declaration.has_const ) + + def create_declaration(self, name, has_virtual=True): + template = '%(virtual)s%(return_type)s %(name)s( %(args)s )%(constness)s %(throw)s' + + virtual = 'virtual ' + if not has_virtual: + virtual = '' + + constness = '' + if self.declaration.has_const: + constness = ' const ' + return template % { - 'return_type' : self.controller.wrapper_return_type.decl_string - , 'name' : self.wrapper_name() + 'virtual' : virtual + , 'return_type' : self.declaration.return_type.decl_string + , 'name' : name , 'args' : self.args_declaration() + , 'constness' : constness + , 'throw' : self.throw_specifier_code() } - def resolve_function_ref( self ): - raise NotImplementedError() + def wrapped_class_identifier( self ): + return algorithm.create_identifier( self, declarations.full_name( self.declaration.parent ) ) - def create_body(self): - cntrl = self.controller - - make_object = algorithm.create_identifier( self, 'pyplusplus::call_policies::make_object' ) - make_tuple = algorithm.create_identifier( self, 'boost::python::make_tuple' ) + def create_virtual_body(self): + cntrl = self.controller.override_controller - result_var_assign = '' + tmpl_values = dict() + tmpl_values['py_function_var'] = cntrl.py_function_var + tmpl_values['function_alias'] = self.declaration.alias + tmpl_values['declare_py_variables'] \ + = os.linesep.join( map( lambda var: var.declare_var_string(), cntrl.py_variables ) ) + tmpl_values['py_pre_call'] = os.linesep.join( cntrl.py_pre_call ) + tmpl_values['py_post_call'] = os.linesep.join( cntrl.py_post_call ) + tmpl_values['py_arg_expressions'] = '' + if cntrl.py_arg_expressions: + tmpl_values['py_arg_expressions'] \ + = ', ' + declarations.call_invocation.join( '', cntrl.py_arg_expressions ) + + tmpl_values['save_py_result'] = "bpl::object %s = " % cntrl.py_result_variable.name + tmpl_values['py_return'] = '' + tmpl_values['cpp_return'] = '' if not declarations.is_void( self.declaration.return_type ): - result_var_assign = '%(type)s %(name)s = ' \ - % { 'type': cntrl.result_variable.type.decl_string - , 'name' : cntrl.result_variable.name } + tmpl_values['py_return'] \ + = 'return bpl::extract< %(type)s >( pyplus_conv::get_out_argument( %(py_result)s, 0 ) );' \ + % { 'type' : self.declaration.return_type.decl_string + , 'py_result' : cntrl.py_result_variable.name } + tmpl_values['cpp_return'] = 'return ' - return_stmt_creator = calldef_utils.return_stmt_creator_t( self - , self.controller - , self.controller.result_variable - , self.controller.return_variables ) + tmpl_values['wrapped_class'] = self.wrapped_class_identifier() + tmpl_values['function_name'] = self.declaration.name - post_call = os.linesep.join( cntrl.post_call ) - if return_stmt_creator.pre_return_code: - post_call = os.linesep.join( [post_call, return_stmt_creator.pre_return_code] ) - - return cntrl.template.substitute({ - 'declare_variables' : os.linesep.join( map( lambda var: var.declare_var_string(), cntrl.variables ) ) - , 'pre_call' : os.linesep.join( cntrl.pre_call ) - , 'post_call' : post_call - , 'save_result' : result_var_assign - , 'function' : self.resolve_function_ref() - , 'arg_expressions' : self.PARAM_SEPARATOR.join( cntrl.arg_expressions ) - , 'return' : return_stmt_creator.statement - }) - - def _create_impl(self): - answer = [ self.create_declaration(self.declaration.alias) + '{' ] - answer.append( self.indent( '// Transformed wrapper function for "%s"' % self.declaration ) ) - body = self.create_body() + arg_utils = calldef_utils.argument_utils_t( self.declaration + , algorithm.make_id_creator( self ) + , self.declaration.arguments ) + tmpl_values['cpp_arg_expressions'] = arg_utils.call_args() + + return cntrl.template.substitute(tmpl_values) + + def create_default_body(self): + function_call = declarations.call_invocation.join( self.declaration.name + , [ self.function_call_args() ] ) + body = self.wrapped_class_identifier() + '::' + function_call + ';' + if not declarations.is_void( self.declaration.return_type ): + body = 'return ' + body + return body + + def create_function(self): + answer = [ self.create_declaration(self.declaration.name) + '{' ] + body = self.create_virtual_body() body = remove_duplicate_linesep( body ) answer.append( self.indent( body ) ) answer.append( '}' ) return os.linesep.join( answer ) + + def create_default_function( self ): + answer = [ self.create_declaration('default_' + self.declaration.alias, False) + '{' ] + answer.append( self.indent( self.create_default_body() ) ) + answer.append( '}' ) + return os.linesep.join( answer ) + + def _create_impl(self): + answer = [ self.create_function() ] + answer.append( os.linesep ) + answer.append( self.create_default_function() ) + return os.linesep.join( answer ) Modified: pyplusplus_dev_ft/pyplusplus/code_creators/calldef_utils.py =================================================================== --- pyplusplus_dev_ft/pyplusplus/code_creators/calldef_utils.py 2006-11-28 14:01:48 UTC (rev 761) +++ pyplusplus_dev_ft/pyplusplus/code_creators/calldef_utils.py 2006-11-28 21:23:41 UTC (rev 762) @@ -90,7 +90,8 @@ def call_args( self ): params = [] for index, arg in enumerate( self.__args ): - params.append( decl_wrappers.python_traits.call_traits( arg.type ) % self.argument_name( index ) ) + params.append( decl_wrappers.python_traits.call_traits( arg.type ) + % self.argument_name( index ) ) return ', '.join( params ) class return_stmt_creator_t( object ): Modified: pyplusplus_dev_ft/pyplusplus/code_repository/convenience.py =================================================================== --- pyplusplus_dev_ft/pyplusplus/code_repository/convenience.py 2006-11-28 14:01:48 UTC (rev 761) +++ pyplusplus_dev_ft/pyplusplus/code_repository/convenience.py 2006-11-28 21:23:41 UTC (rev 762) @@ -145,6 +145,16 @@ } } +inline boost::python::object +get_out_argument( boost::python::object result, index_type index ){ + if( PySequence_Check( result.ptr() ) ){ + return result[ index ]; + } + else{ + return result; + } +} + } /*pyplusplus*/ } /*convenience*/ namespace pyplus_conv = pyplusplus::convenience; Modified: pyplusplus_dev_ft/pyplusplus/function_transformers/controllers.py =================================================================== --- pyplusplus_dev_ft/pyplusplus/function_transformers/controllers.py 2006-11-28 14:01:48 UTC (rev 761) +++ pyplusplus_dev_ft/pyplusplus/function_transformers/controllers.py 2006-11-28 21:23:41 UTC (rev 762) @@ -100,7 +100,7 @@ @property def template( self ): - return templates.mem_fun.body + return templates.sealed_fun.body @property def wrapper_args( self ): @@ -188,58 +188,73 @@ class virtual_mem_fun_controller_t( controller_base_t ): - def __init__( self, function ): - controller_base_t.__init__( self, function ) - self.__py_vars_manager = create_variables_manager( function ) - self.__py_function_var \ - = self.__py_vars_manager.register_name( 'func_' + function.alias ) - self.__py_pre_call = [] - self.__py_post_call = [] - self.__py_result_var = variable_t( declarations.dummy_type_t( 'boost::python::object' ) - , self.register_py_variable_name( 'py_result' ) ) + class override_fun_controller_t( controller_base_t ): + def __init__( self, function ): + controller_base_t.__init__( self, function ) + self.__py_vars_manager = create_variables_manager( function ) + self.__py_function_var \ + = self.__py_vars_manager.register_name( 'func_' + function.alias ) + self.__py_pre_call = [] + self.__py_post_call = [] + self.__py_result_var = variable_t( declarations.dummy_type_t( 'boost::python::object' ) + , self.register_py_variable_name( 'py_result' ) ) + + self.__py_arg_expressions = [ arg.name for arg in function.arguments ] - self.__py_arg_expressions = [ arg.name for arg in function.arguments ] - - @property - def py_variables( self ): - return self.__py_vars_manager.variables + @property + def template( self ): + return templates.virtual_mem_fun.override_body + + @property + def py_variables( self ): + return self.__py_vars_manager.variables + + def declare_py_variable( self, type, name, initialize_expr='' ): + return self.__py_vars_manager.declare_variable( type, name, initialize_expr) - def declare_py_variable( self, type, name, initialize_expr='' ): - return self.__py_vars_manager.declare_variable( type, name, initialize_expr) - - def register_py_variable_name( self, name ): - return self.__py_vars_manager.register_name( name ) + def register_py_variable_name( self, name ): + return self.__py_vars_manager.register_name( name ) + + @property + def py_function_var( self ): + return self.__py_function_var - @property - def py_function_var( self ): - return self.__py_function_var + @property + def py_pre_call( self ): + return self.__py_pre_call + + def add_py_pre_call_code( self, code ): + self.__py_pre_call.append( code ) + + @property + def py_post_call( self ): + return self.__py_post_call + + def add_py_post_call_code( self, code ): + self.__py_post_call.append( code ) - @property - def py_pre_call( self ): - return self.__py_pre_call + @property + def py_result_variable( self ): + return self.__py_result_var - def add_py_pre_call_code( self, code ): - self.__py_pre_call.append( code ) - - @property - def py_post_call( self ): - return self.__py_post_call + @property + def py_arg_expressions( self ): + return filter( None, self.__py_arg_expressions ) - def add_py_post_call_code( self, code ): - self.__py_post_call.append( code ) + def remove_py_arg( self, index ): + self.__py_arg_expressions[ index ] = None + + def modify_py_arg_expression( self, index, expression ): + self.arg_expressions[ index ] = expression - @property - def py_result_variable( self ): - return self.__py_result_var - @property - def py_arg_expressions( self ): - return filter( None, self.__py_arg_expressions ) + def __init__( self, function ): + controller_base_t.__init__( self, function ) + self.__override_cntrl = self.override_fun_controller_t( function ) - def remove_py_arg( self, index ): - self.__py_arg_expressions[ index ] = None - - def modify_py_arg_expression( self, index, expression ): - self.arg_expressions[ index ] = expression + def apply( self, transformations ): + map( lambda t: t.configure_virtual_mem_fun( self ), transformations ) - + @property + def override_controller( self ): + return self.__override_cntrl Modified: pyplusplus_dev_ft/pyplusplus/function_transformers/function_transformation.py =================================================================== --- pyplusplus_dev_ft/pyplusplus/function_transformers/function_transformation.py 2006-11-28 14:01:48 UTC (rev 761) +++ pyplusplus_dev_ft/pyplusplus/function_transformers/function_transformation.py 2006-11-28 21:23:41 UTC (rev 762) @@ -16,7 +16,10 @@ self.__function = function self.__controller = None if isinstance( function.parent, declarations.class_t ): - self.__controller = controllers.mem_fun_controller_t( function ) + if declarations.VIRTUALITY_TYPES.NOT_VIRTUAL == function.virtuality: + self.__controller = controllers.mem_fun_controller_t( function ) + else: + self.__controller = controllers.virtual_mem_fun_controller_t( function ) else: self.__controller = controllers.free_fun_controller_t( function ) self.__transformers = map( lambda tr_creator: tr_creator( function ), transformer_creator ) Modified: pyplusplus_dev_ft/pyplusplus/function_transformers/templates.py =================================================================== --- pyplusplus_dev_ft/pyplusplus/function_transformers/templates.py 2006-11-28 14:01:48 UTC (rev 761) +++ pyplusplus_dev_ft/pyplusplus/function_transformers/templates.py 2006-11-28 21:23:41 UTC (rev 762) @@ -11,17 +11,10 @@ # function_name - C++ function name # function_alias - function name that Python user will see -class free_fun: - body = Template( os.linesep.join([ - '$declare_variables' - , '$pre_call' - , '$save_result$function($arg_expressions);' - , '$post_call' - , '$return' - ])) +#TODO: pre_call, post_call terminology should be changed. Use prefix and suffix +#instead: http://boost.org/libs/smart_ptr/sp_techniques.html#wrapper - -class mem_fun: +class sealed_fun: body = Template( os.linesep.join([ '$declare_variables' , '$pre_call' @@ -32,15 +25,16 @@ class virtual_mem_fun: override_body = Template( os.linesep.join([ - 'if( boost::python::override $py_function_var = this->get_override( "$function_alias" ) ){' + 'namespace bpl = boost::python;' + , 'if( bpl::override $py_function_var = this->get_override( "$function_alias" ) ){' , ' $declare_py_variables' , ' $py_pre_call' - , ' ${save_py_result}boost::python::call<$py_return_type>( $py_function_var$py_arg_expressions );' + , ' ${save_py_result}bpl::call<bpl::object>( $py_function_var.ptr()$py_arg_expressions );' , ' $py_post_call' , ' $py_return' , '}' , 'else{' - , ' $cpp_return$wrapped_class::%function_name( $cpp_arg_expressions );' + , ' $cpp_return$wrapped_class::$function_name( $cpp_arg_expressions );' , '}' ])) @@ -50,7 +44,6 @@ , 'if( $wrapper_class $py_wrapper_var = dynamic_cast< $wrapper_class >( boost::addressof( $wrapped_inst ) ) ){' , ' // The following call is done on an instance created in Python i.e.' , ' // a wrapper instance. this call might invoke python code.' - , ' // a wrapper instance. this call might invoke python code.' , ' $py_save_result$wrapped_inst->$wrapped_class::$function_name($py_arg_expressions);' , '}' , 'else{' Modified: pyplusplus_dev_ft/pyplusplus/function_transformers/transformers.py =================================================================== --- pyplusplus_dev_ft/pyplusplus/function_transformers/transformers.py 2006-11-28 14:01:48 UTC (rev 761) +++ pyplusplus_dev_ft/pyplusplus/function_transformers/transformers.py 2006-11-28 21:23:41 UTC (rev 762) @@ -72,8 +72,7 @@ """Returns list of header files that transformer generated code depends on.""" return [ code_repository.convenience.file_name ] - - def __configure_non_virtual( self, controller ): + def __configure_sealed( self, controller ): #removing arg from the function wrapper definition controller.remove_wrapper_arg( self.arg.name ) #declaring new variable, which will keep result @@ -84,21 +83,21 @@ controller.return_variable( var_name ) def configure_mem_fun( self, controller ): - self.__configure_non_virtual( controller ) + self.__configure_sealed( controller ) def configure_free_fun(self, controller ): - self.__configure_non_virtual( controller ) + self.__configure_sealed( controller ) def configure_virtual_mem_fun( self, controller ): assert isinstance( controller, controllers.virtual_mem_fun_controller_t ) - #removing arg from the function wrapper definition - controller.remove_py_arg( self.arg_index ) + override_cntrl = controller.override_controller + override_cntrl.remove_py_arg( self.arg_index ) tmpl = string.Template( '$name = boost::python::extract< $type >( pyplus_conv::get_out_argument( $py_result, "$name" ) );' ) store_py_result_in_arg = tmpl.substitute( name=self.arg.name - , type=self.arg.type.decl_string - , py_result=controller.py_result_variable.name ) - controller.add_py_post_call_code( store_py_result_in_arg ) + , type=remove_ref_or_ptr( self.arg.type ).decl_string + , py_result=override_cntrl.py_result_variable.name ) + override_cntrl.add_py_post_call_code( store_py_result_in_arg ) # input_t @@ -129,15 +128,15 @@ def __str__(self): return "input(%d)"%(self.idx) - def __configure_non_virtual( self, controller ): + def __configure_sealed( self, controller ): w_arg = controller.find_wrapper_arg( self.arg.name ) w_arg.type = remove_ref_or_ptr( self.arg.type ) def configure_mem_fun( self, controller ): - self.__configure_non_virtual( controller ) + self.__configure_sealed( controller ) def configure_free_fun(self, controller ): - self.__configure_non_virtual( controller ) + self.__configure_sealed( controller ) def configure_virtual_mem_fun( self, controller ): pass #according to boost.python documentation, it will create a copy of @@ -170,17 +169,17 @@ def __str__(self): return "inout(%d)"%(self.arg_index) - def __configure_non_virtual(self, controller): + def __configure_sealed(self, controller): w_arg = controller.find_wrapper_arg( self.arg.name ) w_arg.type = remove_ref_or_ptr( self.arg.type ) #adding the variable to return variables list controller.return_variable( w_arg.name ) def configure_mem_fun( self, controller ): - self.__configure_non_virtual( controller ) + self.__configure_sealed( controller ) def configure_free_fun(self, controller ): - self.__configure_non_virtual( controller ) + self.__configure_sealed( controller ) def configure_virtual_mem_fun( self, controller ): assert isinstance( controller, controllers.virtual_mem_fun_controller_t ) @@ -230,7 +229,7 @@ pre_call.append( 'pyplus_conv::copy_sequence( $pylist, pyplus_conv::array_inserter( $native_array, $array_size ) );' ) return string.Template( os.linesep.join( pre_call ) ) - def __configure_non_virtual(self, controller): + def __configure_sealed(self, controller): w_arg = controller.find_wrapper_arg( self.arg.name ) w_arg.type = declarations.dummy_type_t( "boost::python::object" ) @@ -249,10 +248,10 @@ controller.modify_arg_expression( self.arg_index, native_array ) def configure_mem_fun( self, controller ): - self.__configure_non_virtual( controller ) + self.__configure_sealed( controller ) def configure_free_fun(self, controller ): - self.__configure_non_virtual( controller ) + self.__configure_sealed( controller ) # output_array_t class output_array_t(transformer.transformer_t): @@ -292,7 +291,7 @@ def post_call_tmpl( self ): return string.Template( 'pyplus_conv::copy_container( $native_array, $native_array + $array_size, pyplus_conv::list_inserter( $pylist ) );' ) - def __configure_non_virtual(self, controller): + def __configure_sealed(self, controller): #removing arg from the function wrapper definition controller.remove_wrapper_arg( self.arg.name ) @@ -318,7 +317,7 @@ controller.return_variable( pylist ) def configure_mem_fun( self, controller ): - self.__configure_non_virtual( controller ) + self.__configure_sealed( controller ) def configure_free_fun(self, controller ): - self.__configure_non_virtual( controller ) + self.__configure_sealed( controller ) Modified: pyplusplus_dev_ft/unittests/data/function_transformations_to_be_exported.hpp =================================================================== --- pyplusplus_dev_ft/unittests/data/function_transformations_to_be_exported.hpp 2006-11-28 14:01:48 UTC (rev 761) +++ pyplusplus_dev_ft/unittests/data/function_transformations_to_be_exported.hpp 2006-11-28 21:23:41 UTC (rev 762) @@ -91,26 +91,26 @@ } -//~ namespace ft{ +namespace ft{ -//~ struct image_t{ +struct image_t{ - //~ image_t( unsigned int h, unsigned int w ) - //~ : m_height( h ) - //~ , m_width( w ) - //~ {} + image_t( unsigned int h, unsigned int w ) + : m_height( h ) + , m_width( w ) + {} - //~ // Made the method 'virtual' for now because func transformers - //~ // are currently only taken into account on virtual functions. - //~ void get_size( unsigned int& h, unsigned int& w ){ + // Made the method 'virtual' for now because func transformers + // are currently only taken into account on virtual functions. + //~ virtual void get_size( unsigned int& h, unsigned int& w ){ //~ h = m_height; //~ w = m_width; //~ } - //~ // Return only one value - //~ virtual void get_one_value(unsigned int& h) { - //~ h = m_height; - //~ } + // Return only one value + virtual void get_one_value(unsigned int& h) { + h = m_height; + } //~ // Like get_size() but with a return type and an additional argument //~ // that has to be kept in the signature @@ -137,10 +137,10 @@ //~ v[2] = 3; //~ } - //~ unsigned int m_width; - //~ unsigned int m_height; + unsigned int m_width; + unsigned int m_height; -//~ }; +}; //~ // Provide an instance created in C++ (i.e. this is not a wrapper instance) //~ image_t cpp_instance(12,13); @@ -183,6 +183,6 @@ //~ ~ft_private_destructor_t(){} //~ }; -//~ } +} #endif//__function_transformations_to_be_exported_hpp__ Modified: pyplusplus_dev_ft/unittests/function_transformations_tester.py =================================================================== --- pyplusplus_dev_ft/unittests/function_transformations_tester.py 2006-11-28 14:01:48 UTC (rev 761) +++ pyplusplus_dev_ft/unittests/function_transformations_tester.py 2006-11-28 21:23:41 UTC (rev 762) @@ -46,13 +46,13 @@ point3d.mem_fun( 'position' ).add_transformation( ft.output_array(0, size=3) ) point3d.mem_fun( 'distance' ).add_transformation( ft.output(1) ) - #~ image = mb.class_( "image_t" ) - #~ image.include() - #~ image.add_wrapper_code( '' ) + image = mb.class_( "image_t" ) + image.include() + #~ image.member_functions().exclude() #~ image.member_function( "get_size" ).include() #~ image.member_function( "get_size" ).add_transformation( ft.output(0), ft.output(1) ) - #~ image.member_function( "get_one_value" ).add_transformation( ft.output(0) ) + image.member_function( "get_one_value" ).add_transformation( ft.output(0) ) #~ image.member_function( "get_size2" ).add_transformation( ft.output(0), ft.output(1) ) #~ image.member_function( "input_arg" ).add_transformation( ft.input(0) ) #~ image.member_function( "fixed_input_array" ).add_transformation( ft.input_array(0,3) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |