Files
pybindgen/examples/cross_module_inheritance/Bgen.py
T
Mike Owen 37dcfcb514 Adding the beginnings of an example for cross module inheritance. Not
building yet 'cause I don't  understand waf.  Why does every project I
look at use a different build system!
2012-12-10 23:26:25 -08:00

21 lines
533 B
Python

from pybindgen import *
from ModuleGenerationFactory import *
import Agen
# Module
mod = Module("B")
mod.add_include('"classes.hh"')
mod.add_include('"A.hh"')
# Derived
mod.begin_section("B_DerivedBindings")
Derived = mod.add_class("Derived", allow_subclassing = True, parent = Agen.Base)
Derived.add_constructor([])
Derived.add_method("do_something", None, [], is_virtual=True)
mod.end_section("B_DerivedBindings")
# Generate the code.
out = ModuleGenerationFactory("B.C", ["DerivedBindings"])
mod.generate(out, "B")
out.close()