idxtable

package
v0.0.0-...-54d7d0b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enries

type Enries[T1 any] []Entry[T1]

type Entries

type Entries[T1 any] []Entry[T1]

type Entry

type Entry[T1 any] interface {
	ID() uint64
	Data() T1
}

func NewEntry

func NewEntry[T1 any](id uint64, d T1) Entry[T1]

type Iterator

type Iterator[T1 any] struct {
	// contains filtered or unexported fields
}

func (*Iterator[T1]) ID

func (r *Iterator[T1]) ID() uint64

func (*Iterator[T1]) IsConsecutive

func (r *Iterator[T1]) IsConsecutive() bool

func (*Iterator[T1]) Next

func (r *Iterator[T1]) Next() bool

func (*Iterator[T1]) Value

func (r *Iterator[T1]) Value() Entry[T1]

type Table

type Table[T1 any] interface {
	Get(id uint64) (Entry[T1], error)
	Claim(id uint64, d T1) error
	ClaimDynamic(d T1) (Entry[T1], error)
	ClaimRange(start, size uint64, d T1) error
	ClaimSize(size uint64, d T1) (Entries[T1], error)
	Release(id uint64) error
	Update(id uint64, d T1) error

	Iterate() *Iterator[T1]
	IterateFree() *Iterator[T1]

	Size() int
	Has(id uint64) bool

	IsFree(id uint64) bool
	FindFree() (uint64, error)
	FindFreeRange(min, size uint64) ([]uint64, error)
	FindFreeSize(size uint64) ([]uint64, error)

	GetAll() Entries[T1]
}

func NewTable

func NewTable[T1 any](size uint64) Table[T1]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL