Documentation ¶
Index ¶
- Variables
- type Bit16Cache
- func (this *Bit16Cache) GetIndex(index int) uint64
- func (this *Bit16Cache) ReadFrom(r io.Reader) (int, error)
- func (this *Bit16Cache) ResetIndex(index int, value uint64)
- func (this *Bit16Cache) SetLastBit(index int) bool
- func (this *Bit16Cache) ShiftOneBit()
- func (this *Bit16Cache) WriteTo(w io.Writer) (int, error)
- type Bit1Cache
- func (this *Bit1Cache) GetIndex(index int) uint64
- func (this *Bit1Cache) ReadFrom(r io.Reader) (int, error)
- func (this *Bit1Cache) ResetIndex(index int, value uint64)
- func (this *Bit1Cache) SetLastBit(index int) bool
- func (this *Bit1Cache) ShiftOneBit()
- func (this *Bit1Cache) WriteTo(w io.Writer) (int, error)
- type Bit2Cache
- func (this *Bit2Cache) GetIndex(index int) uint64
- func (this *Bit2Cache) ReadFrom(r io.Reader) (int, error)
- func (this *Bit2Cache) ResetIndex(index int, value uint64)
- func (this *Bit2Cache) SetLastBit(index int) bool
- func (this *Bit2Cache) ShiftOneBit()
- func (this *Bit2Cache) WriteTo(w io.Writer) (int, error)
- type Bit32Cache
- func (this *Bit32Cache) GetIndex(index int) uint64
- func (this *Bit32Cache) ReadFrom(r io.Reader) (int, error)
- func (this *Bit32Cache) ResetIndex(index int, value uint64)
- func (this *Bit32Cache) SetLastBit(index int) bool
- func (this *Bit32Cache) ShiftOneBit()
- func (this *Bit32Cache) WriteTo(w io.Writer) (int, error)
- type Bit4Cache
- func (this *Bit4Cache) GetIndex(index int) uint64
- func (this *Bit4Cache) ReadFrom(r io.Reader) (int, error)
- func (this *Bit4Cache) ResetIndex(index int, value uint64)
- func (this *Bit4Cache) SetLastBit(index int) bool
- func (this *Bit4Cache) ShiftOneBit()
- func (this *Bit4Cache) WriteTo(w io.Writer) (int, error)
- type Bit64Cache
- func (this *Bit64Cache) GetIndex(index int) uint64
- func (this *Bit64Cache) ReadFrom(r io.Reader) (int, error)
- func (this *Bit64Cache) ResetIndex(index int, value uint64)
- func (this *Bit64Cache) SetLastBit(index int) bool
- func (this *Bit64Cache) ShiftOneBit()
- func (this *Bit64Cache) WriteTo(w io.Writer) (int, error)
- type Bit8Cache
- func (this *Bit8Cache) GetIndex(index int) uint64
- func (this *Bit8Cache) ReadFrom(r io.Reader) (int, error)
- func (this *Bit8Cache) ResetIndex(index int, value uint64)
- func (this *Bit8Cache) SetLastBit(index int) bool
- func (this *Bit8Cache) ShiftOneBit()
- func (this *Bit8Cache) WriteTo(w io.Writer) (int, error)
- type Cache
- type CacheCommon
Constants ¶
This section is empty.
Variables ¶
View Source
var OpBits = [8]uint8{1, 2, 4, 8, 16, 32, 64, 128}
Functions ¶
This section is empty.
Types ¶
type Bit16Cache ¶
type Bit16Cache struct { CacheCommon // contains filtered or unexported fields }
---------------------------16-------------------------------------
func NewBit16Cache ¶
func NewBit16Cache(capa int) *Bit16Cache
func (*Bit16Cache) GetIndex ¶
func (this *Bit16Cache) GetIndex(index int) uint64
func (*Bit16Cache) ResetIndex ¶
func (this *Bit16Cache) ResetIndex(index int, value uint64)
func (*Bit16Cache) SetLastBit ¶
func (this *Bit16Cache) SetLastBit(index int) bool
func (*Bit16Cache) ShiftOneBit ¶
func (this *Bit16Cache) ShiftOneBit()
type Bit1Cache ¶
type Bit1Cache struct { CacheCommon // contains filtered or unexported fields }
-----------------1------------------------------
func NewBit1Cache ¶
func (*Bit1Cache) ResetIndex ¶
func (*Bit1Cache) SetLastBit ¶
func (*Bit1Cache) ShiftOneBit ¶
func (this *Bit1Cache) ShiftOneBit()
type Bit2Cache ¶
type Bit2Cache struct { CacheCommon // contains filtered or unexported fields }
-----------------2------------------------------
func NewBit2Cache ¶
func (*Bit2Cache) ResetIndex ¶
func (*Bit2Cache) SetLastBit ¶
func (*Bit2Cache) ShiftOneBit ¶
func (this *Bit2Cache) ShiftOneBit()
type Bit32Cache ¶
type Bit32Cache struct { CacheCommon // contains filtered or unexported fields }
-----------------------------32------------------------
func NewBit32Cache ¶
func NewBit32Cache(capa int) *Bit32Cache
func (*Bit32Cache) GetIndex ¶
func (this *Bit32Cache) GetIndex(index int) uint64
func (*Bit32Cache) ResetIndex ¶
func (this *Bit32Cache) ResetIndex(index int, value uint64)
func (*Bit32Cache) SetLastBit ¶
func (this *Bit32Cache) SetLastBit(index int) bool
func (*Bit32Cache) ShiftOneBit ¶
func (this *Bit32Cache) ShiftOneBit()
type Bit4Cache ¶
type Bit4Cache struct { CacheCommon // contains filtered or unexported fields }
---------------------------4--------------------------------
func NewBit4Cache ¶
func (*Bit4Cache) ResetIndex ¶
func (*Bit4Cache) SetLastBit ¶
func (*Bit4Cache) ShiftOneBit ¶
func (this *Bit4Cache) ShiftOneBit()
type Bit64Cache ¶
type Bit64Cache struct { CacheCommon // contains filtered or unexported fields }
---------------------------64----------------------------
func NewBit64Cache ¶
func NewBit64Cache(capa int) *Bit64Cache
func (*Bit64Cache) GetIndex ¶
func (this *Bit64Cache) GetIndex(index int) uint64
func (*Bit64Cache) ResetIndex ¶
func (this *Bit64Cache) ResetIndex(index int, value uint64)
func (*Bit64Cache) SetLastBit ¶
func (this *Bit64Cache) SetLastBit(index int) bool
func (*Bit64Cache) ShiftOneBit ¶
func (this *Bit64Cache) ShiftOneBit()
type Bit8Cache ¶
type Bit8Cache struct { CacheCommon // contains filtered or unexported fields }
---------------------------8--------------------------------
func NewBit8Cache ¶
func (*Bit8Cache) ResetIndex ¶
func (*Bit8Cache) SetLastBit ¶
func (*Bit8Cache) ShiftOneBit ¶
func (this *Bit8Cache) ShiftOneBit()
type Cache ¶
type Cache interface { //how many bits of the id's flag, eg: 1,2,4,8,16,32,64 Bits() int // buffer capacity Capacity() int //how much value != 0 Count() int //get the max index MaxIndex() int // all id's flags <<1 ShiftOneBit() //set last bit, if is the first time return true SetLastBit(index int) bool //get index value GetIndex(index int) uint64 //set index value SetIndex(index int, value uint64) ReadFrom(r io.Reader) (int, error) WriterTo(w io.Writer) (int, error) }
type CacheCommon ¶
type CacheCommon struct {
// contains filtered or unexported fields
}
func (*CacheCommon) Bits ¶
func (this *CacheCommon) Bits() int
func (*CacheCommon) Capacity ¶
func (this *CacheCommon) Capacity() int
func (*CacheCommon) Count ¶
func (this *CacheCommon) Count() int
func (*CacheCommon) MaxIndex ¶
func (this *CacheCommon) MaxIndex() int
Click to show internal directories.
Click to hide internal directories.