| //////////////////////////////////////////////////////////////////////////////// |
| // Do not modify! |
| // Generated by codergen |
| //////////////////////////////////////////////////////////////////////////////// |
| |
| package msg |
| |
| import ( |
| "android.googlesource.com/platform/tools/gpu/framework/binary" |
| "android.googlesource.com/platform/tools/gpu/framework/binary/registry" |
| "android.googlesource.com/platform/tools/gpu/framework/id" |
| ) |
| |
| // Make sure schema init() runs first |
| import _ "android.googlesource.com/platform/tools/gpu/framework/binary/schema" |
| |
| // force use the id package, because our imports handling is wrong |
| var _ id.ID |
| |
| const ( |
| ixǁMsg = iota |
| ) |
| |
| var entities [1]binary.Entity |
| |
| var Namespace = registry.NewNamespace() |
| |
| func init() { |
| registry.Global.AddFallbacks(Namespace) |
| Namespace.AddClassOf((*Msg)(nil)) |
| } |
| |
| type binaryClassMsg struct{} |
| |
| func (*Msg) Class() binary.Class { |
| return (*binaryClassMsg)(nil) |
| } |
| func doEncodeMsg(e binary.Encoder, o *Msg) { |
| e.String(o.Identifier) |
| e.Uint32(uint32(len(o.Arguments))) |
| for _, k := range (o.Arguments).KeysSorted() { |
| v := (o.Arguments)[k] |
| e.String(k) |
| e.Object(v) |
| } |
| } |
| func doDecodeMsg(d binary.Decoder, o *Msg) { |
| o.Identifier = string(d.String()) |
| if count := d.Count(); count > 0 { |
| o.Arguments = make(MapType, count) |
| m := o.Arguments |
| for i := uint32(0); i < count; i++ { |
| var k string |
| var v binary.Object |
| k = string(d.String()) |
| v = binary.ObjectCast(d.Object()) |
| m[k] = v |
| } |
| } |
| } |
| func (*binaryClassMsg) Encode(e binary.Encoder, obj binary.Object) { |
| doEncodeMsg(e, obj.(*Msg)) |
| } |
| func (*binaryClassMsg) New() binary.Object { |
| return &Msg{} |
| } |
| func (*binaryClassMsg) DecodeTo(d binary.Decoder, obj binary.Object) { |
| doDecodeMsg(d, obj.(*Msg)) |
| } |
| func (c *binaryClassMsg) Schema() *binary.Entity { |
| return &entities[ixǁMsg] |
| } |