blob: 07ba1d4684b862ec2474dd3708556536978c8aa9 [file] [log] [blame]
// Copyright (C) 2015 The Android Open Source Project
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
// Package atom provides the fundamental types used to describe a capture stream.
package atom
// binary: cpp = atom
// binary: java.source = adt/idea/android/src
// binary: java.package =
// binary: java.indent = " "
// binary: java.member_prefix = my
import (
// Atom is the interface implemented by all objects that describe an single
// event in a capture stream. Typical implementations of Atom describe an
// application's call to a graphics API function or provide meta-data describing
// observed memory or state at the time of capture.
// Each implementation of Atom should have a unique and stable TypeID to ensure
// binary compatibility with old capture formats. Any change to the Atom's
// binary format should also result in a new TypeID.
type Atom interface {
// API returns the graphics API id this atom belongs to.
API() gfxapi.ID
// Flags returns the flags of the atom.
Flags() Flags
// Observations returns all the memory observations made by the atom.
Observations() *Observations
// Mutate mutates the State using the atom.
Mutate(*gfxapi.State, database.Database, log.Logger) error
// ID is the index of an atom in an atom stream.
type ID uint64
// NoID is used when you have to pass an ID, but don't have one to use.
const NoID = ID(1<<63 - 1) // use max int64 for the benefit of java