prioritybitmap

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package prioritybitmap implements a set of integers ordered by attached priorities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PriorityBitmap

type PriorityBitmap struct {

	// If not set, is initialized to the default map[int]struct{} implementation on first use.
	NewSet func() Set
	// contains filtered or unexported fields
}

Maintains set of ints ordered by priority.

func (*PriorityBitmap) Clear

func (me *PriorityBitmap) Clear()

func (*PriorityBitmap) Contains

func (me *PriorityBitmap) Contains(bit int) bool

func (*PriorityBitmap) GetPriority

func (me *PriorityBitmap) GetPriority(bit int) (prio int, ok bool)

ok is false if the bit is not set.

func (*PriorityBitmap) IsEmpty

func (me *PriorityBitmap) IsEmpty() bool

func (*PriorityBitmap) Iter

func (me *PriorityBitmap) Iter(f iter.Callback)

func (*PriorityBitmap) IterTyped

func (me *PriorityBitmap) IterTyped(_f func(i bitmap.BitIndex) bool) bool

func (*PriorityBitmap) Len

func (me *PriorityBitmap) Len() int

func (*PriorityBitmap) Remove

func (me *PriorityBitmap) Remove(bit int) bool

func (*PriorityBitmap) Set

func (me *PriorityBitmap) Set(bit int, priority int) bool

Returns true if the priority is changed, or the bit wasn't present.

type Set added in v2.5.0

type Set interface {
	Has(bit int) bool
	Delete(bit int)
	Len() int
	Set(bit int)
	Range(f func(int) bool)
}

The interface used for non-singleton bit-sets for each priority level.

Jump to

Keyboard shortcuts

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