luci: go.chromium.org/luci/common/data/bit_field Index | Files | Directories

package bit_field

import "go.chromium.org/luci/common/data/bit_field"

Index

Package Files

bf.go bf_table.gen.go

type BitField Uses

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

BitField is a luci/gae-serializable bit field implementation. It should be nice and fast for non-AppEngine use as well.

You should construct a new one with bf.Make, rather than by direct construction.

func Make Uses

func Make(size uint32) BitField

Make creates a new BitField.

func (BitField) All Uses

func (bf BitField) All(val bool) bool

All returns true iff all of the bits are equal to `val`.

func (BitField) Clear Uses

func (bf BitField) Clear(idx uint32)

Clear turns the given bit to false, regardless of its previous value. Will panic if idx >= Size().

func (BitField) CountSet Uses

func (bf BitField) CountSet() (ret uint32)

CountSet returns the number of true bits.

func (*BitField) FromProperty Uses

func (bf *BitField) FromProperty(p datastore.Property) error

FromProperty implements datastore.PropertyConverter

func (BitField) IsSet Uses

func (bf BitField) IsSet(idx uint32) bool

IsSet returns the value of a given bit.

func (*BitField) MarshalBinary Uses

func (bf *BitField) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaller

func (*BitField) Reset Uses

func (bf *BitField) Reset()

Reset resets this BitField to the 'empty' (size-0) state.

func (BitField) Set Uses

func (bf BitField) Set(idx uint32)

Set turns the given bit to true, regardless of its previous value. Will panic if idx >= Size().

func (BitField) Size Uses

func (bf BitField) Size() uint32

Size returns the number of bits which this BitField can hold.

func (*BitField) ToProperty Uses

func (bf *BitField) ToProperty() (datastore.Property, error)

ToProperty implements datastore.PropertyConverter

func (*BitField) UnmarshalBinary Uses

func (bf *BitField) UnmarshalBinary(bs []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler

Directories

PathSynopsis
tool

Package bit_field imports 6 packages (graph) and is imported by 4 packages. Updated 2018-12-18. Refresh now. Tools for package owners.