[C++-sig] Pyste: Resolution of order of exports.

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Tue Jul 8 06:33:19 CEST 2003


Hi,

I was thinking of something along these lines:

 1. While writing the module section for each class, also add a
    comment that contains all the bases in order (via ClassBases).
    Something like so:

// bases = [B, C, D]
void Export_A()

 2. I'll then read this 'bases' information when generating _main.cpp
    and then for each base, ensure that the order is such that each of
    the bases or ancestral bases is exported earlier.  I'm guessing
    that this should be fairly easy to do and does not seem too bad a
    hack to be considered inelegant.  It also eliminates the need to
    generate a separate file.  Is there a simpler way or an
    alternative?  Thoughts?

BTW, in your code you group the exporters based on the header used and
then sort the list based on Order.  I'm not sure that this approach is
guaranteed to work all the time since if the base is in another header
the sorting won't work.  However, I might be wrong and if you are sure
that it will work then we could do that, i.e. write the header info
and then the 'Order' then do the same thing that you do.

Will this approach work?  What do you folks think?

Thanks!

cheers,
prabhu




More information about the Cplusplus-sig mailing list