queue

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: GPL-3.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChanQueue

type ChanQueue struct {
	// contains filtered or unexported fields
}

func (*ChanQueue) Dequeue

func (q *ChanQueue) Dequeue() (any, bool)

func (*ChanQueue) Enqueue

func (q *ChanQueue) Enqueue(v any) bool

func (*ChanQueue) IsEmpty

func (q *ChanQueue) IsEmpty() bool

func (*ChanQueue) ResetCap

func (q *ChanQueue) ResetCap(cap uint32) (uint32, error)

type Element

type Element struct {
	// contains filtered or unexported fields
}

type IDeque

type IDeque interface {
	PushBack(any) bool
	PushFront(any) bool
	PopFront() (any, bool)
	IsEmpty() bool
}

type IQueue

type IQueue interface {
	Enqueue(any) bool
	Dequeue() (any, bool)
	IsEmpty() bool
}

func NewChanQueue

func NewChanQueue(cap int) (IQueue, error)

type ListQueue

type ListQueue struct {
	// contains filtered or unexported fields
}

func NewListQueue

func NewListQueue() *ListQueue

func (*ListQueue) Dequeue

func (l *ListQueue) Dequeue() (any, bool)

func (*ListQueue) Enqueue

func (l *ListQueue) Enqueue(v any) bool

func (*ListQueue) IsEmpty

func (l *ListQueue) IsEmpty() bool

func (*ListQueue) PopFront

func (l *ListQueue) PopFront() (any, bool)

func (*ListQueue) PushBack

func (l *ListQueue) PushBack(v any) bool

func (*ListQueue) PushFront

func (l *ListQueue) PushFront(v any) bool

func (*ListQueue) ResetCap

func (l *ListQueue) ResetCap(cap uint32) (uint32, error)

type ListQueueLock

type ListQueueLock struct {
	// contains filtered or unexported fields
}

func NewListQueueLock

func NewListQueueLock() *ListQueueLock

func (*ListQueueLock) Dequeue

func (l *ListQueueLock) Dequeue() (any, bool)

func (*ListQueueLock) Enqueue

func (l *ListQueueLock) Enqueue(v any) bool

func (*ListQueueLock) IsEmpty

func (l *ListQueueLock) IsEmpty() bool

func (*ListQueueLock) PopFront

func (l *ListQueueLock) PopFront() (any, bool)

func (*ListQueueLock) PushBack

func (l *ListQueueLock) PushBack(v any) bool

func (*ListQueueLock) PushFront

func (l *ListQueueLock) PushFront(v any) bool

type ListQueueLockFree

type ListQueueLockFree struct {
	// contains filtered or unexported fields
}

func NewListQueueLockFree

func NewListQueueLockFree() *ListQueueLockFree

func (*ListQueueLockFree) Dequeue

func (l *ListQueueLockFree) Dequeue() (any, bool)

func (*ListQueueLockFree) Enqueue

func (l *ListQueueLockFree) Enqueue(v any) bool

func (*ListQueueLockFree) IsEmpty

func (l *ListQueueLockFree) IsEmpty() bool

func (*ListQueueLockFree) PopFront

func (l *ListQueueLockFree) PopFront() (any, bool)

func (*ListQueueLockFree) PushBack

func (l *ListQueueLockFree) PushBack(v any) bool

func (*ListQueueLockFree) PushFront

func (l *ListQueueLockFree) PushFront(v any) bool

type RingQueue

type RingQueue struct {
	// contains filtered or unexported fields
}

func NewRingQueue

func NewRingQueue(cap uint32) *RingQueue

NewRingQueue 由于内部运算需要,所以queue内部会自动扩容到2^n次方容量

func (*RingQueue) Dequeue

func (r *RingQueue) Dequeue() (any, bool)

func (*RingQueue) Enqueue

func (r *RingQueue) Enqueue(v any) bool

func (*RingQueue) IsEmpty

func (r *RingQueue) IsEmpty() bool

func (*RingQueue) PopFront

func (r *RingQueue) PopFront() (any, bool)

func (*RingQueue) PushBack

func (r *RingQueue) PushBack(v any) bool

func (*RingQueue) PushFront

func (r *RingQueue) PushFront(v any) bool

func (*RingQueue) ResetCap

func (r *RingQueue) ResetCap(cap uint32) (uint32, error)

type RingQueueLock

type RingQueueLock struct {
	// contains filtered or unexported fields
}

func NewRingQueueLock

func NewRingQueueLock(cap uint32) *RingQueueLock

NewRingQueueLock 由于内部运算需要,所以queue内部会自动扩容到2^n次方容量

func (*RingQueueLock) Dequeue

func (r *RingQueueLock) Dequeue() (any, bool)

func (*RingQueueLock) Enqueue

func (r *RingQueueLock) Enqueue(v any) bool

func (*RingQueueLock) IsEmpty

func (r *RingQueueLock) IsEmpty() bool

func (*RingQueueLock) PopFront

func (r *RingQueueLock) PopFront() (any, bool)

func (*RingQueueLock) PushBack

func (r *RingQueueLock) PushBack(v any) bool

func (*RingQueueLock) PushFront

func (r *RingQueueLock) PushFront(v any) bool

func (*RingQueueLock) ResetCap

func (r *RingQueueLock) ResetCap(cap uint32) (uint32, error)

type RingQueueLockFree

type RingQueueLockFree struct {
	// contains filtered or unexported fields
}

func NewRingQueueLockFree

func NewRingQueueLockFree(cap uint32) *RingQueueLockFree

NewRingQueueLockFree 由于内部运算需要,所以queue内部会自动扩容到2^n次方容量

func (*RingQueueLockFree) Dequeue

func (r *RingQueueLockFree) Dequeue() (any, bool)

func (*RingQueueLockFree) Enqueue

func (r *RingQueueLockFree) Enqueue(v any) bool

func (*RingQueueLockFree) IsEmpty

func (r *RingQueueLockFree) IsEmpty() bool

func (*RingQueueLockFree) ResetCap

func (r *RingQueueLockFree) ResetCap(cap uint32) (uint32, error)

Jump to

Keyboard shortcuts

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