worklist

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start[T any](start T, do func(next T, add func(el T)))

Start worklist execution with provided `starting` element and an iteration function. The iteration function exposes the next element and a function with which to add more elements to the worklist.

func StartV

func StartV[T any](start []T, do func(next T, add func(el T)))

Start worklist execution with a preloaded queue and an iteration function. The iteration function exposes the next element and a function with which to add more elements to the worklist.

Types

type Worklist

type Worklist[T any] struct {
	// contains filtered or unexported fields
}

func Empty

func Empty[T any]() Worklist[T]

func (*Worklist[T]) Add

func (w *Worklist[T]) Add(el T)

func (*Worklist[T]) AddConc

func (w *Worklist[T]) AddConc(el T)

func (*Worklist[T]) GetNext

func (w *Worklist[T]) GetNext() (ret T)

func (*Worklist[T]) GetNextConc

func (w *Worklist[T]) GetNextConc() T

func (*Worklist[T]) IsEmpty

func (w *Worklist[T]) IsEmpty() bool

func (*Worklist[T]) IsEmptyConc

func (w *Worklist[T]) IsEmptyConc() bool

func (*Worklist[T]) Process

func (w *Worklist[T]) Process(
	do func(
		next T,
		add func(element T)))

func (*Worklist[T]) ProcessConc

func (w *Worklist[T]) ProcessConc(
	start T,
	do func(
		next T,
		add func(el T)))

Jump to

Keyboard shortcuts

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