Re: [pygccxml-development] How to add a new function to an individual file?
Brought to you by:
mbaas,
roman_yakovenko
|
From: Matthias B. <ba...@ir...> - 2006-09-11 07:57:04
|
Roman Yakovenko wrote: >> I'm currently trying to support the function transformers on non-virtual >> functions (i.e. mem_fun_t). It works fine when the corresponding class >> also has virtual functions so that a wrapper class gets created anyway >> and there's a place where I can stick the wrapper for the non-virtual >> function. But if Py++ does not create a wrapper then there's no "hook" >> where I could add the wrapper function. > > In this case Py++ should create wrapper. You mean a wrapper class, not a wrapper function, right? > The code that finds out > whether wrapper is > needed or not should be moved from the factory ( > module_creator.creator_t ) to the decl_wrapper.class_t. This is a > re-factoring that should be done. I agree that this refactoring is desirable and should be done, but it won't provide a solution to my current problem (only a workaround). I only want to make the wrapper function (i.e. a free function, not a member function) available in the corresponding source file so that it can be referenced in the registration function for the class. I don't want to force Py++ to create a wrapper class when it's not absolutely necessary. So this either requires something like class_t.add_declaration_code() that is also available at the time the code creator tree is built or a way to specify the file that a particular code creator object belongs to (personally, I think the latter would be more intuitive and fit the framework better as we're already dealing with code that happens after the decoration stage). - Matthias - |