On 9/21/06, Matthias Baas <ba...@ir...> wrote:
> rom...@us... wrote:
> > Log Message:
> > -----------
> > adding support for associated_decl_creators to file writers
>
> Can you please elaborate on those changes and let me know what a user
> has to do to adapt to those modifications?
> Currently, it seems that the code creators that I add to the
> associated_decl_creators list don't get written anymore.
Yes of course. First of all I committed new version that should fix the problem.
(Also the generated code for some reason is not formatted at all)
- # Are we dealing with transformed non-virtual member functions?
- if maker_cls==code_creators.mem_fun_transformed_t:
- # Create the code creator that generates the function source code
- fwrapper =
code_creators.mem_fun_transformed_wrapper_t(self.curr_decl)
- # and add it either to the wrapper class or just to the declaration
- # area of the cpp file
- if self.curr_code_creator.wrapper is None:
-
self.curr_code_creator.associated_decl_creators.append(fwrapper)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You had bug in this line. You did not added fwrapper to code creators tree.
Thus you did not defined its logical place. Thus
multiple_files_t.associated_decl_creators
ignored it.
- else:
- self.curr_code_creator.wrapper.adopt_creator(fwrapper)
- # Set the wrapper so that the registration code will refer to it
- maker.wrapper = fwrapper
The way I fixed it is to generate class wrapper for this case.
In general the idea behind the change is simple: almost every
registration requires
additional functionality ( wrappers, opaque type registration, overload macro ).
These wrappers should be generated in the same file, in the global namespace
where the declaration registration will be generated. In order to
simplify file writers
and to solve some other problems( generate include directive in this
or that header, for
example ) I added new concept: every "registration_based" code creator
will keep a list of
associated creators and file writers will be aware of this creators
and will generate
right code.
Hope I was clear.
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|