blob: 538baafb480db7af462b88602210825e016cd659 [file] [log] [blame]
////////////////////////////////////////////////////////////////////////////////
// Do not modify!
// Generated by codergen
////////////////////////////////////////////////////////////////////////////////
package schema
import (
"android.googlesource.com/platform/tools/gpu/binary"
"android.googlesource.com/platform/tools/gpu/binary/any"
"android.googlesource.com/platform/tools/gpu/binary/registry"
)
var Namespace = registry.NewNamespace()
func init() {
registry.Global.AddFallbacks(Namespace)
Namespace.Add((*Array)(nil).Class())
Namespace.Add((*Field)(nil).Class())
Namespace.Add((*Class)(nil).Class())
Namespace.Add((*Constant)(nil).Class())
Namespace.Add((*ConstantSet)(nil).Class())
Namespace.Add((*Interface)(nil).Class())
Namespace.Add((*Map)(nil).Class())
Namespace.Add((*Pointer)(nil).Class())
Namespace.Add((*Primitive)(nil).Class())
Namespace.Add((*Slice)(nil).Class())
Namespace.Add((*Struct)(nil).Class())
}
var (
binaryIDArray = binary.ID{0x7a, 0x88, 0x3e, 0x09, 0xeb, 0xc7, 0x5c, 0x2c, 0x69, 0xc2, 0x9b, 0x9d, 0x3c, 0x5d, 0xdb, 0xe4, 0x3f, 0xc0, 0x7e, 0xc6}
binaryIDField = binary.ID{0x8c, 0x54, 0x3d, 0x98, 0xc3, 0x7e, 0x38, 0xa8, 0xaa, 0x56, 0xbc, 0x84, 0x27, 0x49, 0x5d, 0x42, 0xdd, 0x21, 0x24, 0xf8}
binaryIDClass = binary.ID{0xf1, 0xab, 0xae, 0xcf, 0xc3, 0x23, 0xf8, 0x65, 0xa1, 0xeb, 0xe0, 0x3a, 0xa1, 0xae, 0xb3, 0xab, 0x77, 0xb0, 0x57, 0xef}
binaryIDConstant = binary.ID{0x59, 0x8d, 0x94, 0xa1, 0x34, 0xca, 0xee, 0xc8, 0xf0, 0x6f, 0xe9, 0xbf, 0xef, 0x7d, 0x40, 0x3a, 0x45, 0x6c, 0x01, 0xcb}
binaryIDConstantSet = binary.ID{0x28, 0x8f, 0x6c, 0x88, 0x31, 0xd1, 0x04, 0x52, 0xb7, 0x5a, 0x25, 0x83, 0x01, 0x4e, 0x9a, 0x7c, 0x53, 0x03, 0x32, 0x9e}
binaryIDInterface = binary.ID{0x5d, 0x54, 0x46, 0x31, 0xe1, 0x59, 0x8f, 0x04, 0x50, 0x67, 0xc8, 0x39, 0x99, 0x11, 0x4d, 0xa8, 0x41, 0x17, 0x88, 0x12}
binaryIDMap = binary.ID{0x20, 0xcc, 0x9a, 0x52, 0xde, 0x75, 0x5f, 0x16, 0x2b, 0x34, 0x8b, 0x33, 0xce, 0x18, 0x67, 0x9d, 0x85, 0x40, 0xb3, 0x64}
binaryIDPointer = binary.ID{0x13, 0xa9, 0xd3, 0x11, 0xa1, 0x8d, 0xbd, 0x5b, 0x18, 0xe7, 0x9b, 0x43, 0x3b, 0xdf, 0xc5, 0x49, 0xc8, 0xa5, 0x35, 0xcf}
binaryIDPrimitive = binary.ID{0x45, 0x4d, 0x9e, 0x7d, 0xe6, 0x4f, 0x50, 0x74, 0x95, 0x13, 0x60, 0xbd, 0xea, 0x00, 0x71, 0x93, 0x9e, 0x3e, 0xc2, 0x4e}
binaryIDSlice = binary.ID{0x3b, 0x75, 0xee, 0x59, 0x18, 0x1a, 0x4d, 0x74, 0x50, 0xf2, 0x50, 0x7f, 0xf9, 0x4f, 0x79, 0x99, 0x38, 0x58, 0x96, 0xd2}
binaryIDStruct = binary.ID{0xdf, 0xe3, 0x9e, 0xf2, 0x8e, 0x9c, 0xea, 0x9b, 0x93, 0x49, 0x47, 0x76, 0xef, 0x9d, 0xe2, 0x46, 0xd9, 0x68, 0x92, 0x94}
)
type binaryClassArray struct{}
func (*Array) Class() binary.Class {
return (*binaryClassArray)(nil)
}
func doEncodeArray(e binary.Encoder, o *Array) error {
if err := e.String(o.Alias); err != nil {
return err
}
if o.ValueType != nil {
if err := e.Object(o.ValueType); err != nil {
return err
}
} else if err := e.Object(nil); err != nil {
return err
}
if err := e.Uint32(o.Size); err != nil {
return err
}
return nil
}
func doDecodeArray(d binary.Decoder, o *Array) error {
if obj, err := d.String(); err != nil {
return err
} else {
o.Alias = string(obj)
}
if obj, err := d.Object(); err != nil {
return err
} else if obj != nil {
o.ValueType = obj.(Type)
} else {
o.ValueType = nil
}
if obj, err := d.Uint32(); err != nil {
return err
} else {
o.Size = uint32(obj)
}
return nil
}
func doSkipArray(d binary.Decoder) error {
if err := d.SkipString(); err != nil {
return err
}
if _, err := d.SkipObject(); err != nil {
return err
}
if _, err := d.Uint32(); err != nil {
return err
}
return nil
}
func (*binaryClassArray) ID() binary.ID { return binaryIDArray }
func (*binaryClassArray) New() binary.Object { return &Array{} }
func (*binaryClassArray) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodeArray(e, obj.(*Array))
}
func (*binaryClassArray) Decode(d binary.Decoder) (binary.Object, error) {
obj := &Array{}
return obj, doDecodeArray(d, obj)
}
func (*binaryClassArray) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodeArray(d, obj.(*Array))
}
func (*binaryClassArray) Skip(d binary.Decoder) error { return doSkipArray(d) }
type binaryClassField struct{}
func (*Field) Class() binary.Class {
return (*binaryClassField)(nil)
}
func doEncodeField(e binary.Encoder, o *Field) error {
if err := e.String(o.Declared); err != nil {
return err
}
if o.Type != nil {
if err := e.Object(o.Type); err != nil {
return err
}
} else if err := e.Object(nil); err != nil {
return err
}
return nil
}
func doDecodeField(d binary.Decoder, o *Field) error {
if obj, err := d.String(); err != nil {
return err
} else {
o.Declared = string(obj)
}
if obj, err := d.Object(); err != nil {
return err
} else if obj != nil {
o.Type = obj.(Type)
} else {
o.Type = nil
}
return nil
}
func doSkipField(d binary.Decoder) error {
if err := d.SkipString(); err != nil {
return err
}
if _, err := d.SkipObject(); err != nil {
return err
}
return nil
}
func (*binaryClassField) ID() binary.ID { return binaryIDField }
func (*binaryClassField) New() binary.Object { return &Field{} }
func (*binaryClassField) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodeField(e, obj.(*Field))
}
func (*binaryClassField) Decode(d binary.Decoder) (binary.Object, error) {
obj := &Field{}
return obj, doDecodeField(d, obj)
}
func (*binaryClassField) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodeField(d, obj.(*Field))
}
func (*binaryClassField) Skip(d binary.Decoder) error { return doSkipField(d) }
type binaryClassClass struct{}
func (*Class) Class() binary.Class {
return (*binaryClassClass)(nil)
}
func doEncodeClass(e binary.Encoder, o *Class) error {
if err := e.ID(o.TypeID); err != nil {
return err
}
if err := e.String(o.Package); err != nil {
return err
}
if err := e.String(o.Name); err != nil {
return err
}
if err := e.Bool(o.Exported); err != nil {
return err
}
if err := e.Uint32(uint32(len(o.Fields))); err != nil {
return err
}
for i := range o.Fields {
if err := e.Value(&o.Fields[i]); err != nil {
return err
}
}
if err := e.Uint32(uint32(len(o.Metadata))); err != nil {
return err
}
for i := range o.Metadata {
if o.Metadata[i] != nil {
if err := e.Object(o.Metadata[i]); err != nil {
return err
}
} else if err := e.Object(nil); err != nil {
return err
}
}
return nil
}
func doDecodeClass(d binary.Decoder, o *Class) error {
if obj, err := d.ID(); err != nil {
return err
} else {
o.TypeID = binary.ID(obj)
}
if obj, err := d.String(); err != nil {
return err
} else {
o.Package = string(obj)
}
if obj, err := d.String(); err != nil {
return err
} else {
o.Name = string(obj)
}
if obj, err := d.Bool(); err != nil {
return err
} else {
o.Exported = bool(obj)
}
if count, err := d.Uint32(); err != nil {
return err
} else {
o.Fields = make(FieldList, count)
for i := range o.Fields {
if err := d.Value(&o.Fields[i]); err != nil {
return err
}
}
}
if count, err := d.Uint32(); err != nil {
return err
} else {
o.Metadata = make([]binary.Object, count)
for i := range o.Metadata {
if obj, err := d.Object(); err != nil {
return err
} else if obj != nil {
o.Metadata[i] = obj.(binary.Object)
} else {
o.Metadata[i] = nil
}
}
}
return nil
}
func doSkipClass(d binary.Decoder) error {
if err := d.SkipID(); err != nil {
return err
}
if err := d.SkipString(); err != nil {
return err
}
if err := d.SkipString(); err != nil {
return err
}
if _, err := d.Bool(); err != nil {
return err
}
if count, err := d.Uint32(); err != nil {
return err
} else {
for i := uint32(0); i < count; i++ {
if err := d.SkipValue((*Field)(nil)); err != nil {
return err
}
}
}
if count, err := d.Uint32(); err != nil {
return err
} else {
for i := uint32(0); i < count; i++ {
if _, err := d.SkipObject(); err != nil {
return err
}
}
}
return nil
}
func (*binaryClassClass) ID() binary.ID { return binaryIDClass }
func (*binaryClassClass) New() binary.Object { return &Class{} }
func (*binaryClassClass) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodeClass(e, obj.(*Class))
}
func (*binaryClassClass) Decode(d binary.Decoder) (binary.Object, error) {
obj := &Class{}
return obj, doDecodeClass(d, obj)
}
func (*binaryClassClass) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodeClass(d, obj.(*Class))
}
func (*binaryClassClass) Skip(d binary.Decoder) error { return doSkipClass(d) }
type binaryClassConstant struct{}
func (*Constant) Class() binary.Class {
return (*binaryClassConstant)(nil)
}
func doEncodeConstant(e binary.Encoder, o *Constant) error {
if err := e.String(o.Name); err != nil {
return err
}
if o.Value != nil {
var boxed binary.Object
boxed, err := any.Box(o.Value)
if err != nil {
return err
}
if err := e.Variant(boxed); err != nil {
return err
}
} else if err := e.Variant(nil); err != nil {
return err
}
return nil
}
func doDecodeConstant(d binary.Decoder, o *Constant) error {
if obj, err := d.String(); err != nil {
return err
} else {
o.Name = string(obj)
}
if boxed, err := d.Variant(); err != nil {
return err
} else if boxed != nil {
if o.Value, err = any.Unbox(boxed); err != nil {
return err
}
} else {
o.Value = nil
}
return nil
}
func doSkipConstant(d binary.Decoder) error {
if err := d.SkipString(); err != nil {
return err
}
if _, err := d.SkipVariant(); err != nil {
return err
}
return nil
}
func (*binaryClassConstant) ID() binary.ID { return binaryIDConstant }
func (*binaryClassConstant) New() binary.Object { return &Constant{} }
func (*binaryClassConstant) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodeConstant(e, obj.(*Constant))
}
func (*binaryClassConstant) Decode(d binary.Decoder) (binary.Object, error) {
obj := &Constant{}
return obj, doDecodeConstant(d, obj)
}
func (*binaryClassConstant) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodeConstant(d, obj.(*Constant))
}
func (*binaryClassConstant) Skip(d binary.Decoder) error { return doSkipConstant(d) }
type binaryClassConstantSet struct{}
func (*ConstantSet) Class() binary.Class {
return (*binaryClassConstantSet)(nil)
}
func doEncodeConstantSet(e binary.Encoder, o *ConstantSet) error {
if o.Type != nil {
if err := e.Object(o.Type); err != nil {
return err
}
} else if err := e.Object(nil); err != nil {
return err
}
if err := e.Uint32(uint32(len(o.Entries))); err != nil {
return err
}
for i := range o.Entries {
if err := e.Value(&o.Entries[i]); err != nil {
return err
}
}
return nil
}
func doDecodeConstantSet(d binary.Decoder, o *ConstantSet) error {
if obj, err := d.Object(); err != nil {
return err
} else if obj != nil {
o.Type = obj.(Type)
} else {
o.Type = nil
}
if count, err := d.Uint32(); err != nil {
return err
} else {
o.Entries = make([]Constant, count)
for i := range o.Entries {
if err := d.Value(&o.Entries[i]); err != nil {
return err
}
}
}
return nil
}
func doSkipConstantSet(d binary.Decoder) error {
if _, err := d.SkipObject(); err != nil {
return err
}
if count, err := d.Uint32(); err != nil {
return err
} else {
for i := uint32(0); i < count; i++ {
if err := d.SkipValue((*Constant)(nil)); err != nil {
return err
}
}
}
return nil
}
func (*binaryClassConstantSet) ID() binary.ID { return binaryIDConstantSet }
func (*binaryClassConstantSet) New() binary.Object { return &ConstantSet{} }
func (*binaryClassConstantSet) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodeConstantSet(e, obj.(*ConstantSet))
}
func (*binaryClassConstantSet) Decode(d binary.Decoder) (binary.Object, error) {
obj := &ConstantSet{}
return obj, doDecodeConstantSet(d, obj)
}
func (*binaryClassConstantSet) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodeConstantSet(d, obj.(*ConstantSet))
}
func (*binaryClassConstantSet) Skip(d binary.Decoder) error { return doSkipConstantSet(d) }
type binaryClassInterface struct{}
func (*Interface) Class() binary.Class {
return (*binaryClassInterface)(nil)
}
func doEncodeInterface(e binary.Encoder, o *Interface) error {
if err := e.String(o.Name); err != nil {
return err
}
return nil
}
func doDecodeInterface(d binary.Decoder, o *Interface) error {
if obj, err := d.String(); err != nil {
return err
} else {
o.Name = string(obj)
}
return nil
}
func doSkipInterface(d binary.Decoder) error {
if err := d.SkipString(); err != nil {
return err
}
return nil
}
func (*binaryClassInterface) ID() binary.ID { return binaryIDInterface }
func (*binaryClassInterface) New() binary.Object { return &Interface{} }
func (*binaryClassInterface) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodeInterface(e, obj.(*Interface))
}
func (*binaryClassInterface) Decode(d binary.Decoder) (binary.Object, error) {
obj := &Interface{}
return obj, doDecodeInterface(d, obj)
}
func (*binaryClassInterface) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodeInterface(d, obj.(*Interface))
}
func (*binaryClassInterface) Skip(d binary.Decoder) error { return doSkipInterface(d) }
type binaryClassMap struct{}
func (*Map) Class() binary.Class {
return (*binaryClassMap)(nil)
}
func doEncodeMap(e binary.Encoder, o *Map) error {
if err := e.String(o.Alias); err != nil {
return err
}
if o.KeyType != nil {
if err := e.Object(o.KeyType); err != nil {
return err
}
} else if err := e.Object(nil); err != nil {
return err
}
if o.ValueType != nil {
if err := e.Object(o.ValueType); err != nil {
return err
}
} else if err := e.Object(nil); err != nil {
return err
}
return nil
}
func doDecodeMap(d binary.Decoder, o *Map) error {
if obj, err := d.String(); err != nil {
return err
} else {
o.Alias = string(obj)
}
if obj, err := d.Object(); err != nil {
return err
} else if obj != nil {
o.KeyType = obj.(Type)
} else {
o.KeyType = nil
}
if obj, err := d.Object(); err != nil {
return err
} else if obj != nil {
o.ValueType = obj.(Type)
} else {
o.ValueType = nil
}
return nil
}
func doSkipMap(d binary.Decoder) error {
if err := d.SkipString(); err != nil {
return err
}
if _, err := d.SkipObject(); err != nil {
return err
}
if _, err := d.SkipObject(); err != nil {
return err
}
return nil
}
func (*binaryClassMap) ID() binary.ID { return binaryIDMap }
func (*binaryClassMap) New() binary.Object { return &Map{} }
func (*binaryClassMap) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodeMap(e, obj.(*Map))
}
func (*binaryClassMap) Decode(d binary.Decoder) (binary.Object, error) {
obj := &Map{}
return obj, doDecodeMap(d, obj)
}
func (*binaryClassMap) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodeMap(d, obj.(*Map))
}
func (*binaryClassMap) Skip(d binary.Decoder) error { return doSkipMap(d) }
type binaryClassPointer struct{}
func (*Pointer) Class() binary.Class {
return (*binaryClassPointer)(nil)
}
func doEncodePointer(e binary.Encoder, o *Pointer) error {
if o.Type != nil {
if err := e.Object(o.Type); err != nil {
return err
}
} else if err := e.Object(nil); err != nil {
return err
}
return nil
}
func doDecodePointer(d binary.Decoder, o *Pointer) error {
if obj, err := d.Object(); err != nil {
return err
} else if obj != nil {
o.Type = obj.(Type)
} else {
o.Type = nil
}
return nil
}
func doSkipPointer(d binary.Decoder) error {
if _, err := d.SkipObject(); err != nil {
return err
}
return nil
}
func (*binaryClassPointer) ID() binary.ID { return binaryIDPointer }
func (*binaryClassPointer) New() binary.Object { return &Pointer{} }
func (*binaryClassPointer) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodePointer(e, obj.(*Pointer))
}
func (*binaryClassPointer) Decode(d binary.Decoder) (binary.Object, error) {
obj := &Pointer{}
return obj, doDecodePointer(d, obj)
}
func (*binaryClassPointer) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodePointer(d, obj.(*Pointer))
}
func (*binaryClassPointer) Skip(d binary.Decoder) error { return doSkipPointer(d) }
type binaryClassPrimitive struct{}
func (*Primitive) Class() binary.Class {
return (*binaryClassPrimitive)(nil)
}
func doEncodePrimitive(e binary.Encoder, o *Primitive) error {
if err := e.String(o.Name); err != nil {
return err
}
if err := e.Int32(int32(o.Method)); err != nil {
return err
}
return nil
}
func doDecodePrimitive(d binary.Decoder, o *Primitive) error {
if obj, err := d.String(); err != nil {
return err
} else {
o.Name = string(obj)
}
if obj, err := d.Int32(); err != nil {
return err
} else {
o.Method = Method(obj)
}
return nil
}
func doSkipPrimitive(d binary.Decoder) error {
if err := d.SkipString(); err != nil {
return err
}
if _, err := d.Int32(); err != nil {
return err
}
return nil
}
func (*binaryClassPrimitive) ID() binary.ID { return binaryIDPrimitive }
func (*binaryClassPrimitive) New() binary.Object { return &Primitive{} }
func (*binaryClassPrimitive) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodePrimitive(e, obj.(*Primitive))
}
func (*binaryClassPrimitive) Decode(d binary.Decoder) (binary.Object, error) {
obj := &Primitive{}
return obj, doDecodePrimitive(d, obj)
}
func (*binaryClassPrimitive) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodePrimitive(d, obj.(*Primitive))
}
func (*binaryClassPrimitive) Skip(d binary.Decoder) error { return doSkipPrimitive(d) }
type binaryClassSlice struct{}
func (*Slice) Class() binary.Class {
return (*binaryClassSlice)(nil)
}
func doEncodeSlice(e binary.Encoder, o *Slice) error {
if err := e.String(o.Alias); err != nil {
return err
}
if o.ValueType != nil {
if err := e.Object(o.ValueType); err != nil {
return err
}
} else if err := e.Object(nil); err != nil {
return err
}
return nil
}
func doDecodeSlice(d binary.Decoder, o *Slice) error {
if obj, err := d.String(); err != nil {
return err
} else {
o.Alias = string(obj)
}
if obj, err := d.Object(); err != nil {
return err
} else if obj != nil {
o.ValueType = obj.(Type)
} else {
o.ValueType = nil
}
return nil
}
func doSkipSlice(d binary.Decoder) error {
if err := d.SkipString(); err != nil {
return err
}
if _, err := d.SkipObject(); err != nil {
return err
}
return nil
}
func (*binaryClassSlice) ID() binary.ID { return binaryIDSlice }
func (*binaryClassSlice) New() binary.Object { return &Slice{} }
func (*binaryClassSlice) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodeSlice(e, obj.(*Slice))
}
func (*binaryClassSlice) Decode(d binary.Decoder) (binary.Object, error) {
obj := &Slice{}
return obj, doDecodeSlice(d, obj)
}
func (*binaryClassSlice) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodeSlice(d, obj.(*Slice))
}
func (*binaryClassSlice) Skip(d binary.Decoder) error { return doSkipSlice(d) }
type binaryClassStruct struct{}
func (*Struct) Class() binary.Class {
return (*binaryClassStruct)(nil)
}
func doEncodeStruct(e binary.Encoder, o *Struct) error {
if err := e.String(o.Name); err != nil {
return err
}
if err := e.ID(o.ID); err != nil {
return err
}
return nil
}
func doDecodeStruct(d binary.Decoder, o *Struct) error {
if obj, err := d.String(); err != nil {
return err
} else {
o.Name = string(obj)
}
if obj, err := d.ID(); err != nil {
return err
} else {
o.ID = binary.ID(obj)
}
return nil
}
func doSkipStruct(d binary.Decoder) error {
if err := d.SkipString(); err != nil {
return err
}
if err := d.SkipID(); err != nil {
return err
}
return nil
}
func (*binaryClassStruct) ID() binary.ID { return binaryIDStruct }
func (*binaryClassStruct) New() binary.Object { return &Struct{} }
func (*binaryClassStruct) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodeStruct(e, obj.(*Struct))
}
func (*binaryClassStruct) Decode(d binary.Decoder) (binary.Object, error) {
obj := &Struct{}
return obj, doDecodeStruct(d, obj)
}
func (*binaryClassStruct) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodeStruct(d, obj.(*Struct))
}
func (*binaryClassStruct) Skip(d binary.Decoder) error { return doSkipStruct(d) }