Re: [pygccxml-development] cls.null_constructor_body bug?
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2008-09-10 18:57:07
|
On Wed, Sep 10, 2008 at 9:53 PM, Roman Yakovenko <rom...@gm...> wrote: > On Mon, Sep 8, 2008 at 4:04 PM, <bf...@co...> wrote: >> I am trying out to insert code into the py++ generated code as described in >> >> http://www.language-binding.net/pyplusplus/documentation/inserting_code.html >> >> Here is the relevant part of my codebuilder file: >> >> def inject_code( cls ): >> constructors = cls.constructors() >> constructors.body = "// (STUFF FOR ALL CONSTRUCTORS)" #class instance registration code >> cls.null_constructor_body = "// NULL CONSTRUCTORS STUFF " #class instance registration code >> cls.copy_constructor_body = "//COPY CONSTRUCTOR STUFF" #class instance registration code >> >> cls.add_wrapper_code("//WRAPPER STUFF" ) #destructor declaration and definition code >> cls.add_wrapper_code("//MORE WRAPPER STUFf") # the new class variable definition code >> >> x = mb.class_("MyClass") >> x.include() >> inject_code(x) >> >> The generated code does not contain the "// NULL CONSTRUCTORS STUFF ", though (see below). Is this a bug? > > Yes. I will try to fix it tomorrow. Sorry, forgot to provide work-around for you. It depends on version you use, but the solution is not that different: you can find out the constructor "type" and assign different code to "body". -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |