[C++-sig] Exposing c++ classes with static arrays usingBoost.Python and py++

Roman Yakovenko roman.yakovenko at gmail.com
Wed Oct 4 00:16:28 CEST 2006


On 10/4/06, Haridev, Meghana <mharidev at qualcomm.com> wrote:
> Hi Roman,
>
> I don't think it is a Boost.Python problem because I am able to expose
> the arrays successfully using namespaces. I think it is more to do with
> how Py++ exposes arrays (using derived classes).

I was wrong. Py++ generated wrong code.

> I have attached code to illustrate this by exposing arrays (of both
> simple and complex types) using namespaces instead of derived classes
> and how they can be successfully accessed in python. Please let me know
> what you think about this solution and if something similar can be
> incorporated into Py++

There is nothing wrong with your solution. For few reasons I prefer to
user wrapper for such things.

I just comitted a fix to your problem to SVN. Please try it and let me know
what do you think and whether it fix your bug. I created a unit tests based on
your input and now it passes.

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list