markbits

package
v3.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2018 License: Apache-2.0 Imports: 3 Imported by: 64

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MarkBitsManager

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

MarkBitsManager provides set of functions to manage an uint32 mark bits based on a given mark mask.

func NewMarkBitsManager

func NewMarkBitsManager(markMask uint32, markName string) *MarkBitsManager

func (*MarkBitsManager) AvailableMarkBitCount

func (mc *MarkBitsManager) AvailableMarkBitCount() int

func (*MarkBitsManager) CurrentFreeNumberOfMark

func (mc *MarkBitsManager) CurrentFreeNumberOfMark() int

Return how many free position number left.

func (*MarkBitsManager) GetMask

func (mc *MarkBitsManager) GetMask() uint32

func (*MarkBitsManager) MapMarkToNumber

func (mc *MarkBitsManager) MapMarkToNumber(mark uint32) (int, error)

Return a position number given a mark.

func (*MarkBitsManager) MapNumberToMark

func (mc *MarkBitsManager) MapNumberToMark(n int) (uint32, error)

Return a mark given a position number.

func (*MarkBitsManager) NextBlockBitsMark

func (mc *MarkBitsManager) NextBlockBitsMark(size int) (uint32, int)

Allocate a block of bits given a requested size. Performance is not a priority here since it is just a start of day operation. Return allocated mark and how many bits allocated. It is up to the caller to check the result.

func (*MarkBitsManager) NextSingleBitMark

func (mc *MarkBitsManager) NextSingleBitMark() (uint32, error)

Allocate next mark bit.

Jump to

Keyboard shortcuts

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