| //////////////////////////////////////////////////////////////////////////////// |
| // Do not modify! |
| // Generated by codergen |
| //////////////////////////////////////////////////////////////////////////////// |
| |
| package test |
| |
| import ( |
| "android.googlesource.com/platform/tools/gpu/binary" |
| "android.googlesource.com/platform/tools/gpu/binary/registry" |
| "android.googlesource.com/platform/tools/gpu/binary/schema" |
| ) |
| |
| var Namespace = registry.NewNamespace() |
| |
| func init() { |
| registry.Global.AddFallbacks(Namespace) |
| Namespace.Add((*TypeA)(nil).Class()) |
| Namespace.Add((*TypeB)(nil).Class()) |
| } |
| |
| var ( |
| TypeAID = binary.ID{0x29, 0x0a, 0x4b, 0x25, 0x7d, 0x55, 0xab, 0x2b, 0x8f, 0x03, 0x32, 0x53, 0x7f, 0xd8, 0x66, 0x69, 0xbc, 0x77, 0x07, 0x98} |
| TypeBID = binary.ID{0x04, 0x84, 0xdf, 0x7d, 0x88, 0x25, 0xef, 0x43, 0xf7, 0x71, 0x3c, 0x5c, 0x03, 0x2b, 0xe0, 0xfd, 0x42, 0x1f, 0x6e, 0x87} |
| ) |
| |
| type binaryClassTypeA struct{} |
| |
| func (*TypeA) Class() binary.Class { |
| return (*binaryClassTypeA)(nil) |
| } |
| func doEncodeTypeA(e binary.Encoder, o *TypeA) error { |
| if err := e.String(o.Data); err != nil { |
| return err |
| } |
| return nil |
| } |
| func doDecodeTypeA(d binary.Decoder, o *TypeA) error { |
| if obj, err := d.String(); err != nil { |
| return err |
| } else { |
| o.Data = string(obj) |
| } |
| return nil |
| } |
| func doSkipTypeA(d binary.Decoder) error { |
| if err := d.SkipString(); err != nil { |
| return err |
| } |
| return nil |
| } |
| func (*binaryClassTypeA) ID() binary.ID { return TypeAID } |
| func (*binaryClassTypeA) New() binary.Object { return &TypeA{} } |
| func (*binaryClassTypeA) Encode(e binary.Encoder, obj binary.Object) error { |
| return doEncodeTypeA(e, obj.(*TypeA)) |
| } |
| func (*binaryClassTypeA) Decode(d binary.Decoder) (binary.Object, error) { |
| obj := &TypeA{} |
| return obj, doDecodeTypeA(d, obj) |
| } |
| func (*binaryClassTypeA) DecodeTo(d binary.Decoder, obj binary.Object) error { |
| return doDecodeTypeA(d, obj.(*TypeA)) |
| } |
| func (*binaryClassTypeA) Skip(d binary.Decoder) error { return doSkipTypeA(d) } |
| func (*binaryClassTypeA) Schema() *schema.Class { return schemaTypeA } |
| |
| var schemaTypeA = &schema.Class{ |
| TypeID: TypeAID, |
| Package: "test", |
| Name: "TypeA", |
| Fields: []schema.Field{ |
| {Declared: "Data", Type: &schema.Primitive{Name: "string", Method: schema.String}}, |
| }, |
| } |
| |
| type binaryClassTypeB struct{} |
| |
| func (*TypeB) Class() binary.Class { |
| return (*binaryClassTypeB)(nil) |
| } |
| func doEncodeTypeB(e binary.Encoder, o *TypeB) error { |
| if err := e.String(o.Data); err != nil { |
| return err |
| } |
| return nil |
| } |
| func doDecodeTypeB(d binary.Decoder, o *TypeB) error { |
| if obj, err := d.String(); err != nil { |
| return err |
| } else { |
| o.Data = string(obj) |
| } |
| return nil |
| } |
| func doSkipTypeB(d binary.Decoder) error { |
| if err := d.SkipString(); err != nil { |
| return err |
| } |
| return nil |
| } |
| func (*binaryClassTypeB) ID() binary.ID { return TypeBID } |
| func (*binaryClassTypeB) New() binary.Object { return &TypeB{} } |
| func (*binaryClassTypeB) Encode(e binary.Encoder, obj binary.Object) error { |
| return doEncodeTypeB(e, obj.(*TypeB)) |
| } |
| func (*binaryClassTypeB) Decode(d binary.Decoder) (binary.Object, error) { |
| obj := &TypeB{} |
| return obj, doDecodeTypeB(d, obj) |
| } |
| func (*binaryClassTypeB) DecodeTo(d binary.Decoder, obj binary.Object) error { |
| return doDecodeTypeB(d, obj.(*TypeB)) |
| } |
| func (*binaryClassTypeB) Skip(d binary.Decoder) error { return doSkipTypeB(d) } |
| func (*binaryClassTypeB) Schema() *schema.Class { return schemaTypeB } |
| |
| var schemaTypeB = &schema.Class{ |
| TypeID: TypeBID, |
| Package: "test", |
| Name: "TypeB", |
| Fields: []schema.Field{ |
| {Declared: "Data", Type: &schema.Primitive{Name: "string", Method: schema.String}}, |
| }, |
| } |