[C++-sig] Question about passing ordinary pointers (like int*) to functions
Shandong Han
shandong.han at mizuho-sc.com
Mon Oct 23 03:30:02 CEST 2006
Thank you guys very much for the prompt replies.
Dave: It's really a great idea to put those things in a tuple. But there are
two problems with that:
1. I have to write wrappers for all the functions (since all the functions
are like that) without the help of automatic tools...
2. There is still the problem with arrays or pointers to arrays.
Roman: Thank you for providing the great tool and supports on it. BTW, I
cannot access the first link, maybe it needs logging in? But I read the
following two, and found following comment:
// Made the method 'virtual' for now because func transformers
// are currently only taken into account on virtual functions.
Unfortunately the functions I need to wrap are all independent functions...
> This feature presents in Py++-0.8.2 release. The feature is highly
experimental, nevertheless very useful. The API will change. Can you try it
and provide some feedback?
Yes, I will try it. But this time I was required to write something
serious... :-P
Just wonder if there is a solution in Boost.Python on pointers to or arrays
of primitive types? If not, just wonder how people manage to live with
working on the big C/C++ projects :-)
Note:The 'Note' appended to my emails except this one are added by system, I
am sorry that I cannot remove them...
-----Original Message-----
From: Roman Yakovenko [mailto:roman.yakovenko at gmail.com]
Sent: Friday, October 20, 2006 6:31 PM
To: shandong.han at mizuho-sc.com; Development of Python/C++ integration
Subject: Re: [C++-sig] Question about passing ordinary pointers (like int*)
to functions
C++ treats arrays as pointers, not Py++. Any way you have a problem,
C++ which
should be solved. David Abrahams already provided you with solution, I will
point you to experimental code in Py++ that will allow you to implement the
solution with it.
We call the functionality you are looking for - "Function Transformation".
It wil allow you to instruct Py++ to create right function wrapper.
Start here: https://realityforge.vrsource.org/view/PyppApi/CodeInserter
Take a look on Py++ unit tests:
http://tinyurl.com/uo5kh - usage example
http://tinyurl.com/vv9j6 - C++ source code to expose
This feature presents in Py++-0.8.2 release. The feature is highly
experimental, nevertheless very useful. The API will change. Can you try it
and provide some feedback?
Thanks
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
More information about the Cplusplus-sig
mailing list