bitmask

package
v1.21.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: Apache-2.0 Imports: 3 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IterateBitMasks

func IterateBitMasks(bits []int, callback func(BitMask))

IterateBitMasks iterates all possible masks from a list of bits, issuing a callback on each mask.

Types

type BitMask

type BitMask interface {
	Add(bits ...int) error
	Remove(bits ...int) error
	And(masks ...BitMask)
	Or(masks ...BitMask)
	Clear()
	Fill()
	IsEqual(mask BitMask) bool
	IsEmpty() bool
	IsSet(bit int) bool
	AnySet(bits []int) bool
	IsNarrowerThan(mask BitMask) bool
	String() string
	Count() int
	GetBits() []int
}

BitMask interface allows hint providers to create BitMasks for TopologyHints

func And

func And(first BitMask, masks ...BitMask) BitMask

And is a package level implementation of 'and' between first and masks

func NewBitMask

func NewBitMask(bits ...int) (BitMask, error)

NewBitMask creates a new BitMask

func NewEmptyBitMask

func NewEmptyBitMask() BitMask

NewEmptyBitMask creates a new, empty BitMask

func Or

func Or(first BitMask, masks ...BitMask) BitMask

Or is a package level implementation of 'or' between first and masks

Jump to

Keyboard shortcuts

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