Documentation ¶
Overview ¶
Package node is a generated generator package.
Package node is a generated generator package.
Package node is a generated generator package.
Package node is a generated generator package.
Package node is a generated generator package.
Index ¶
- func Equals[K comparable, V any](a, b Node[K, V]) bool
- type B
- func (n *B[K, V]) AsPointer() unsafe.Pointer
- func (n *B[K, V]) Cost() uint32
- func (n *B[K, V]) DecrementFrequency()
- func (n *B[K, V]) Die()
- func (n *B[K, V]) Expiration() uint32
- func (n *B[K, V]) Frequency() uint8
- func (n *B[K, V]) IncrementFrequency()
- func (n *B[K, V]) IsAlive() bool
- func (n *B[K, V]) IsExpired() bool
- func (n *B[K, V]) IsMain() bool
- func (n *B[K, V]) IsSmall() bool
- func (n *B[K, V]) Key() K
- func (n *B[K, V]) MarkMain()
- func (n *B[K, V]) MarkSmall()
- func (n *B[K, V]) Next() Node[K, V]
- func (n *B[K, V]) NextExp() Node[K, V]
- func (n *B[K, V]) Prev() Node[K, V]
- func (n *B[K, V]) PrevExp() Node[K, V]
- func (n *B[K, V]) ResetFrequency()
- func (n *B[K, V]) SetNext(v Node[K, V])
- func (n *B[K, V]) SetNextExp(v Node[K, V])
- func (n *B[K, V]) SetPrev(v Node[K, V])
- func (n *B[K, V]) SetPrevExp(v Node[K, V])
- func (n *B[K, V]) Unmark()
- func (n *B[K, V]) Value() V
- type BC
- func (n *BC[K, V]) AsPointer() unsafe.Pointer
- func (n *BC[K, V]) Cost() uint32
- func (n *BC[K, V]) DecrementFrequency()
- func (n *BC[K, V]) Die()
- func (n *BC[K, V]) Expiration() uint32
- func (n *BC[K, V]) Frequency() uint8
- func (n *BC[K, V]) IncrementFrequency()
- func (n *BC[K, V]) IsAlive() bool
- func (n *BC[K, V]) IsExpired() bool
- func (n *BC[K, V]) IsMain() bool
- func (n *BC[K, V]) IsSmall() bool
- func (n *BC[K, V]) Key() K
- func (n *BC[K, V]) MarkMain()
- func (n *BC[K, V]) MarkSmall()
- func (n *BC[K, V]) Next() Node[K, V]
- func (n *BC[K, V]) NextExp() Node[K, V]
- func (n *BC[K, V]) Prev() Node[K, V]
- func (n *BC[K, V]) PrevExp() Node[K, V]
- func (n *BC[K, V]) ResetFrequency()
- func (n *BC[K, V]) SetNext(v Node[K, V])
- func (n *BC[K, V]) SetNextExp(v Node[K, V])
- func (n *BC[K, V]) SetPrev(v Node[K, V])
- func (n *BC[K, V]) SetPrevExp(v Node[K, V])
- func (n *BC[K, V]) Unmark()
- func (n *BC[K, V]) Value() V
- type BE
- func (n *BE[K, V]) AsPointer() unsafe.Pointer
- func (n *BE[K, V]) Cost() uint32
- func (n *BE[K, V]) DecrementFrequency()
- func (n *BE[K, V]) Die()
- func (n *BE[K, V]) Expiration() uint32
- func (n *BE[K, V]) Frequency() uint8
- func (n *BE[K, V]) IncrementFrequency()
- func (n *BE[K, V]) IsAlive() bool
- func (n *BE[K, V]) IsExpired() bool
- func (n *BE[K, V]) IsMain() bool
- func (n *BE[K, V]) IsSmall() bool
- func (n *BE[K, V]) Key() K
- func (n *BE[K, V]) MarkMain()
- func (n *BE[K, V]) MarkSmall()
- func (n *BE[K, V]) Next() Node[K, V]
- func (n *BE[K, V]) NextExp() Node[K, V]
- func (n *BE[K, V]) Prev() Node[K, V]
- func (n *BE[K, V]) PrevExp() Node[K, V]
- func (n *BE[K, V]) ResetFrequency()
- func (n *BE[K, V]) SetNext(v Node[K, V])
- func (n *BE[K, V]) SetNextExp(v Node[K, V])
- func (n *BE[K, V]) SetPrev(v Node[K, V])
- func (n *BE[K, V]) SetPrevExp(v Node[K, V])
- func (n *BE[K, V]) Unmark()
- func (n *BE[K, V]) Value() V
- type BEC
- func (n *BEC[K, V]) AsPointer() unsafe.Pointer
- func (n *BEC[K, V]) Cost() uint32
- func (n *BEC[K, V]) DecrementFrequency()
- func (n *BEC[K, V]) Die()
- func (n *BEC[K, V]) Expiration() uint32
- func (n *BEC[K, V]) Frequency() uint8
- func (n *BEC[K, V]) IncrementFrequency()
- func (n *BEC[K, V]) IsAlive() bool
- func (n *BEC[K, V]) IsExpired() bool
- func (n *BEC[K, V]) IsMain() bool
- func (n *BEC[K, V]) IsSmall() bool
- func (n *BEC[K, V]) Key() K
- func (n *BEC[K, V]) MarkMain()
- func (n *BEC[K, V]) MarkSmall()
- func (n *BEC[K, V]) Next() Node[K, V]
- func (n *BEC[K, V]) NextExp() Node[K, V]
- func (n *BEC[K, V]) Prev() Node[K, V]
- func (n *BEC[K, V]) PrevExp() Node[K, V]
- func (n *BEC[K, V]) ResetFrequency()
- func (n *BEC[K, V]) SetNext(v Node[K, V])
- func (n *BEC[K, V]) SetNextExp(v Node[K, V])
- func (n *BEC[K, V]) SetPrev(v Node[K, V])
- func (n *BEC[K, V]) SetPrevExp(v Node[K, V])
- func (n *BEC[K, V]) Unmark()
- func (n *BEC[K, V]) Value() V
- type Config
- type Manager
- type Node
- func CastPointerToB[K comparable, V any](ptr unsafe.Pointer) Node[K, V]
- func CastPointerToBC[K comparable, V any](ptr unsafe.Pointer) Node[K, V]
- func CastPointerToBE[K comparable, V any](ptr unsafe.Pointer) Node[K, V]
- func CastPointerToBEC[K comparable, V any](ptr unsafe.Pointer) Node[K, V]
- func NewB[K comparable, V any](key K, value V, expiration, cost uint32) Node[K, V]
- func NewBC[K comparable, V any](key K, value V, expiration, cost uint32) Node[K, V]
- func NewBE[K comparable, V any](key K, value V, expiration, cost uint32) Node[K, V]
- func NewBEC[K comparable, V any](key K, value V, expiration, cost uint32) Node[K, V]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type B ¶
type B[K comparable, V any] struct { // contains filtered or unexported fields }
B is a cache entry that provide the following features:
1. Base
func (*B[K, V]) DecrementFrequency ¶
func (n *B[K, V]) DecrementFrequency()
func (*B[K, V]) Expiration ¶
func (*B[K, V]) IncrementFrequency ¶
func (n *B[K, V]) IncrementFrequency()
func (*B[K, V]) ResetFrequency ¶
func (n *B[K, V]) ResetFrequency()
func (*B[K, V]) SetNextExp ¶
func (*B[K, V]) SetPrevExp ¶
type BC ¶
type BC[K comparable, V any] struct { // contains filtered or unexported fields }
BC is a cache entry that provide the following features:
1. Base
2. Cost
func (*BC[K, V]) DecrementFrequency ¶
func (n *BC[K, V]) DecrementFrequency()
func (*BC[K, V]) Expiration ¶
func (*BC[K, V]) IncrementFrequency ¶
func (n *BC[K, V]) IncrementFrequency()
func (*BC[K, V]) ResetFrequency ¶
func (n *BC[K, V]) ResetFrequency()
func (*BC[K, V]) SetNextExp ¶
func (*BC[K, V]) SetPrevExp ¶
type BE ¶
type BE[K comparable, V any] struct { // contains filtered or unexported fields }
BE is a cache entry that provide the following features:
1. Base
2. Expiration
func (*BE[K, V]) DecrementFrequency ¶
func (n *BE[K, V]) DecrementFrequency()
func (*BE[K, V]) Expiration ¶
func (*BE[K, V]) IncrementFrequency ¶
func (n *BE[K, V]) IncrementFrequency()
func (*BE[K, V]) ResetFrequency ¶
func (n *BE[K, V]) ResetFrequency()
func (*BE[K, V]) SetNextExp ¶
func (*BE[K, V]) SetPrevExp ¶
type BEC ¶
type BEC[K comparable, V any] struct { // contains filtered or unexported fields }
BEC is a cache entry that provide the following features:
1. Base
2. Expiration
3. Cost
func (*BEC[K, V]) DecrementFrequency ¶
func (n *BEC[K, V]) DecrementFrequency()
func (*BEC[K, V]) Expiration ¶
func (*BEC[K, V]) IncrementFrequency ¶
func (n *BEC[K, V]) IncrementFrequency()
func (*BEC[K, V]) ResetFrequency ¶
func (n *BEC[K, V]) ResetFrequency()
func (*BEC[K, V]) SetNextExp ¶
func (*BEC[K, V]) SetPrevExp ¶
type Manager ¶
type Manager[K comparable, V any] struct { // contains filtered or unexported fields }
func NewManager ¶
func NewManager[K comparable, V any](c Config) *Manager[K, V]
type Node ¶
type Node[K comparable, V any] interface { // Key returns the key. Key() K // Value returns the value. Value() V // AsPointer returns the node as a pointer. AsPointer() unsafe.Pointer // Prev returns the previous node in the eviction policy. Prev() Node[K, V] // SetPrev sets the previous node in the eviction policy. SetPrev(v Node[K, V]) // Next returns the next node in the eviction policy. Next() Node[K, V] // SetNext sets the next node in the eviction policy. SetNext(v Node[K, V]) // PrevExp returns the previous node in the expiration policy. PrevExp() Node[K, V] // SetPrevExp sets the previous node in the expiration policy. SetPrevExp(v Node[K, V]) // NextExp returns the next node in the expiration policy. NextExp() Node[K, V] // SetNextExp sets the next node in the expiration policy. SetNextExp(v Node[K, V]) // IsExpired returns true if node is expired. IsExpired() bool // Expiration returns the expiration time. Expiration() uint32 // Cost returns the cost of the node. Cost() uint32 // IsAlive returns true if the entry is available in the hash-table. IsAlive() bool // Die sets the node to the dead state. Die() // Frequency returns the frequency of the node. Frequency() uint8 // IncrementFrequency increments the frequency of the node. IncrementFrequency() // DecrementFrequency decrements the frequency of the node. DecrementFrequency() // ResetFrequency resets the frequency. ResetFrequency() // MarkSmall sets the status to the small queue. MarkSmall() // IsSmall returns true if node is in the small queue. IsSmall() bool // MarkMain sets the status to the main queue. MarkMain() // IsMain returns true if node is in the main queue. IsMain() bool // Unmark sets the status to unknown. Unmark() }
Node is a cache entry.
func CastPointerToB ¶
func CastPointerToB[K comparable, V any](ptr unsafe.Pointer) Node[K, V]
CastPointerToB casts a pointer to B.
func CastPointerToBC ¶
func CastPointerToBC[K comparable, V any](ptr unsafe.Pointer) Node[K, V]
CastPointerToBC casts a pointer to BC.
func CastPointerToBE ¶
func CastPointerToBE[K comparable, V any](ptr unsafe.Pointer) Node[K, V]
CastPointerToBE casts a pointer to BE.
func CastPointerToBEC ¶
func CastPointerToBEC[K comparable, V any](ptr unsafe.Pointer) Node[K, V]
CastPointerToBEC casts a pointer to BEC.
func NewB ¶
func NewB[K comparable, V any](key K, value V, expiration, cost uint32) Node[K, V]
NewB creates a new B.
func NewBC ¶
func NewBC[K comparable, V any](key K, value V, expiration, cost uint32) Node[K, V]
NewBC creates a new BC.