| 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 |
|
| 12 |
mod = Module('b') |
| 13 |
mod.add_include('"b.h"') |
| 14 |
|
| 15 |
B = mod.add_class('B') |
| 16 |
B.add_constructor([]) |
| 17 |
B.add_copy_constructor() |
| 18 |
B.add_instance_attribute('b_a', ReturnValue.new('uint32_t')) |
| 19 |
B.add_instance_attribute('b_b', ReturnValue.new('uint32_t')) |
| 20 |
|
| 21 |
mod.add_function('BDoA', None, [Parameter.new('B', 'b')]) |
| 22 |
mod.add_function('BDoB', ReturnValue.new('B'), []) |
| 23 |
|
| 24 |
mod.generate(FileCodeSink(out_file) ) |
| 25 |
|
| 26 |
if __name__ == '__main__': |
| 27 |
my_module_gen(sys.stdout) |