Re: [pygccxml-development] code_repository package
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-09-19 18:23:33
|
On 9/19/06, Matthias Baas <ba...@ir...> wrote: > Roman Yakovenko wrote: > >> How do I influence whether a file is considered a system header or not? > > > > In creator_t, you add your header file using add_system_header API > > I suppose the header should only be created when it is required, right? file_writers package will do that for you. > I want to use it for the class that can acquire/release the Python GIL > (as you have suggested earlier). > So the actual decision whether the header is required or not is done by > the code creator (mem_fun_v_transformed_wrapper_t). What is your > recommendation how the code in creator_t (this is > visit_member_function(), right?) will know about this decision? It can search for "thread safe" transformer. The better idea to introduce next class: class ftransformer_t: keeps a list of all transformations that should be applied on the function at once provides some additional functionality: function signature has_thread_safe_transformer ... Than 1. Creator will use it to ask the right question 2. It will be possible to have more than 1 "f" transformation applied on the same function: for example "status as exception" struct status{}; void do_smth( status& ) In some cases it makes sence to expose "do_smth" function as is and to expose some convinience function that will raise an exception. > Just to see if the file gets written or not I called add_system_header() > and adopt_creator() on every call to visit_member_function(), but then I > get a huge list of identical include statements in the generated files. I don't fully understand what you are doing here. > What I would actually like to do is to add the "include" code creator to > the associated_decl_creators list of the corresponding class so that the > include only shows up in the file where it is needed. But how can I > check whether the file was already included or not? If we talk about system header than you can ask module_t code creator ( creator_t.__extmodule ) is_system_header. You can also "include" the header from "_create_includes" method. > I wonder why there is no specific API for managing include files that > handles all those stuff? It appears to me that this would be quite a > useful thing to have. Lack of time and low priority. Users learned to leave with "non optimal" generated code. I mean that all include appears in all header files. But they don't like Py++, when it does not support the functionality they needed. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |