Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectNotFoundError ¶
type ObjectNotFoundError struct{}
func (*ObjectNotFoundError) Error ¶
func (e *ObjectNotFoundError) Error() string
type ObjectPool ¶
type ObjectPool[T comparable] struct { Objects []T }
ObjectPool stores a collection of object pointers with utility functions to manipulate the pool.
Important note: elements in an ObjectPool will NOT stay in the same order.
func NewObjectPool ¶
func NewObjectPool[T comparable]() *ObjectPool[T]
func (*ObjectPool[T]) Add ¶
func (pool *ObjectPool[T]) Add(obj T)
func (*ObjectPool[T]) Contains ¶
func (pool *ObjectPool[T]) Contains(obj T) bool
func (*ObjectPool[T]) Find ¶
func (pool *ObjectPool[T]) Find(obj T) (int, error)
func (*ObjectPool[T]) FindAndRemove ¶
func (pool *ObjectPool[T]) FindAndRemove(obj T) error
func (*ObjectPool[T]) Remove ¶
func (pool *ObjectPool[T]) Remove(index int)
Click to show internal directories.
Click to hide internal directories.