2
0
mirror of synced 2025-02-23 14:58:12 +00:00
mobile/bind/testdata/issue10788.go.golden
Hyang-Ah (Hana) Kim c261c465a9 bind: seq.Transact requires interface descriptor.
seq.Transact is called when Go calls a method of a foreign object
that implements a Go interface. Currently, we assume that the foreign
object has an instance method that can conduct the message routing,
so the object id and the method code is sufficient for transact.

Passing the interface descriptor (e.g.  go.testpkg.I) however allows
the bind internal to use non-instance methods to implement the routing.

Change-Id: I1f61a04f919fbd09117ea332d678cd50e4861e46
Reviewed-on: https://go-review.googlesource.com/12685
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-27 18:08:41 +00:00

84 lines
2.4 KiB
Plaintext

// Package go_issue10788 is an autogenerated binder stub for package issue10788.
// gobind -lang=go issue10788
//
// File is generated by gobind. Do not edit.
package go_issue10788
import (
"golang.org/x/mobile/bind/seq"
"issue10788"
)
const (
proxyTestInterface_Descriptor = "go.issue10788.TestInterface"
proxyTestInterface_DoSomeWork_Code = 0x10a
proxyTestInterface_MultipleUnnamedParams_Code = 0x20a
)
func proxyTestInterface_DoSomeWork(out, in *seq.Buffer) {
ref := in.ReadRef()
v := ref.Get().(issue10788.TestInterface)
// Must be a Go object
param_s_ref := in.ReadRef()
param_s := param_s_ref.Get().(*issue10788.TestStruct)
v.DoSomeWork(param_s)
}
func proxyTestInterface_MultipleUnnamedParams(out, in *seq.Buffer) {
ref := in.ReadRef()
v := ref.Get().(issue10788.TestInterface)
param_p0 := in.ReadInt()
param_p1 := in.ReadString()
param_p2 := in.ReadInt64()
v.MultipleUnnamedParams(param_p0, param_p1, param_p2)
}
func init() {
seq.Register(proxyTestInterface_Descriptor, proxyTestInterface_DoSomeWork_Code, proxyTestInterface_DoSomeWork)
seq.Register(proxyTestInterface_Descriptor, proxyTestInterface_MultipleUnnamedParams_Code, proxyTestInterface_MultipleUnnamedParams)
}
type proxyTestInterface seq.Ref
func (p *proxyTestInterface) DoSomeWork(s *issue10788.TestStruct) {
in := new(seq.Buffer)
in.WriteGoRef(s)
seq.Transact((*seq.Ref)(p), "go.issue10788.TestInterface", proxyTestInterface_DoSomeWork_Code, in)
}
func (p *proxyTestInterface) MultipleUnnamedParams(p0 int, p1 string, p2 int64) {
in := new(seq.Buffer)
in.WriteInt(p0)
in.WriteString(p1)
in.WriteInt64(p2)
seq.Transact((*seq.Ref)(p), "go.issue10788.TestInterface", proxyTestInterface_MultipleUnnamedParams_Code, in)
}
const (
proxyTestStruct_Descriptor = "go.issue10788.TestStruct"
proxyTestStruct_Value_Get_Code = 0x00f
proxyTestStruct_Value_Set_Code = 0x01f
)
type proxyTestStruct seq.Ref
func proxyTestStruct_Value_Set(out, in *seq.Buffer) {
ref := in.ReadRef()
v := in.ReadString()
ref.Get().(*issue10788.TestStruct).Value = v
}
func proxyTestStruct_Value_Get(out, in *seq.Buffer) {
ref := in.ReadRef()
v := ref.Get().(*issue10788.TestStruct).Value
out.WriteString(v)
}
func init() {
seq.Register(proxyTestStruct_Descriptor, proxyTestStruct_Value_Set_Code, proxyTestStruct_Value_Set)
seq.Register(proxyTestStruct_Descriptor, proxyTestStruct_Value_Get_Code, proxyTestStruct_Value_Get)
}
func init() {
}