seq

package
v0.0.0-...-d3739f8 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: BSD-3-Clause Imports: 5 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

View Source
const NullRefNum = 41

also known to bind/java/Seq.java and bind/objc/seq_darwin.m

Variables

View Source
var FinalizeRef func(ref *Ref)

FinalizeRef is the finalizer used on foreign objects.

View Source
var IncForeignRef func(refnum int32)

IncRef increments the foreign reference count for ref while it is in transit. The count is decremented after the ref is received and translated on the foreign side.

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 Inc

func Inc(num int32)

Inc increments the reference count for a refnum. Called from Bind_proxy_refnum functions.

func ToRefNum

func ToRefNum(obj interface{}) int32

ToRefNum increments the reference count for an object and returns its refnum.

func UTF16Encode

func UTF16Encode(s string, chars []uint16) int

UTF16Encode utf16 encodes s into chars. It returns the resulting length in units of uint16. It is assumed that the chars slice has enough room for the encoded string.

Types

type Ref

type Ref struct {
	Bind_Num int32
}

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

func FromRefNum

func FromRefNum(num int32) *Ref

FromRefNum returns the Ref for a refnum. If the refnum specifies a foreign object, a finalizer is set to track its lifetime.

func (*Ref) Bind_IncNum

func (r *Ref) Bind_IncNum() int32

Bind_IncNum increments the foreign reference count and return the refnum.

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