SystemEX  Lacking
Additional generic collection types missing in .net

A lowโ€‘level extension framework for .NET providing STLโ€‘style iterators, traversal interfaces, randomโ€‘access iteration, advanced generic data structures, fixedโ€‘size buffers, maps, multimaps, and a modular cache/RAID subsystem.
Designed for deterministic, highโ€‘performance, byteโ€‘level applications without external dependencies.

โœจ Overview

This library extends the .NET collection ecosystem with:

  • Iterator interfaces inspired by C++ STL
  • Generic algorithms (Distance, Find, LowerBound, Reverse, Rotate, etc.)
  • Advanced collection types (Map, MultiMap, SortedMap, Deque, Queue, Stack, Array, FixedArray, FixedMap)
  • Nodeโ€‘based traversal structures
  • Deterministic, fixedโ€‘size memory containers
  • Cache and RAIDโ€‘style memory layouts
  • Utility modules for comparison, endianโ€‘aware random, bit operations, and layout validation

All components are allocationโ€‘controlled, predictable, and engineโ€‘oriented.

๐Ÿ“ฆ Installation

NuGet

dotnet add package RoseLeDark.Collections.Missings

Manual

  • Clone the repository
  • Add the project reference
  • Import the namespaces:
Definition Array.cs:24
Definition Algorithm.cs:22

๐Ÿงฉ Iterator System

The library provides a full iterator hierarchy:

  • ITerator<T>
  • IForwardIterator<T>
  • IBidirectionalIterator<T>
  • IRandomAccessIterator<T>
  • Nodeโ€‘based iterators for tree and list structures

These iterators support:

  • Forward(), Back(), Advance(n)
  • Clone() for safe traversal
  • Current element access
  • IsBegin, IsEnd
  • Structural traversal via Node, NodeChain, NodeRange, NodeSlice, GroupNode, StarNode

๐Ÿงฎ Generic Algorithms

Located under SystemEx.Utils.Iterator and SystemEx.Utils:

  • Distance(first, last)
  • Find(first, last, value, cmp)
  • LowerBound(first, last, value, cmp)
  • UpperBound(first, last, value, cmp)
  • Reverse(first, last)
  • Rotate(first, middle, last)
  • ForEach(first, last, action)
  • Swap, Fill, FillN
  • Copy, Move
  • Min, Max, Clamp
  • MinElement, MaxElement, MinMaxElement
  • LexicographicalCompare

These algorithms behave similarly to STL equivalents, but are implemented in pure C# with zero allocations.

๐Ÿ“š Collections

Core Types

  • Vector<T>
  • FixedVector<T>
  • Deque<T>
  • Queue<T>
  • Stack<T>
  • BinQueue<T>
  • Set<T>
  • MultiSet<T>
  • UnorderedMultiSet<T>
  • UnorderedSet<T>

Map System

  • Map<TKey, TValue>
  • MultiMap<TKey, TValue>
  • SortedMap<TKey, TValue>
  • FixedMap<TKey, TValue>
  • IMap, ISortedMap, INode, ITraverse

Tuple & Pair Types

  • ITuple
  • Pair<T1, T2> : ITuple
  • Triple<T1, T2, T3> : ITuple
  • Quad<T1, T2, T3, T4> : ITuple
  • Tuple : ITuple
  • TupleList<T> where T : ITuple

๐Ÿงฑ Cache & RAID Subsystem (Future Release)

  • Cache
  • CacheMirrored
  • CacheStripped

These provide deterministic, fixedโ€‘size memory layouts suitable for:

  • engine subsystems
  • device memory staging
  • zeroโ€‘copy pipelines
  • shared memory regions

๐Ÿ›  Utilities

Located under SystemEx.Utils:

  • BitUtils
  • Layout (struct layout validation)
  • Random (endianโ€‘aware random generation)
  • Utils (general helpers)
  • CompareResult + CompFunc<T>

๐Ÿ“ Project Structure

