Re: [pygccxml-development] How to add a new function to an individual file?
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-09-10 09:00:49
|
On 9/10/06, Matthias Baas <ba...@ir...> wrote: > > Hi, > > 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. As far as I can tell there > doesn't seem to be a way to add a node to the code creator tree that > will only appear in the source file for one specific class. Read documentation please :-) http://language-binding.net/pyplusplus/documentation/inserting_code.html#insert-code-to-class Would it be possible that during the creation of the code creator tree > Py++ also creates special nodes such as, for example, translation_unit_t > which marks the root of everything that goes into a particular file? > Each wrapper class node would then be a children of the corresponding > translation unit node. > Instead of filtering out class nodes the multiple file writer would then > have to filter out the translation unit nodes and stick everything > beneath such a node into one file. That way, the user would have the > option to put arbitrary nodes into one specific file. This will not work. Take a few minutes to think about and if you don't understand why, I will provide the answer. Or is there already a simple workaround to get the above behavior? Yes, it is described in documentation. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |