| //////////////////////////////////////////////////////////////////////////////// |
| // Do not modify! |
| // Generated by codergen -go |
| //////////////////////////////////////////////////////////////////////////////// |
| |
| package database |
| |
| import ( |
| "android.googlesource.com/platform/tools/gpu/binary" |
| "android.googlesource.com/platform/tools/gpu/binary/registry" |
| "android.googlesource.com/platform/tools/gpu/binary/schema" |
| ) |
| |
| func init() { |
| registry.Add((*testRequest)(nil).Class()) |
| registry.Add((*testResource)(nil).Class()) |
| } |
| |
| var ( |
| binaryIDtestRequest = binary.ID{0xeb, 0x22, 0x94, 0x6d, 0xc2, 0x60, 0x9a, 0x2a, 0x77, 0xe3, 0x55, 0xbd, 0x64, 0xb3, 0xe0, 0x50, 0x18, 0xf6, 0xdf, 0x32} |
| binaryIDtestResource = binary.ID{0xb3, 0x21, 0x8c, 0xc0, 0x87, 0x2e, 0x74, 0x3a, 0xc4, 0x68, 0xe1, 0x50, 0xc7, 0xe4, 0xc4, 0xea, 0x6f, 0xd2, 0xd1, 0x95} |
| ) |
| |
| type binaryClasstestRequest struct{} |
| |
| func (*testRequest) Class() binary.Class { |
| return (*binaryClasstestRequest)(nil) |
| } |
| func doEncodetestRequest(e binary.Encoder, o *testRequest) error { |
| if err := e.Int32(int32(o.Id)); err != nil { |
| return err |
| } |
| return nil |
| } |
| func doDecodetestRequest(d binary.Decoder, o *testRequest) error { |
| if obj, err := d.Int32(); err != nil { |
| return err |
| } else { |
| o.Id = int(obj) |
| } |
| return nil |
| } |
| func doSkiptestRequest(d binary.Decoder) error { |
| if _, err := d.Int32(); err != nil { |
| return err |
| } |
| return nil |
| } |
| func (*binaryClasstestRequest) ID() binary.ID { return binaryIDtestRequest } |
| func (*binaryClasstestRequest) New() binary.Object { return &testRequest{} } |
| func (*binaryClasstestRequest) Encode(e binary.Encoder, obj binary.Object) error { |
| return doEncodetestRequest(e, obj.(*testRequest)) |
| } |
| func (*binaryClasstestRequest) Decode(d binary.Decoder) (binary.Object, error) { |
| obj := &testRequest{} |
| return obj, doDecodetestRequest(d, obj) |
| } |
| func (*binaryClasstestRequest) DecodeTo(d binary.Decoder, obj binary.Object) error { |
| return doDecodetestRequest(d, obj.(*testRequest)) |
| } |
| func (*binaryClasstestRequest) Skip(d binary.Decoder) error { return doSkiptestRequest(d) } |
| func (*binaryClasstestRequest) Schema() *schema.Class { return schematestRequest } |
| |
| var schematestRequest = &schema.Class{ |
| TypeID: binaryIDtestRequest, |
| Name: "testRequest", |
| Fields: []schema.Field{ |
| {Declared: "Id", Type: &schema.Primitive{Name: "int", Method: schema.Int32}}, |
| }, |
| } |
| |
| type binaryClasstestResource struct{} |
| |
| func (*testResource) Class() binary.Class { |
| return (*binaryClasstestResource)(nil) |
| } |
| func doEncodetestResource(e binary.Encoder, o *testResource) error { |
| if err := e.Int32(int32(o.Int)); err != nil { |
| return err |
| } |
| if err := e.String(o.String); err != nil { |
| return err |
| } |
| if err := e.Uint32(uint32(len(o.Array))); err != nil { |
| return err |
| } |
| for i := range o.Array { |
| if err := e.Bool(o.Array[i]); err != nil { |
| return err |
| } |
| } |
| return nil |
| } |
| func doDecodetestResource(d binary.Decoder, o *testResource) error { |
| if obj, err := d.Int32(); err != nil { |
| return err |
| } else { |
| o.Int = int(obj) |
| } |
| if obj, err := d.String(); err != nil { |
| return err |
| } else { |
| o.String = string(obj) |
| } |
| if count, err := d.Uint32(); err != nil { |
| return err |
| } else { |
| o.Array = make([]bool, count) |
| for i := range o.Array { |
| if obj, err := d.Bool(); err != nil { |
| return err |
| } else { |
| o.Array[i] = bool(obj) |
| } |
| } |
| } |
| return nil |
| } |
| func doSkiptestResource(d binary.Decoder) error { |
| if _, err := d.Int32(); err != nil { |
| return err |
| } |
| if err := d.SkipString(); err != nil { |
| return err |
| } |
| if count, err := d.Uint32(); err != nil { |
| return err |
| } else { |
| for i := uint32(0); i < count; i++ { |
| if _, err := d.Bool(); err != nil { |
| return err |
| } |
| } |
| } |
| return nil |
| } |
| func (*binaryClasstestResource) ID() binary.ID { return binaryIDtestResource } |
| func (*binaryClasstestResource) New() binary.Object { return &testResource{} } |
| func (*binaryClasstestResource) Encode(e binary.Encoder, obj binary.Object) error { |
| return doEncodetestResource(e, obj.(*testResource)) |
| } |
| func (*binaryClasstestResource) Decode(d binary.Decoder) (binary.Object, error) { |
| obj := &testResource{} |
| return obj, doDecodetestResource(d, obj) |
| } |
| func (*binaryClasstestResource) DecodeTo(d binary.Decoder, obj binary.Object) error { |
| return doDecodetestResource(d, obj.(*testResource)) |
| } |
| func (*binaryClasstestResource) Skip(d binary.Decoder) error { return doSkiptestResource(d) } |
| func (*binaryClasstestResource) Schema() *schema.Class { return schematestResource } |
| |
| var schematestResource = &schema.Class{ |
| TypeID: binaryIDtestResource, |
| Name: "testResource", |
| Fields: []schema.Field{ |
| {Declared: "Int", Type: &schema.Primitive{Name: "int", Method: schema.Int32}}, |
| {Declared: "String", Type: &schema.Primitive{Name: "string", Method: schema.String}}, |
| {Declared: "Array", Type: &schema.Slice{Alias: "", ValueType: &schema.Primitive{Name: "bool", Method: schema.Bool}}}, |
| }, |
| } |