Re: [pygccxml-development] Code inserters/Arg policies
Brought to you by:
mbaas,
roman_yakovenko
From: Matthias B. <ba...@ir...> - 2006-08-08 14:01:03
|
Roman Yakovenko wrote: > One question: it is not clear how is registration will look like? I have added a section "Summary" that contains the full code for option 3 with additional comments: https://realityforge.vrsource.org/view/PyppApi/CodeInserter#Summary I have also slightly modified the code from option 3 so that now the default_spam() method looks the same as in the initial version (i.e. it doesn't need any code modifiers). >> Are there any use-cases I have forgotten? Are there >> > other options how this could be implemented? > > There is one more test I'd like to see: multiple inheritance. Could you please provide more details about that? Multiple inheritance in C++ or in Python? Who is deriving from who? And on what instance should the method call be made? > Also, it could be nice to see, how this policy plays well with other. > For example, return status as exception. Right, that's one of the next steps to examine at which places such policies need to add their own code. The above summary is supposed to help out with that. > mb = module_builder_t( ... ) > > spam = mb.member_function( '::Viking::spam' ) > spam.what I should write here in order to get the desired effect I think that should still be the decoration interface as already mentioned here: https://realityforge.vrsource.org/view/PyppApi/CodeInserter#Decoration That is, there should be at least one decoration operation that allows me to attach "code modifier" objects to one particular function. At this level the user doesn't even have to know about the problem with non-pure virtual functions, it just works the same as with non-virtual functions. Knowing about the details is only necessary when you want to write your own "code modifiers". > Did you use ctypes package? If not, try to find time and to read about it > ( http://starship.python.net/crew/theller/ctypes/ ). I think about > introducing > fundamental data types to boost.python library or to pyplusplus and > teaching py++ to generate Python code. With Python 2.5 ctypes will be part of the standard Python library, so at least it might be worth investigating if we could re-use some code here. But to be able to comment on it I would need to know more details about what you're planning on doing... - Matthias - |