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 09:26:41
|
Roman Yakovenko wrote: >> 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). > > Not a best solution. I think you missed the trivial solution. Please > read this document > http://language-binding.net/pyplusplus/documentation/architecture.html > and then search for associated_decl_creators string within the package. So the associated_decl_creators property seems to be what I meant above (a way to specify that a particular code creator belongs to the same file than a particular class). :) But there's another problem now. How can the member function creator obtain a reference to its parent class creator (so that it can access the associated_decl_creators property) or rather: *when* can it do that? During construction of the member function creator it is not yet added to the code creator tree, so its "parent" property isn't initialized yet. And when it is added later on it doesn't get notified about this and I haven't seen another place where it could do initializations. The only methods I've seen are called after create() has been called and at that time we're already at the stage when the files are written, so that's too late for adding something to associated_decl_creators. - Matthias - |