Re: [pygccxml-development] Feature proposal: "Argument policies"
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-04-26 06:58:42
|
On 4/24/06, Matthias Baas <ba...@ir...> wrote: > > If so, what interface you give to the user? Direct access to the code c= reator? > > I am not talking about wm.declare_local( ... ), as for me this is too > > low-level. > > Policies that are independent of a particular project (such as Output, > OutputArray, InputArray, etc) can be made part of pyplusplus and a user > can use them for his own project. In this case, the user doesn't have to > know how argument policies work internally. > If the standard policies don't fit the bill of the user, he has the > option to write his own policies. Now the user must be familiar with the > internals of the policy mechanism. > > > Small comment about clean_up( :-) ) state. > > In C++ developers can use RIIA technique. So I think, that clean up > > state is nessecary. > > Should that read "is not necessary"...? Yes of course. > > > I don't want to force developers to use it, but I > > also don't want to provide "too mach" help with hand written clean up a= ctions. > > What do you mean? Are you for or against the cleanup() method? (by the > way, currently I don't have this implemented yet anyway as my current > policies don't need any cleanup. But as soon as you have to allocate > memory it might get necessary) std::auto_ptr, boost::scoped_ptr, boost::shared_ptr ( with custom deleter ) should work Okay. I glad we understand each other and has an agreement. Can you start working on this. I mean prepare use-cases and what code shoul= d be generated. I think we will start with one common use-case: int read( int size, char* buffer ) and simple use case: error status translated to exception. I am working on function_t function_wrapper_t code creators. If you don't mind can you create: - C++ code for unit test - C++ generated code ( this will guide us what code creators should do ) - configuration pseudo code. I mean from user point of view: mb =3D module_builder_t( ... ) mf =3D mb.member_function( ... ) mf.args_policies =3D ???????? I hope, I will finish with my task in the middle of next week. After this we can start to work on code generation. What do you think? Do you agree with the plan? May be you prefer to do something else? > - Matthias - -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |