wrapper

package
Version: v0.0.0-...-9750f98 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2012 License: BSD-2-Clause Imports: 2 Imported by: 0

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

func RegisterPlugin(p Plugin) error

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

func (g *Generator) GenerateAllFiles() error

GenerateAllFiles generates the output for all the files we're outputting.

func (*Generator) P

func (g *Generator) P(str ...interface{})

P prints the arguments to the generated output

func (*Generator) Plugins

func (g *Generator) Plugins() []string

Plugins returns the names of the active plugins

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.

Directories

Path Synopsis
plugins

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL