seq

package
v0.0.0-...-2824937 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: MIT, BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package seq implements the machine-dependent seq serialization format.

Implementations of Transact and FinalizeRef are provided by a specific foreign language binding package, e.g. go.mobile/bind/java.

Designed only for use by the code generated by gobind. Don't try to use this directly.

Index

Constants

This section is empty.

Variables

View Source
var DecString func(in *Buffer) string

DecString decodes a string encoded in the Buffer.

View Source
var EncString func(out *Buffer, v string)

EncString encodes a Go string into the Buffer.

View Source
var FinalizeRef func(ref *Ref)

FinalizeRef is the finalizer used on foreign objects.

View Source
var Registry = make(map[string]map[int]Func)

Registry holds functions callable from gobind generated bindings. Functions are keyed by descriptor and function code.

View Source
var Transact func(ref *Ref, desc string, code int, in *Buffer) (out *Buffer)

Transact calls a method on a foreign object instance. It blocks until the call is complete.

Functions

func Delete

func Delete(num int32)

Delete decrements the reference count and removes the pinned object from the object map when the reference count becomes zero.

func Register

func Register(descriptor string, code int, fn Func)

Register registers a function in the Registry.

Types

type Buffer

type Buffer struct {
	Data   []byte
	Offset int // position of next read/write from Data
}

Buffer is a set of arguments or return values from a function call across the language boundary. Encoding is machine-dependent.

func (*Buffer) ReadBool

func (b *Buffer) ReadBool() bool

func (*Buffer) ReadByteArray

func (b *Buffer) ReadByteArray() []byte

func (*Buffer) ReadError

func (b *Buffer) ReadError() error

func (*Buffer) ReadFloat32

func (b *Buffer) ReadFloat32() float32

func (*Buffer) ReadFloat64

func (b *Buffer) ReadFloat64() float64

func (*Buffer) ReadInt

func (b *Buffer) ReadInt() int

func (*Buffer) ReadInt16

func (b *Buffer) ReadInt16() int16

func (*Buffer) ReadInt32

func (b *Buffer) ReadInt32() int32

func (*Buffer) ReadInt64

func (b *Buffer) ReadInt64() int64

func (*Buffer) ReadInt8

func (b *Buffer) ReadInt8() int8

func (*Buffer) ReadRef

func (b *Buffer) ReadRef() *Ref

func (*Buffer) ReadString

func (b *Buffer) ReadString() string

func (*Buffer) ReadUTF16

func (b *Buffer) ReadUTF16() string

func (*Buffer) ReadUTF8

func (b *Buffer) ReadUTF8() string

func (*Buffer) String

func (b *Buffer) String() string

func (*Buffer) WriteBool

func (b *Buffer) WriteBool(v bool)

func (*Buffer) WriteByteArray

func (b *Buffer) WriteByteArray(byt []byte)

func (*Buffer) WriteFloat32

func (b *Buffer) WriteFloat32(v float32)

func (*Buffer) WriteFloat64

func (b *Buffer) WriteFloat64(v float64)

func (*Buffer) WriteGoRef

func (b *Buffer) WriteGoRef(obj interface{})

func (*Buffer) WriteInt

func (b *Buffer) WriteInt(v int)

func (*Buffer) WriteInt16

func (b *Buffer) WriteInt16(v int16)

func (*Buffer) WriteInt32

func (b *Buffer) WriteInt32(v int32)

func (*Buffer) WriteInt64

func (b *Buffer) WriteInt64(v int64)

func (*Buffer) WriteInt8

func (b *Buffer) WriteInt8(v int8)

func (*Buffer) WriteString

func (b *Buffer) WriteString(v string)

func (*Buffer) WriteUTF16

func (b *Buffer) WriteUTF16(s string)

func (*Buffer) WriteUTF8

func (b *Buffer) WriteUTF8(s string)

type Func

type Func func(out, in *Buffer)

A Func can be registered and called by a foreign language.

type Ref

type Ref struct {
	Num int32
}

A Ref represents a Java or Go object passed across the language boundary.

func (*Ref) Get

func (r *Ref) Get() interface{}

Get returns the underlying object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL