blob: 7be863794a3438ff9ec1c4db7a1952bf413c315e [file] [log] [blame]
////////////////////////////////////////////////////////////////////////////////
// Do not modify!
// Generated by codergen
////////////////////////////////////////////////////////////////////////////////
package test
import (
"android.googlesource.com/platform/tools/gpu/binary/registry"
"android.googlesource.com/platform/tools/gpu/log"
"android.googlesource.com/platform/tools/gpu/multiplexer"
"android.googlesource.com/platform/tools/gpu/rpc"
)
// Client is the client interface for RPC calls.
type Client interface {
// Client exposes all the RPC interface methods.
RPC
// Multiplexer returns the multiplexer used for communication to the server.
Multiplexer() *multiplexer.Multiplexer
// Namespace returns the custom namespace used for decoding responses from the
// server, or nil if no custom namespace has been specified.
Namespace() *registry.Namespace
}
type client struct{ rpc.Client }
// NewClient creates a new rpc client object that uses the multiplexer m for
// communication the namespace n for decoding objects. If n is nil then the
// global namespace is used.
func NewClient(m *multiplexer.Multiplexer, n *registry.Namespace) Client {
return client{rpc.NewClient(m, n)}
}
// Client compliance
func (c client) Add(a uint32, b uint32, l log.Logger) (res uint32, err error) {
var val interface{}
if val, err = c.Send(&callAdd{a: a, b: b}); err == nil {
res = val.(*resultAdd).value
} else {
log.Errorf(l, "RPC Add failed with error: %v", err)
}
return
}
func (c client) EnumToString(e Enum, l log.Logger) (res string, err error) {
var val interface{}
if val, err = c.Send(&callEnumToString{e: e}); err == nil {
res = val.(*resultEnumToString).value
} else {
log.Errorf(l, "RPC EnumToString failed with error: %v", err)
}
return
}
func (c client) GetListNodeChain(l log.Logger) (res *ListNode, err error) {
var val interface{}
if val, err = c.Send(&callGetListNodeChain{}); err == nil {
res = val.(*resultGetListNodeChain).value
} else {
log.Errorf(l, "RPC GetListNodeChain failed with error: %v", err)
}
return
}
func (c client) GetListNodeChainArray(l log.Logger) (res []*ListNode, err error) {
var val interface{}
if val, err = c.Send(&callGetListNodeChainArray{}); err == nil {
res = val.(*resultGetListNodeChainArray).value
} else {
log.Errorf(l, "RPC GetListNodeChainArray failed with error: %v", err)
}
return
}
func (c client) GetResource(l log.Logger) (res ResourceID, err error) {
var val interface{}
if val, err = c.Send(&callGetResource{}); err == nil {
res = val.(*resultGetResource).value
} else {
log.Errorf(l, "RPC GetResource failed with error: %v", err)
}
return
}
func (c client) GetSingleListNode(l log.Logger) (res *ListNode, err error) {
var val interface{}
if val, err = c.Send(&callGetSingleListNode{}); err == nil {
res = val.(*resultGetSingleListNode).value
} else {
log.Errorf(l, "RPC GetSingleListNode failed with error: %v", err)
}
return
}
func (c client) GetStruct(l log.Logger) (res Struct, err error) {
var val interface{}
if val, err = c.Send(&callGetStruct{}); err == nil {
res = val.(*resultGetStruct).value
} else {
log.Errorf(l, "RPC GetStruct failed with error: %v", err)
}
return
}
func (c client) ResolveResource(r ResourceID, l log.Logger) (res Resource, err error) {
var val interface{}
if val, err = c.Send(&callResolveResource{r: r}); err == nil {
res = val.(*resultResolveResource).value
} else {
log.Errorf(l, "RPC ResolveResource failed with error: %v", err)
}
return
}
func (c client) SetStruct(s Struct, l log.Logger) error {
_, err := c.Send(&callSetStruct{s: s})
return err
}
func (c client) UseResource(r ResourceID, l log.Logger) error {
_, err := c.Send(&callUseResource{r: r})
return err
}