Re: [pygccxml-development] Indexing suite in Py++ code
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2007-05-15 09:07:06
|
On 5/15/07, Alexander Eisenhuth <new...@st...> wrote:
> I think this is the code.
>
> { //::ToolData_C::GetButtonMappingArray
>
> typedef ::std::vector<short unsigned int,std::allocator<short unsigned int>
> > & ( ::ToolData_C::*GetButtonMappingArray_function_type )( ) ;
>
> ToolData_C_exposer.def(
> "GetButtonMappingArray"
> , GetButtonMappingArray_function_type(
> &::ToolData_C::GetButtonMappingArray )
> /* undefined call policies */ );
>
> }
"GetButtonMappingArray" function returns reference to std::vector<...>, right?
Now you should tell Boost.Python how to manage memory of this object.
If this function returns reference to a member variable you can use
"return_internal_reference" call policy (
http://boost.org/libs/python/doc/v2/return_internal_reference.html )
Tutorials to Py++ call policies:
http://language-binding.net/pyplusplus/documentation/functions/call_policies.html
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|