[C++-sig] Wrapping pointers

Roman Yakovenko roman.yakovenko at gmail.com
Sat Apr 22 12:05:16 CEST 2006


On 4/20/06, Dominic Sacré <dominic.sacre at gmx.de> wrote:
> On Wednesday, 19. April 2006 23:05, Ralf W. Grosse-Kunstleve wrote:
> >   .add_property("p", make_function(&A::get_p,
> > return_value_policy<reference_existing_object>()))
>
> Thanks, that did the trick!
>
>     Dominic

I am working on pyplusplus to generate right code for this situation.
The case discussed here is already implemented ( not committed yet ).
pyplusplus generates class wrapper and adds "get" method to it.
I attached the file that demonstrates the use case.

My question about "set" functionality. I am not sure what call
policies I should set by
default? default or with_custodian_and_ward_postcall< 0, 1 >
I think, that first one is a mistake, while the second one is correct.
I just want to be sure.

Also, right now I don't see differences between regular member
variable and static
member variable as for the call policies. Am I right?

Thanks

--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mvpointer.cpp
Type: text/x-c++src
Size: 3448 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20060422/a42806c1/attachment.cpp>


More information about the Cplusplus-sig mailing list