rangemap

package
v0.0.0-...-b92c3bc Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitmapRangeMap

type BitmapRangeMap[V comparable] struct {
	// contains filtered or unexported fields
}

func NewBitmapRangeMap

func NewBitmapRangeMap[V comparable]() *BitmapRangeMap[V]

func (*BitmapRangeMap[V]) Add

func (m *BitmapRangeMap[V]) Add(offset, length uint64, value V)

func (*BitmapRangeMap[V]) Begin

func (m *BitmapRangeMap[V]) Begin() (uint64, bool)

func (*BitmapRangeMap[V]) End

func (m *BitmapRangeMap[V]) End() uint64

func (*BitmapRangeMap[V]) Get

func (m *BitmapRangeMap[V]) Get(offset uint64) (value V, ok bool)

func (*BitmapRangeMap[V]) Iterate

func (m *BitmapRangeMap[V]) Iterate(start uint64, iter func(RangeValue[V]) bool)

func (*BitmapRangeMap[V]) NextEmpty

func (m *BitmapRangeMap[V]) NextEmpty(off uint64) uint64

func (*BitmapRangeMap[V]) NextKey

func (m *BitmapRangeMap[V]) NextKey(off uint64) (uint64, bool)

type ExtentRangeMap

type ExtentRangeMap[V comparable] struct {
	// contains filtered or unexported fields
}

func (*ExtentRangeMap[V]) Add

func (m *ExtentRangeMap[V]) Add(offset, length uint64, value V)

func (*ExtentRangeMap[V]) Begin

func (m *ExtentRangeMap[V]) Begin() (begin uint64, ok bool)

func (*ExtentRangeMap[V]) End

func (m *ExtentRangeMap[V]) End() (end uint64)

func (*ExtentRangeMap[V]) Get

func (m *ExtentRangeMap[V]) Get(offset uint64) (value V, ok bool)

func (*ExtentRangeMap[V]) GetWithRange

func (m *ExtentRangeMap[V]) GetWithRange(offset uint64) (r RangeValue[V], ok bool)

func (*ExtentRangeMap[V]) Iterate

func (m *ExtentRangeMap[V]) Iterate(start uint64, iter func(RangeValue[V]) bool)

func (*ExtentRangeMap[V]) NextEmpty

func (m *ExtentRangeMap[V]) NextEmpty(offset uint64) (next uint64)

func (*ExtentRangeMap[V]) NextKey

func (m *ExtentRangeMap[V]) NextKey(offset uint64) (next uint64, ok bool)

func (*ExtentRangeMap[V]) Remove

func (m *ExtentRangeMap[V]) Remove(offset, length uint64)

type Range

type Range struct {
	Offset, Length uint64
}

func (Range) Contains

func (r Range) Contains(off uint64) bool

func (Range) End

func (r Range) End() uint64

func (*Range) Key

func (r *Range) Key() uint64

func (Range) Overlaps

func (r Range) Overlaps(other Range) bool

type RangeMap

type RangeMap[V any] interface {
	Begin() (begin uint64, ok bool)
	End() (end uint64)

	Add(offset, length uint64, value V)
	// Remove(offset, length uint64)
	Get(offset uint64) (value V, ok bool)

	NextKey(offset uint64) (next uint64, ok bool)
	NextEmpty(offset uint64) (next uint64)

	RangeMapIterator[V]
}

type RangeMapIterator

type RangeMapIterator[V any] interface {
	Iterate(start uint64, iter func(RangeValue[V]) bool)
}

type RangeValue

type RangeValue[V any] struct {
	Range
	Value V
}

Jump to

Keyboard shortcuts

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