autowrap.python.boilerplate

Necessary boilerplate for pyd.

To wrap all functions/return/parameter types and struct/class definitions from a list of modules, write this in a "main" module and generate mylib.{so,dll}:

mixin wrapAll!(LibraryName("mylib"), Modules("module1", "module2", ...));

Members

Functions

pydInitMixin
string pydInitMixin(in string libraryName)

A string to be mixed in that defines the PyInit function for a library.

pydMainMixin
string pydMainMixin(in Modules modules, in PreModuleInitCode preModuleInitCode = PreModuleInitCode(), in PostModuleInitCode postModuleInitCode = PostModuleInitCode())

A string to be mixed in that defines PydMain, automatically registering all functions and structs in the passed in modules.

wrapAll
string wrapAll(in LibraryName libraryName, in Modules modules, in PreModuleInitCode preModuleInitCode = PreModuleInitCode(), in PostModuleInitCode postModuleInitCode = PostModuleInitCode())

A string to be mixed in that defines all the necessary runtime pyd boilerplate.

Structs

LibraryName
struct LibraryName

The name of the dynamic library, i.e. the file name with the .so/.dll extension

Modules
struct Modules

The list of modules to automatically wrap for Python consumption

PostModuleInitCode
struct PostModuleInitCode

Code to be inserted after the call to module_init

PreModuleInitCode
struct PreModuleInitCode

Code to be inserted before the call to module_init

Meta