Documentation ¶
Index ¶
- type MarkBitsManager
- func (mc *MarkBitsManager) AvailableMarkBitCount() int
- func (mc *MarkBitsManager) CurrentFreeNumberOfMark() int
- func (mc *MarkBitsManager) GetMask() uint32
- func (mc *MarkBitsManager) MapMarkToNumber(mark uint32) (int, error)
- func (mc *MarkBitsManager) MapNumberToMark(n int) (uint32, error)
- func (mc *MarkBitsManager) NextBlockBitsMark(size int) (uint32, int)
- func (mc *MarkBitsManager) NextSingleBitMark() (uint32, error)
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.
Click to show internal directories.
Click to hide internal directories.