Namespace SwiftCollections
Classes
- SwiftBiDictionary<T1, T2>
Represents a bidirectional dictionary that allows for efficient lookups in both directions, mapping keys to values and values back to keys. Both keys and values must be unique to maintain the integrity of the bidirectional relationship. Inherits from SwiftDictionary<TKey, TValue> and maintains a reverse map for reverse lookups.
- SwiftBucket<T>
Represents a high-performance bucket collection that assigns and manages stable integer indices for stored items. Provides O(1) insertion, removal, and lookup by internally generated index.
- SwiftDictionary<TKey, TValue>
A high-performance, memory-efficient dictionary providing lightning-fast O(1) operations for addition, retrieval, and removal, optimized to outperform standard dictionaries.
- SwiftDictionary<TKey, TValue>.KeyCollection
Provides a dynamic, read-only collection of all keys in the dictionary, supporting enumeration and copy operations.
- SwiftDictionary<TKey, TValue>.ValueCollection
Offers a dynamic, read-only collection of all values in the dictionary, supporting enumeration and copy operations.
- SwiftExtensions
Provides extension methods for collection manipulation and utility functions.
- SwiftGenerationalBucket<T>
Represents a high-performance generational bucket that assigns stable handles to stored items.
- SwiftHashSet<T>
Represents a high-performance set of unique values with efficient operations for addition, removal, and lookup
- SwiftList<T>
SwiftList<T>is a high-performance, memory-efficient dynamic list designed to outperform traditional generic lists in speed-critical applications.By utilizing custom growth and shrink strategies, SwiftList optimizes memory allocation and minimizes resizing overhead, all while maintaining compact storage. With aggressive inlining and optimized algorithms, SwiftList delivers faster iteration, insertion, and overall memory management compared to standard List. It is ideal for scenarios where predictable performance and minimal memory allocations are essential.
This implementation is optimized for performance and does not perform versioning checks. Modifying the list during enumeration may result in undefined behavior.
- SwiftPackedSet<T>
Represents a high-performance set that stores unique values in a densely packed array while providing O(1) lookups via an internal hash map.
- SwiftQueue<T>
SwiftQueue<T>is a high-performance, circular buffer-based queue designed for ultra-low-latency enqueue and dequeue operations.It leverages power-of-two capacities and bitwise arithmetic to eliminate expensive modulo operations, enhancing performance. By managing memory efficiently with a wrap-around technique and custom capacity growth strategies, SwiftQueue minimizes allocations and resizing. Aggressive inlining and optimized exception handling further reduce overhead, making SwiftQueue outperform traditional queues, especially in scenarios with high-frequency additions and removals.
- SwiftSortedList<T>
Represents a dynamically sorted collection of elements. Provides efficient O(log n) operations for adding, removing, and checking for the presence of elements.
- SwiftSparseMap<T>
Represents a high-performance sparse map that stores values indexed by externally supplied integer keys. Provides O(1) Add, Remove, Contains, and lookup operations while maintaining densely packed storage for cache-friendly iteration.
- SwiftSparseSet
Represents a high-performance sparse set for externally supplied non-negative integer IDs. Provides O(1) Add, Remove, Contains, and densely packed iteration.
- SwiftStack<T>
Represents a fast, array-based stack (LIFO - Last-In-First-Out) collection of objects.
The
SwiftStack<T>class provides O(1) time complexity forPushandPopoperations, making it highly efficient for scenarios where performance is critical. It minimizes memory allocations by reusing internal arrays and offers methods likeFastClearto quickly reset the stack without deallocating memory.This implementation is optimized for performance and does not perform versioning checks. Modifying the stack during enumeration may result in undefined behavior.
Structs
- Array2DState<T>
Represents the immutable state of a two-dimensional array, including its dimensions and underlying data.
- Array3DState<T>
Represents the immutable state of a three-dimensional array, including its dimensions and underlying data.
- SwiftArrayState<T>
Represents an immutable snapshot of an array of items of the specified type.
- SwiftBucketState<T>
Represents the state of a bucket in a fast allocation pool, including the items, allocation status, free indices, and peak usage count.
- SwiftBucket<T>.SwiftBucketEnumerator
Enumerates the elements of a SwiftBucket<T> collection.
- SwiftDictionaryState<TKey, TValue>
Represents an immutable snapshot of the key-value pairs contained in a dictionary at a specific point in time.
- SwiftDictionary<TKey, TValue>.Entry
Represents a single key-value pair in the dictionary, including its hash code for quick access.
- SwiftDictionary<TKey, TValue>.KeyCollection.KeyCollectionEnumerator
Enumerates the keys of a SwiftDictionary<TKey, TValue> collection.
- SwiftDictionary<TKey, TValue>.SwiftDictionaryEnumerator
Provides an efficient enumerator for iterating over the key-value pairs in the SwiftDictionary, enabling smooth traversal during enumeration.
- SwiftDictionary<TKey, TValue>.ValueCollection.ValueCollectionEnumerator
Enumerates the values in a SwiftDictionary collection.
- SwiftGenerationalBucketState<T>
Represents the immutable state of a generational bucket, including item storage, allocation status, generation tracking, and free index management.
- SwiftGenerationalBucket<T>.SwiftGenerationalBucketEnumerator
Enumerates the elements of a SwiftGenerationalBucket<T> collection in a forward-only, read-only manner.
- SwiftHandle
Represents a value type handle that uniquely identifies an object or resource by index and generation.
- SwiftHashSet<T>.SwiftHashSetEnumerator
Provides an enumerator for iterating through the elements of the hash set, ensuring consistency during enumeration.
- SwiftList<T>.SwiftListEnumerator
Enumerates the elements of a SwiftList<T> collection.
- SwiftPackedSet<T>.SwiftPackedSetEnumerator
Enumerates the elements of a SwiftPackedSet<T> collection.
- SwiftQueue<T>.SwiftQueueEnumerator
Enumerates the elements of a SwiftQueue<T> in the order they would be dequeued.
- SwiftSortedList<T>.SwiftSorterEnumerator
Supports simple iteration over the elements of a SwiftSortedList<T> in sorted order.
- SwiftSparseMapState<T>
Represents the immutable state of a sparse map, containing the dense keys and associated values.
- SwiftSparseMap<T>.SwiftSparseMapEnumerator
Supports iteration over the key/value pairs in a SwiftSparseMap<T> collection.
- SwiftSparseSet.SwiftSparseSetEnumerator
Supports iteration over IDs in a SwiftSparseSet.
- SwiftStack<T>.SwiftStackEnumerator
Supports simple iteration over the elements of a SwiftStack<T> in last-in, first-out (LIFO) order.
Interfaces
- ISwiftCloneable<T>
Defines a method that copies all elements from the current instance to a specified collection, replacing its contents with an exact clone of the source.