[C++-sig] Call policies choice
Roman Yakovenko
roman.yakovenko at gmail.com
Tue Jul 31 11:17:48 CEST 2007
On 7/31/07, Coockie_jr <achille.talon at gmail.com> wrote:
>
> Hi I'l still working on trying to wrap a library with boost.python an py++
> but I'm having some difficulties with call policies and a little hint would
> be nice since the on-line documentation doesn't help me much (or I just
> don't understand ;) )
Did you read this:
http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies
?
> I've got this classe
>
> class NeoCollection:public NeoMsgType{
> public:
> ...
> ...
> virtual NeoMsgType* get(unsigned short index) const= 0;
> ...
> ...
> virtual string toString() const;
> protected:
> unsigned short count;
> };
To get good answer you should define who is the owner of the returned object?
If it is the NeoCollection instance than "return_internal_reference"
should be used.
> And boost requires specific call policies get and toString methods.
What do you try to say?
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
More information about the Cplusplus-sig
mailing list