| 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 |
import pybindgen.settings |
| 10 |
pybindgen.settings.deprecated_virtuals = False |
| 11 |
|
| 12 |
|
| 13 |
def my_module_gen(out_file): |
| 14 |
mod = Module('f') |
| 15 |
mod.add_include('"f.h"') |
| 16 |
|
| 17 |
FBase = mod.add_class('FBase', allow_subclassing=True) |
| 18 |
|
| 19 |
FBase.add_constructor([]) |
| 20 |
FBase.add_method('DoA', None, [], is_virtual=True, is_pure_virtual=True) |
| 21 |
FBase.add_method('PrivDoB', None, [], is_virtual=True, is_pure_virtual=True, visibility='private') |
| 22 |
FBase.add_method('DoB', None, []) |
| 23 |
|
| 24 |
mod.generate(FileCodeSink(out_file) ) |
| 25 |
|
| 26 |
if __name__ == '__main__': |
| 27 |
my_module_gen(sys.stdout) |