On Fri, Jun 13, 2008 at 10:11 AM, Vincent Ferries
<vin...@gm...> wrote:
> I prefer to keep most of ths code hidden.
> I'll post you just what is need if possible.
>
> There are two call_policies definitions and what's done with includes.
>
>
> nastranPfManip = mb.namespace('postLib').namespace('nastran',
> recursive=False).class_('opfManip')
> reference_functions.append(nastranPfManip.member_function('getOstream'))
>
> nastranElement = mb.namespace('postLib').namespace('nastran',
> recursive=False).class_('element')
> pointee_functions.append(nastranElement.member_function('getCornerNodes'))
>
> for function in reference_functions :
> function.call_policies =
> call_policies.return_value_policy(call_policies.reference_existing_object)
>
> for function in pointee_functions :
> # Seems to generate import troubles
> function.call_policies =
> call_policies.return_value_policy(call_policies.return_pointee_value)
>
>
>
> for the includes I use the folowing line which links to all my .h files:
>
>
> mb.code_creator.add_include(os.path.join(settings.ferespost_path,
> "pyferespost.h"))
>
>
> And the initialization :
>
>
> header_files = [os.path.join(settings.ferespost_path, "pyferespost.h")]
> #header_files = [os.path.join(settings.ferespost_path, "CLA/util/idfier.h")]
>
>
> # Create configuration for GCC-XML parser
> # Initialize module builder
> mb = module_builder.module_builder_t(header_files,
> gccxml_path=settings.gccxml_path,
> working_directory=settings.ferespost_path,
> include_paths=[settings.ferespost_path], define_symbols=[])
>
> #Well, don't you want to see what is going on?
> # Please be quiet... I'll be grateful
> # mb.print_declarations()
>
> #Creating code creator. After this step you should not
> modify/customize declarations.
> mb.build_code_creator(settings.module_name)
> mb.code_creator.license = license
> mb.code_creator.user_defined_directories.append(settings.ferespost_path)
> mb.code_creator.precompiled_header = 'boost/python.hpp'
I don't see problem with the code you posted. I also created small
unit test and it doesn't reproduce the problem. In the directory, you
generate code too, Py++ will place "__call_policies.pypp.hpp". This is
the file, that contains the relevant class definition.
You will have to create small test case, that reproduce the problem. I
don't see other way to solve it. Sorry.
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|