rwswitch

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: BSL-1.0 Imports: 0 Imported by: 0

README

rwswitch

Go Reference Go Report Card

About

rwswitch is a package for Go to iterate over values 0, 1 and 2, differentiating between the read and write value. Read and write values are always distinct. It is published on https://github.com/vbsw/golib/rwswitch and https://gitlab.com/vbsw/golib/rwswitch.

Copyright 2022, Vitali Baumtrok (vbsw@mailbox.org).

rwswitch is distributed under the Boost Software License, version 1.0. (See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)

rwswitch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Boost Software License for more details.

References

Documentation

Overview

Package rwswitch iterates over values 0, 1 and 2, differentiating between the read and write value. Read and write values are always distinct.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Switch

type Switch struct {
	State  byte
	States [56]byte
}

func New

func New() *Switch

func (*Switch) CurrRead

func (sw *Switch) CurrRead() int

CurrRead returns current read index.

func (*Switch) CurrWrite

func (sw *Switch) CurrWrite() int

CurrWrite returns current write index.

func (*Switch) Init

func (sw *Switch) Init()

func (*Switch) NextRead

func (sw *Switch) NextRead() int

NextRead returns next read index.

func (*Switch) NextWrite

func (sw *Switch) NextWrite() int

NextRead returns next write index.

Jump to

Keyboard shortcuts

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