tree: 9b0fd8aea18cd74b275a2ce7a42491fd969580b0 [path history] [tgz]
  1. README.md
  2. registry.go
binary/registry/README.md

registry


import "android.googlesource.com/platform/tools/gpu/binary/registry"

Usage

var (
	// Global is the default global Namespace object.
	Global = NewNamespace(nil)
)

func Add

func Add(class binary.Class)

Add a new type to the global Namespace.

func Lookup

func Lookup(id binary.ID) binary.Class

Lookup looks up a Class by the given type id. If there is no match, it will return nil.

type Namespace

type Namespace struct {
}

Namespace represents a mapping of type identifiers to their Class.

func NewNamespace

func NewNamespace(parent *Namespace) *Namespace

NewNamespace creates a new namespace layered on top of the specified parent.

func (Namespace) Add

func (n Namespace) Add(class binary.Class)

Add a new type to the Namespace.

func (Namespace) Lookup

func (n Namespace) Lookup(id binary.ID) binary.Class

Lookup looks up a Class by the given type id in the Namespace. If there is no match, it will return nil.