| 1 |
|
| 2 |
|
| 3 |
import sys |
| 4 |
|
| 5 |
import pybindgen |
| 6 |
from pybindgen import ReturnValue, Parameter, Module, Function, FileCodeSink |
| 7 |
from pybindgen import CppMethod, CppConstructor, CppClass, Enum |
| 8 |
|
| 9 |
|
| 10 |
def my_module_gen(out_file): |
| 11 |
mod = Module('a') |
| 12 |
mod.add_include('"a.h"') |
| 13 |
|
| 14 |
|
| 15 |
Base = mod.add_class("Base", allow_subclassing = True) |
| 16 |
Base.add_constructor([]) |
| 17 |
Base.add_method("do_something", None, [], is_virtual=True) |
| 18 |
|
| 19 |
mod.generate(FileCodeSink(out_file) ) |
| 20 |
|
| 21 |
if __name__ == '__main__': |
| 22 |
my_module_gen(sys.stdout) |