blob: 29f085a832a669d348505972ca2c8dea1efb7d1b [file] [log] [blame]
////////////////////////////////////////////////////////////////////////////////
// Do not modify!
// Generated by codergen
////////////////////////////////////////////////////////////////////////////////
package test
import (
"android.googlesource.com/platform/tools/gpu/atom"
"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((*AtomA)(nil).Class())
Namespace.Add((*AtomB)(nil).Class())
Namespace.Add((*AtomC)(nil).Class())
}
var (
AtomAID = binary.ID{0x38, 0x1e, 0xef, 0x73, 0x50, 0xa0, 0x48, 0x6d, 0xa3, 0x1d, 0x8e, 0xb6, 0x5e, 0x47, 0xb7, 0xbf, 0x7b, 0xc8, 0x06, 0x33}
AtomBID = binary.ID{0x32, 0x6a, 0x98, 0x0f, 0x59, 0xd2, 0x52, 0x34, 0x9c, 0xc2, 0x75, 0x25, 0x62, 0xb8, 0xb3, 0x0b, 0x48, 0x54, 0x3c, 0x85}
AtomCID = binary.ID{0x02, 0x32, 0xdd, 0xd7, 0x4d, 0x7e, 0xbf, 0x43, 0x41, 0x47, 0xbb, 0xcb, 0xd8, 0xed, 0xd4, 0xd8, 0xb4, 0x42, 0xf9, 0xd5}
)
type binaryClassAtomA struct{}
func (*AtomA) Class() binary.Class {
return (*binaryClassAtomA)(nil)
}
func doEncodeAtomA(e binary.Encoder, o *AtomA) error {
if err := e.Uint64(uint64(o.ID)); err != nil {
return err
}
if err := e.Uint32(uint32(o.AtomFlags)); err != nil {
return err
}
return nil
}
func doDecodeAtomA(d binary.Decoder, o *AtomA) error {
if obj, err := d.Uint64(); err != nil {
return err
} else {
o.ID = atom.ID(obj)
}
if obj, err := d.Uint32(); err != nil {
return err
} else {
o.AtomFlags = atom.Flags(obj)
}
return nil
}
func doSkipAtomA(d binary.Decoder) error {
if _, err := d.Uint64(); err != nil {
return err
}
if _, err := d.Uint32(); err != nil {
return err
}
return nil
}
func (*binaryClassAtomA) ID() binary.ID { return AtomAID }
func (*binaryClassAtomA) New() binary.Object { return &AtomA{} }
func (*binaryClassAtomA) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodeAtomA(e, obj.(*AtomA))
}
func (*binaryClassAtomA) Decode(d binary.Decoder) (binary.Object, error) {
obj := &AtomA{}
return obj, doDecodeAtomA(d, obj)
}
func (*binaryClassAtomA) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodeAtomA(d, obj.(*AtomA))
}
func (*binaryClassAtomA) Skip(d binary.Decoder) error { return doSkipAtomA(d) }
func (*binaryClassAtomA) Schema() *schema.Class { return schemaAtomA }
var schemaAtomA = &schema.Class{
TypeID: AtomAID,
Package: "test",
Name: "AtomA",
Fields: []schema.Field{
{Declared: "ID", Type: &schema.Primitive{Name: "atom.ID", Method: schema.Uint64}},
{Declared: "AtomFlags", Type: &schema.Primitive{Name: "atom.Flags", Method: schema.Uint32}},
},
}
type binaryClassAtomB struct{}
func (*AtomB) Class() binary.Class {
return (*binaryClassAtomB)(nil)
}
func doEncodeAtomB(e binary.Encoder, o *AtomB) error {
if err := e.Uint64(uint64(o.ID)); err != nil {
return err
}
if err := e.Bool(o.Bool); err != nil {
return err
}
return nil
}
func doDecodeAtomB(d binary.Decoder, o *AtomB) error {
if obj, err := d.Uint64(); err != nil {
return err
} else {
o.ID = atom.ID(obj)
}
if obj, err := d.Bool(); err != nil {
return err
} else {
o.Bool = bool(obj)
}
return nil
}
func doSkipAtomB(d binary.Decoder) error {
if _, err := d.Uint64(); err != nil {
return err
}
if _, err := d.Bool(); err != nil {
return err
}
return nil
}
func (*binaryClassAtomB) ID() binary.ID { return AtomBID }
func (*binaryClassAtomB) New() binary.Object { return &AtomB{} }
func (*binaryClassAtomB) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodeAtomB(e, obj.(*AtomB))
}
func (*binaryClassAtomB) Decode(d binary.Decoder) (binary.Object, error) {
obj := &AtomB{}
return obj, doDecodeAtomB(d, obj)
}
func (*binaryClassAtomB) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodeAtomB(d, obj.(*AtomB))
}
func (*binaryClassAtomB) Skip(d binary.Decoder) error { return doSkipAtomB(d) }
func (*binaryClassAtomB) Schema() *schema.Class { return schemaAtomB }
var schemaAtomB = &schema.Class{
TypeID: AtomBID,
Package: "test",
Name: "AtomB",
Fields: []schema.Field{
{Declared: "ID", Type: &schema.Primitive{Name: "atom.ID", Method: schema.Uint64}},
{Declared: "Bool", Type: &schema.Primitive{Name: "bool", Method: schema.Bool}},
},
}
type binaryClassAtomC struct{}
func (*AtomC) Class() binary.Class {
return (*binaryClassAtomC)(nil)
}
func doEncodeAtomC(e binary.Encoder, o *AtomC) error {
if err := e.String(o.String); err != nil {
return err
}
return nil
}
func doDecodeAtomC(d binary.Decoder, o *AtomC) error {
if obj, err := d.String(); err != nil {
return err
} else {
o.String = string(obj)
}
return nil
}
func doSkipAtomC(d binary.Decoder) error {
if err := d.SkipString(); err != nil {
return err
}
return nil
}
func (*binaryClassAtomC) ID() binary.ID { return AtomCID }
func (*binaryClassAtomC) New() binary.Object { return &AtomC{} }
func (*binaryClassAtomC) Encode(e binary.Encoder, obj binary.Object) error {
return doEncodeAtomC(e, obj.(*AtomC))
}
func (*binaryClassAtomC) Decode(d binary.Decoder) (binary.Object, error) {
obj := &AtomC{}
return obj, doDecodeAtomC(d, obj)
}
func (*binaryClassAtomC) DecodeTo(d binary.Decoder, obj binary.Object) error {
return doDecodeAtomC(d, obj.(*AtomC))
}
func (*binaryClassAtomC) Skip(d binary.Decoder) error { return doSkipAtomC(d) }
func (*binaryClassAtomC) Schema() *schema.Class { return schemaAtomC }
var schemaAtomC = &schema.Class{
TypeID: AtomCID,
Package: "test",
Name: "AtomC",
Fields: []schema.Field{
{Declared: "String", Type: &schema.Primitive{Name: "string", Method: schema.String}},
},
}