Documentation
¶
Overview ¶
wrapper implements the basic infrastructure to generate wrappers (of possible different output languages) from C/C++ libraries
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterPlugin ¶
RegisterPlugin installs a plugin for later use. returns an error if the same plugin is registered twice.
Types ¶
type FileDescriptor ¶
type FileDescriptor struct {
// name of this file descriptor, usually the library
// name (w/o prefix and suffix. ie: Foo, not libFoo.so)
Name string
// name of the package this file descriptor wraps
Package string
// name of the header containing the declarations for this library
Header string
// list of dependencies (pkgs, other file descriptors)
Dependency []string
// the products of the wrapping
Files map[string]io.WriteCloser
}
FileDescriptor describes a wrapper-output
type Generator ¶
type Generator struct {
Fd FileDescriptor
Args map[string]interface{}
// contains filtered or unexported fields
}
Generator is the type whose methods generate the output, stored in the associated response structure.
func NewGenerator ¶
func NewGenerator() *Generator
func (*Generator) GenerateAllFiles ¶
GenerateAllFiles generates the output for all the files we're outputting.
type Plugin ¶
type Plugin interface {
// Name identifies the plugin
Name() string
// Init is called once after data structures are built but before
// code generation begins.
Init(g *Generator) error
// Generate produces the code generated by the plugin for this file,
// by calling the generator's methods P, In, and Out.
Generate(file *FileDescriptor) error
}
A Plugin provides functionalities for code generation.
Click to show internal directories.
Click to hide internal directories.