Re: [pygccxml-development] Splitting main
Brought to you by:
mbaas,
roman_yakovenko
From: Allen B. <al...@vr...> - 2006-09-03 23:24:32
|
Roman Yakovenko wrote: > On 9/3/06, Allen Bierbaum <al...@vr...> wrote: >> Is there anyway to ask pyplusplus to split the module registration code >> in the module.main.cpp file? >> >> I have a huge number of implicit conversions, ptr_to_python and >> overloaded methods that need to be registered. (5 per class in the >> library) Right now I am registering those all in the main module >> registration section (by adding code through the module builder). The >> generated code works but it takes forever to compile this file. > > You can generate some cpp and header file and add the call to the main. > > mb.add_declaration_code( 'extern void register_my_xxx();' ) > mb.add_registration_code( ' register_my_xxx();' ) Although this would work I would rather generate all the code at the same time from the same generation script using py++. As I understand this option I would have to generate the global scope methods separately. > In this way you don't have to introduce include or something else. >> In my specific case it would also work to register these methods inside >> the register_XXX_class() method that is created for each exposed class, >> but I would need a way to guarantee that the methods get registered >> against the global module scope. > > Why? So the registered methods and conversions show up in the scope of the main module. Or can I register a global scope method within the class registration code? -Allen |