SystemEx/
โ”œโ”€ Device/ [ namespace SystemEx.Device ]
โ”‚ โ”œโ”€ IKernel.cs
โ”‚ โ”œโ”€ RamKernel.cs
โ”‚ โ”œโ”€ Interop/ [ namespace SystemEx.Device.Interop ]
โ”‚ โ”‚ โ”œโ”€ IDeviceSharedBackend.cs
โ”‚ โ”‚ โ”œโ”€ RamKernelLoader.cs
โ”‚ โ”‚ โ””โ”€ RamSharedBackend.cs
โ”‚ โ””โ”€ Memory/
โ”‚ โ”œโ”€ DeviceBuffer.cs
โ”‚ โ””โ”€ DeviceSharedBuffer.cs
โ”œโ”€ Base [ namespace SystemEx ]
โ”‚ โ”œโ”€ Buffer.cs
โ”‚ โ”œโ”€ FlexSpan.cs
โ”‚ โ”œโ”€ IComparableEx.cs
โ”‚ โ”œโ”€ IRange.cs
โ”‚ โ”œโ”€ Math.cs
โ”‚ โ”œโ”€ NumberRange.cs
โ”‚ โ”œโ”€ NumberRangeIterrator.cs
โ”‚ โ”œโ”€ NumberRangeStepper.cs
โ”‚ โ””โ”€Triple.cs
โ”œโ”€ Collections/
โ”‚ โ””โ”€ Generic/ [ namespace SystemEx.Collections.Generic ]
โ”‚ โ”œโ”€ Vector.cs
โ”‚ โ”œโ”€ BinQueue.cs
โ”‚ โ”œโ”€ Cache.cs
โ”‚ โ”œโ”€ Cluster.cs
| โ”œโ”€ ContainerFlexSpan.cs
โ”‚ โ”œโ”€ Deque.cs
โ”‚ โ”œโ”€ Find.cs
โ”‚ โ”œโ”€ FixedVector.cs
โ”‚ โ”œโ”€ FixedMap.cs
โ”‚ โ”œโ”€ GroupNode.cs
โ”‚ โ”œโ”€ Map.cs
โ”‚ โ”œโ”€ MirroredCache.cs
โ”‚ โ”œโ”€ MultiMap.cs
โ”‚ โ”œโ”€ MultiSet.cs
โ”‚ โ”œโ”€ MultiTupleMap.cs
โ”‚ โ”œโ”€ Node.cs
โ”‚ โ”œโ”€ NodeChain.cs
โ”‚ โ”œโ”€ NodeRange.cs
โ”‚ โ”œโ”€ NodeSlice.cs
โ”‚ โ”œโ”€ Pair.cs
โ”‚ โ”œโ”€ PriorityQueue.cs
โ”‚ โ”œโ”€ Quad.cs
โ”‚ โ”œโ”€ Queue.cs
โ”‚ โ”œโ”€ Set.cs
โ”‚ โ”œโ”€ SortedMap.cs
โ”‚ โ”œโ”€ SortedMultiMap.cs
โ”‚ โ”œโ”€ SortedMultiTupleMap.cs
โ”‚ โ”œโ”€ SortedTupleList.cs
โ”‚ โ”œโ”€ SortedTupleMap.cs
โ”‚ โ”œโ”€ Stack.cs
โ”‚ โ”œโ”€ StarNode.cs
โ”‚ โ”œโ”€ StrippedCache.cs
โ”‚ โ”œโ”€ Triple.cs
โ”‚ โ”œโ”€ Tuple.cs
โ”‚ โ”œโ”€ TupleMap.cs
โ”‚ โ”œโ”€ TypeBuffer.cs
โ”‚ โ””โ”€ TupleList.cs
โ”œโ”€ Drawing/ [ namespace SystemEx.Drawing ]
| โ”œโ”€ Canvas.cs
| โ”œโ”€ ColorHDR.cs
| โ”œโ”€ ColorHSV.cs
| โ”œโ”€ ColorR8G8B8.cs
| โ”œโ”€ ColorR10G10B10.cs
| โ”œโ”€ ColorR16G16B16.cs
| โ”œโ”€ ... CMY, NCol, XYZ, YUV
| โ”œโ”€ Light.cs
| โ””โ”€ Colors.cs
โ”œโ”€ IO/ [ namespace SystemEx.IO ]
| โ”œโ”€ CachStream.cs
| โ””โ”€ WriteStream.cs
โ”œโ”€ Random/ [ namespace SystemEx.Random ]
| โ”œโ”€ Isaac32Engine.cs
| โ””โ”€ Randx.cs
โ”œโ”€ Numeric/ [ namespace SystemEx.Numeric ]
| โ”œโ”€ vec{2,3,4]f.cs
| โ”œโ”€ vec{2,3,4]d.cs
| โ”œโ”€ vec{2,3,4]i.cs
| โ”œโ”€ quadf.cs
| โ”œโ”€ quadd.cs
| โ”œโ”€ m44f.cs
| โ”œโ”€ m44d.cs
| โ”œโ”€ DQuadv.cs
| โ”œโ”€ AxisAngle.cs
| โ””โ”€ Projection.cs
โ”œโ”€ Utils/ [ namespace SystemEx.Utils ]
โ”‚ โ”œโ”€ Algorithm.cs
โ”‚ โ”œโ”€ BitUtils.cs
โ”‚ โ”œโ”€ Conversion.cs
โ”‚ โ”œโ”€ Layout.cs
โ”‚ โ””โ”€ Random.cs
โ”œโ”€ LICENSE.md
โ”œโ”€ CHANGELOG.md
โ”œโ”€ RoseLeDark.Collections.Missings.png
โ”œโ”€ RoseLeDark.Collections.Missings.svg
โ””โ”€ README.md

๐Ÿ“ License

Licensed under the European Union Public Licence (EUPL) v1.2.
See the LICENSE.md file for details.

๐Ÿšง Status

Active development.
More iterator types, algorithms, and data structures will be added as needed.