ringbuffer

package module
v0.0.0-...-9e84444 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2017 License: Apache-2.0 Imports: 0 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RingBuffer

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

func NewBuffer

func NewBuffer(size int, recordHighLow bool) *RingBuffer

func (*RingBuffer) Head

func (rb *RingBuffer) Head() float64

Head returns the element at the buffer tail

func (*RingBuffer) High

func (rb *RingBuffer) High() float64

Tail returns the element at the buffer tail

func (*RingBuffer) Low

func (rb *RingBuffer) Low() float64

Head returns the element at the buffer tail

func (*RingBuffer) MostRecent

func (rb *RingBuffer) MostRecent() float64

MostRecent returns the element at the head - 1

func (*RingBuffer) Oldest

func (rb *RingBuffer) Oldest() float64

Oldest returns the element at the head - 1

func (*RingBuffer) Push

func (rb *RingBuffer) Push(value float64)

Push adds a new element to the buffer

func (*RingBuffer) Tail

func (rb *RingBuffer) Tail() float64

Tail returns the element at the buffer tail

Jump to

Keyboard shortcuts

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