SystemEX  Lacking
Additional generic collection types missing in .net
Collections

A simple random-access iterator for array-based data structures. Provides forward, backward, and offset-based movement. More...

Collaboration diagram for Collections:

Topics

 Interfaces
 Defines the basic operations for a fixed-size or dynamic array structure, including indexed access, insertion, removal, traversal, and search utilities.

Classes

class  SystemEx.Collections.Generic.ArrayRandomAccessIterator< T >
class  SystemEx.Collections.Generic.Array< T >
 A dynamic array implementation that supports optional auto-growth, indexed access, insertion, removal, traversal, and basic search operations. More...
class  SystemEx.Collections.Generic.BinQueue< T >
class  SystemEx.Collections.Generic.CacheIsSharedException
 Exception thrown when an operation is attempted on a shared or locked cache. More...
class  SystemEx.Collections.Generic.Cache
 Represents a low-level byte buffer with position tracking, typed read/write helpers, and optional locking behavior. More...
interface  SystemEx.Collections.Generic.ICluster< T >
 Represents a cluster node in a weighted graph structure. More...
class  SystemEx.Collections.Generic.Cluster< T >
 Basic implementation of ICluster<T> representing a node with weighted children. More...
class  SystemEx.Collections.Generic.Deque< T >
struct  SystemEx.Collections.Generic.Find< T, TContainer >
class  SystemEx.Collections.Generic.FixedArray< T >
class  SystemEx.Collections.Generic.FixedMap< T, TU >
struct  SystemEx.Collections.Generic.FixedVector< T >
class  SystemEx.Collections.Generic.GroupNode< T >
class  SystemEx.Collections.Generic.Map< T, TU >
class  SystemEx.Collections.Generic.MirroredCache
class  SystemEx.Collections.Generic.MultiMap< TT, TU >
class  SystemEx.Collections.Generic.MultiTupleMap
class  SystemEx.Collections.Generic.NodeIterrator< T >
 Iterator for navigating through a doubly linked Node<T> chain. Supports random access, forward/backward movement, foreach enumeration, and cloning of iterator state. More...
class  SystemEx.Collections.Generic.Node< T >
 Represents a doubly linked node with optional child and sibling. Supports list-style navigation (Prev/Next), tree-style traversal, splicing, swapping, reversing, and random access movement. More...
class  SystemEx.Collections.Generic.NodeChain< T >
 Represents a chained view over multiple NodeRange<T> segments, similar to std::views::concat in C++.
A NodeChain<T> allows iteration across several disjoint ranges of a linked Node<T> structure as if they formed one continuous sequence. More...
struct  SystemEx.Collections.Generic.NodeRange< T >
struct  SystemEx.Collections.Generic.NodeSlice< T >
struct  SystemEx.Collections.Generic.Pair< T, TU >
class  SystemEx.Collections.Generic.PriorityQueueExIterator< T, TU >
class  SystemEx.Collections.Generic.PriorityQueueEx< T, TU >
 A priority queue implemented on top of SortedMap<T, TU>.
Elements are stored as Pair<T, TU> where T is the value and TU is the priority.
Supports enqueue, dequeue, peek, priority updates, cloning, and median‑based selection. More...
struct  SystemEx.Collections.Generic.Quad< TT, TU, TW, TJ >
class  SystemEx.Collections.Generic.Queue< T >
struct  SystemEx.Collections.Generic.Set< T, TContainer >
 Equivalent to a std::flat_set, but implemented as an open, non-owning sorted view over any IContainerEx instance. The Set struct does not store elements itself; it maintains ordering by sorting the referenced container using either a user-provided sorting delegate or a built-in BubbleSort fallback when no delegate is supplied. More...
class  SystemEx.Collections.Generic.SortedArray< T >
class  SystemEx.Collections.Generic.SortedFixedArray< T >
class  SystemEx.Collections.Generic.SortedMap< T, TU >
class  SystemEx.Collections.Generic.SortedMultiTupleMap
class  SystemEx.Collections.Generic.SortedTupleList
class  SystemEx.Collections.Generic.SortedTupleMap
struct  SystemEx.Collections.Generic.StackLayer
class  SystemEx.Collections.Generic.Stack< T >
 A fixed‑size, backward‑growing stack implementation that supports multiple independent virtual stack layers sharing the same underlying buffer. More...
class  SystemEx.Collections.Generic.StarNode< T >
class  SystemEx.Collections.Generic.StrippedCache
struct  SystemEx.Collections.Generic.Triple< TT, TU, TW >
class  SystemEx.Collections.Generic.Tuple
class  SystemEx.Collections.Generic.TupleList
class  SystemEx.Collections.Generic.TupleMap
class  SystemEx.Collections.Generic.TypeBuffer< T >
struct  SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >
struct  SystemEx.Collections.Generic.UnorderedSet< T, TContainer >
struct  SystemEx.Collections.Generic.Vector< T >

Enumerations

enum  SystemEx.Collections.Generic.CacheType { SystemEx.Collections.Generic.CacheType.ToDevice , SystemEx.Collections.Generic.CacheType.FromDevice , SystemEx.Collections.Generic.CacheType.Both , SystemEx.Collections.Generic.CacheType.OnlySystem }
enum  SystemEx.Collections.Generic.SearchType { SystemEx.Collections.Generic.SearchType.SubtractWeight , SystemEx.Collections.Generic.SearchType.SetToWeight , SystemEx.Collections.Generic.SearchType.AccumulateCost }
enum  SystemEx.Collections.Generic.TraversOrder {
  SystemEx.Collections.Generic.TraversOrder.Preorder , SystemEx.Collections.Generic.TraversOrder.Inorder , SystemEx.Collections.Generic.TraversOrder.Postorder , SystemEx.Collections.Generic.TraversOrder.ListOrder ,
  SystemEx.Collections.Generic.TraversOrder.ReservListOrder
}

Functions

 SystemEx.Collections.Generic.CacheIsSharedException.CacheIsSharedException ()
 Exception thrown when an operation is attempted on a shared or locked cache.
 SystemEx.Collections.Generic.Cache.Cache (long capacity, CacheType type=CacheType.OnlySystem)
 Initializes a new cache with the specified capacity and type.
void SystemEx.Collections.Generic.Cache.SetZero ()
 Set Cache to Zero.
void SystemEx.Collections.Generic.Cache.Clear ()
 See SetZero.
 SystemEx.Collections.Generic.Cache.Cache (byte[] arr, CacheType type)
 Initializes a new cache from given array.
 SystemEx.Collections.Generic.Cache.Cache (FixedVector< byte > arr, CacheType type)
 Initializes a new cache from given array.
 SystemEx.Collections.Generic.Cache.Cache (Cache cache)
 Create a Copy from stream.
ulong SystemEx.Collections.Generic.Cache.Seek (SeekOrigin org, int pos)
 Moves the internal position according to the specified origin and offset.
virtual ulong SystemEx.Collections.Generic.Cache.WriteRange (ulong position, byte[] data)
 Writes a byte range into the cache starting at the specified position.
virtual ulong SystemEx.Collections.Generic.Cache.WriteRange (ulong start, ulong iend, byte[] data)
 Writes a byte range into the cache between start and iend .
static unsafe byte[] SystemEx.Collections.Generic.Cache.ToBytes< T > (ref T value)
 Converts an unmanaged value to its raw byte representation.
int SystemEx.Collections.Generic.Cache.Write (ulong position, uint value, Endian endian)
 Writes a 32-bit unsigned integer at the specified position.
int SystemEx.Collections.Generic.Cache.Write (ulong position, int value, Endian endian)
 Writes a 32-bit signed integer at the specified position.
int SystemEx.Collections.Generic.Cache.Write (ulong position, short value, Endian endian)
 Writes a 16-bit signed short at the specified position.
int SystemEx.Collections.Generic.Cache.Write (ulong position, char value)
 Writes a character at the specified position.
int SystemEx.Collections.Generic.Cache.Write (ulong position, byte value)
 Writes a byte at the specified position.
int SystemEx.Collections.Generic.Cache.Write (ulong position, ushort value, Endian endian)
 Writes a 16-bit unsigned short at the specified position.
int SystemEx.Collections.Generic.Cache.Write (ulong position, long value, Endian endian)
 Writes a 64-bit signed long at the specified position.
int SystemEx.Collections.Generic.Cache.Write (ulong position, ulong value, Endian endian)
 Writes a 64-bit unsigned long at the specified position.
int SystemEx.Collections.Generic.Cache.Write (ulong position, float value, Endian endian)
 Writes a single-precision floating-point value at the specified position.
int SystemEx.Collections.Generic.Cache.Write (ulong position, double value, Endian endian)
 Writes a double-precision floating-point value at the specified position.
uint SystemEx.Collections.Generic.Cache.ReadUInt (ulong position, Endian endian)
 Reads a 32-bit unsigned integer from the specified position.
int SystemEx.Collections.Generic.Cache.ReadInt (ulong position, Endian endian)
 Reads a 32-bit signed integer from the specified position.
short SystemEx.Collections.Generic.Cache.ReadShort (ulong position, Endian endian)
 Reads a 16-bit signed short from the specified position.
ushort SystemEx.Collections.Generic.Cache.ReadUShort (ulong position, Endian endian)
 Reads a 16-bit unsigned short from the specified position.
long SystemEx.Collections.Generic.Cache.ReadLong (ulong position, Endian endian)
 Reads a 64-bit signed long from the specified position.
ulong SystemEx.Collections.Generic.Cache.ReadULong (ulong position, Endian endian)
 Reads a 64-bit unsigned long from the specified position.
char SystemEx.Collections.Generic.Cache.ReadChar (ulong position)
 Reads a single character from the specified position.
float SystemEx.Collections.Generic.Cache.ReadFloat (ulong position, Endian endian)
 Reads a single-precision floating-point value from the specified position.
double SystemEx.Collections.Generic.Cache.ReadDouble (ulong position, Endian endian)
 Reads a double-precision floating-point value from the specified position.
int SystemEx.Collections.Generic.Cache.Write (byte data)
 Writes a single byte at the current position and advances the position.
byte SystemEx.Collections.Generic.Cache.Read (ulong position)
 Reads a single byte from the specified position.
virtual ? byte[] SystemEx.Collections.Generic.Cache.ReadRange (ulong position, uint count)
 Reads a range of bytes starting at the specified position.
virtual FixedVector< byte > SystemEx.Collections.Generic.Cache.ReadRangeEx (ulong position, uint count)
 Reads a range of bytes starting at the specified position.
int SystemEx.Collections.Generic.Cache.Read (byte[] buffer, int offset, int count)
 Reads bytes into the specified buffer and advances the internal position.
int SystemEx.Collections.Generic.Cache.Write (byte[] buffer, int offset, int count)
 Writes bytes from the specified buffer and advances the internal position.
byte[] SystemEx.Collections.Generic.Cache.ToArray ()
 Returns a copy of the internal buffer.
FixedVector< byte > SystemEx.Collections.Generic.Cache.ToArrayEx ()
 Returns a copy of the internal buffer, as Array<T>.
virtual ContainerFlexSpan< byte, FixedVector< byte > > SystemEx.Collections.Generic.Cache.AsFlexSpan (FlexSpanMode mode=FlexSpanMode.System)
 Creates a FlexSpan view over the valid portion of this array. The span does not copy data; it directly references the internal buffer.
virtual ContainerFlexSpan< byte, FixedVector< byte > > SystemEx.Collections.Generic.Cache.AsFlexSpan (long start, FlexSpanMode mode=FlexSpanMode.System)
 Creates a FlexSpan view starting at the specified offset. The span references the internal buffer directly and does not allocate.
virtual ContainerFlexSpan< byte, FixedVector< byte > > SystemEx.Collections.Generic.Cache.AsFlexSpan (long start, long endi, FlexSpanMode mode=FlexSpanMode.System)
 Creates a FlexSpan view starting at the specified offset. The span references the internal buffer directly and does not allocate.
 SystemEx.Collections.Generic.Find< T, TContainer >.Find (ref TContainer container)
 Initializes a new search helper bound to the specified container.
long SystemEx.Collections.Generic.Find< T, TContainer >.First (T value)
 Returns the index of the first occurrence of the specified value. If the value is not found, -1 is returned.
long SystemEx.Collections.Generic.Find< T, TContainer >.First (Func< T, bool > pred)
 Returns the index of the first element matching the given predicate. If no element matches, -1 is returned.
long SystemEx.Collections.Generic.Find< T, TContainer >.Last (T value)
 Returns the index of the last occurrence of the specified value. If the value is not found, -1 is returned.
long SystemEx.Collections.Generic.Find< T, TContainer >.Last (Func< T, bool > pred)
 Returns the index of the last element matching the given predicate. If no element matches, -1 is returned.
int SystemEx.Collections.Generic.Find< T, TContainer >.Of (T value)
 Counts how many elements in the container equal the specified value.
int SystemEx.Collections.Generic.Find< T, TContainer >.Where (Func< T, bool > pred)
 Counts how many elements in the container satisfy the given predicate.
bool SystemEx.Collections.Generic.Find< T, TContainer >.Exists (T value)
 Determines whether the container contains at least one element equal to the specified value.
bool SystemEx.Collections.Generic.Find< T, TContainer >.TryGet (T Key, out int index)
 Attempts to find the index of the specified key.
long SystemEx.Collections.Generic.Find< T, TContainer >.LowerBound (T key, ISimpleCompare< T > cmp)
 Finds the first index at which the element is not smaller than the specified key. The comparison is performed using the provided ISimpleCompare<T> predicate, which defines the relation a < b.
long SystemEx.Collections.Generic.Find< T, TContainer >.UpperBound (T key, ISimpleCompare< T > cmp)
 Finds the first index at which the element is strictly larger than the specified key. The comparison is performed using the provided ISimpleCompare<T> predicate, which defines the relation a < b.
delegate void SystemEx.Collections.Generic.SortAction< TCompare, TContainer > (ref TContainer container, TCompare comparer)
 SystemEx.Collections.Generic.Set< T, TContainer >.Set (ref TContainer keys, SortAction< ISimpleCompare< T >, TContainer >? sorter=null)
 Creates a new sorted view over the given container. The container reference is stored and immediately sorted using the comparer and with an optional sort delegate.
 SystemEx.Collections.Generic.Set< T, TContainer >.Set (ref TContainer keys, ISimpleCompare< T > comparer, SortAction< ISimpleCompare< T >, TContainer >? sorter=null)
 Creates a new sorted view over the given container. The container reference is stored and immediately sorted using the comparer and with an optional sort delegate.
T[] SystemEx.Collections.Generic.Set< T, TContainer >.Extract (long index)
 Extracts all elements starting at the given index. The extracted elements are removed from the underlying container and returned as a new array.
bool SystemEx.Collections.Generic.Set< T, TContainer >.Insert (T value)
 Inserts a value into the container and re-sorts the elements.
bool SystemEx.Collections.Generic.Set< T, TContainer >.Insert (long index, T value)
 Inserts a value at the specified index and re-sorts the elements.
bool SystemEx.Collections.Generic.Set< T, TContainer >.Insert (long start, long end, T value)
 Inserts a value into a range and re-sorts the elements.
bool SystemEx.Collections.Generic.Set< T, TContainer >.InsertRange (long start, T[] values)
 Inserts multiple values starting at the specified index and re-sorts the elements.
bool SystemEx.Collections.Generic.Set< T, TContainer >.Validate ()
 Validates the internal ordering of the set. The container must be sorted according to the comparison function.
bool SystemEx.Collections.Generic.Set< T, TContainer >.Erase (long index)
 Removes the element at the specified index and re-sorts the remaining elements.
bool SystemEx.Collections.Generic.Set< T, TContainer >.Erase (long first, long last)
 Removes a continuous range of elements from the underlying container. The range is defined by the start index first and the end index last . If the removal succeeds, the set is re-sorted to maintain ordering guarantees.
bool SystemEx.Collections.Generic.Set< T, TContainer >.Erase (T value)
 Removes the first occurrence of the specified value from the set. The element is located using the internal finder. If the element exists, it is removed from the underlying container. After removal, the set is re-sorted to preserve ordering guarantees.
void SystemEx.Collections.Generic.Set< T, TContainer >.SwapIn (Set< T, TContainer > other)
 Moves all elements from this set into the specified target set. The elements are copied into a temporary array, removed from the underlying container of this set, and then inserted into the target set. After insertion, the target set is re-sorted to maintain ordering guarantees. This set becomes empty after the operation.
bool SystemEx.Collections.Generic.Set< T, TContainer >.Equals (Set< T, TContainer > other)
 Compares this set with another set for structural equality. Both sets must contain the same number of elements and each element at the same position must be equal. The comparison assumes both containers are sorted and aligned.
void SystemEx.Collections.Generic.Set< T, TContainer >.Merge (Set< T, TContainer > source)
 Merges all unique elements from the specified source set into this set. Each element in source is checked using the internal finder. If this set does not contain the element, it is extracted from the source and inserted into this set. Elements already present in this set remain in the source. No elements are duplicated.
IContainerEx< T > SystemEx.Collections.Generic.Set< T, TContainer >.GetSorted ()
 Returns a sorted value copy of the underlying container.
 SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.UnorderedMultiSet (ref TContainer keys)
 Creates a new unsorted view over the given container.
T[] SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Extract (long index)
 Extracts all elements starting at the given index. The extracted elements are removed from the underlying container and returned as a new array.
bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Insert (T value)
 Inserts a value into the container.
bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Insert (long index, T value)
 Inserts a value at the specified index.
bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Insert (long start, long end, T value)
 Inserts a value into a range.
bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.InsertRange (long start, T[] values)
 Inserts multiple values starting at the specified index.
bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Validate ()
 tests is this view validated return only true
bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Erase (long index)
 Removes the element at the specified index.
bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Erase (long first, long last)
 Removes a continuous range of elements from the underlying container. The range is defined by the start index first and the end index last .
bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Erase (T value)
 Removes the first occurrence of the specified value from the UnorderedMultiSet. The element is located using the internal finder. If the element exists, it is removed from the underlying container.
void SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.SwapIn (UnorderedMultiSet< T, TContainer > other)
 Moves all elements from this UnorderedMultiSet into the specified target UnorderedMultiSet. The elements are copied into a temporary array, removed from the underlying container of this UnorderedMultiSet, and then inserted into the target UnorderedMultiSet. This UnorderedMultiSet becomes empty after the operation.
bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Equals (UnorderedMultiSet< T, TContainer > other)
 Compares this UnorderedMultiSet with another UnorderedMultiSet for structural equality. Both UnorderedMultiSets must contain the same number of elements and each element at the same position must be equal. The comparison assumes both containers are sorted and aligned.

Properties

bool SystemEx.Collections.Generic.Cache.IsLocked [get, set]
 Gets or sets the internal lock state.
byte SystemEx.Collections.Generic.Cache.this[int adress] [get, set]
 Provides indexed access to the raw buffer.
virtual ulong SystemEx.Collections.Generic.Cache.Length [get]
 Gets the total buffer length in bytes.
virtual ulong SystemEx.Collections.Generic.Cache.Free [get]
 Gets the total free bytes.
virtual ulong SystemEx.Collections.Generic.Cache.Used [get]
 Gets the total used bytes.
virtual ulong SystemEx.Collections.Generic.Cache.LongLength [get, set]
 Gets the logical length of the cache as an unsigned 64-bit value.
bool SystemEx.Collections.Generic.Cache.IsEmpty [get]
 Indicates whether the cache contains no data.
CacheType SystemEx.Collections.Generic.Cache.Type [get]
 Gets the configured cache type (read, write, or both).
bool SystemEx.Collections.Generic.Cache.CanWrite [get]
 Indicates whether the cache is writable.
bool SystemEx.Collections.Generic.Cache.CanRead [get]
 Indicates whether the cache is readable.
ulong SystemEx.Collections.Generic.Cache.Position [get, set]
 Gets and Set the current read/write position.
SortAction< ISimpleCompare< T >, TContainer > SystemEx.Collections.Generic.Set< T, TContainer >.SortFunctions [get, set]
 Gets or sets the delegate-based sort function.
bool SystemEx.Collections.Generic.Set< T, TContainer >.IsFull [get]
 Indicates whether the underlying container is full.
bool SystemEx.Collections.Generic.Set< T, TContainer >.IsEmpty [get]
 Indicates whether the underlying container is empty.
SystemEx.Collections.Generic.Set< T, TContainer >.Current [get]
 Returns the current element of the underlying container.
long SystemEx.Collections.Generic.Set< T, TContainer >.Count [get]
 Returns the number of elements stored in the container.
long SystemEx.Collections.Generic.Set< T, TContainer >.Length [get]
 Returns the total capacity of the underlying container.
bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.IsFull [get]
 Indicates whether the underlying container is full.
bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.IsEmpty [get]
 Indicates whether the underlying container is empty.
SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Current [get]
 Returns the current element of the underlying container.
long SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Count [get]
 Returns the number of elements stored in the container.
long SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Length [get]
 Returns the total capacity of the underlying container.

Detailed Description

A simple random-access iterator for array-based data structures. Provides forward, backward, and offset-based movement.

A dynamic Vector implementation that supports optional auto-growth, indexed access, insertion, removal, traversal, and basic search operations.

Represents an unordered set view over an underlying container. Elements are not sorted and no ordering guarantees are provided. Duplicate values are not allowed. All operations work directly on the underlying container without applying any sorting logic.

A typed view over a raw Cache that exposes elements of an unmanaged type T .

A dynamic, list‑backed map structure that stores ITuple objects. Provides tuple‑based lookup, traversal, range operations, and key/value convenience helpers.
This implementation allows arbitrary tuple arity, but assumes that index 0 represents the key and index 1 represents the value.

Represents a dynamic list of ITuple objects.
Provides filtering utilities, indexed access, and basic list operations for working with heterogeneous tuple collections.

A dynamically sized tuple storing elements as object values. Provides indexed access, mutation, and compatibility with the ITuple interface used throughout the SystemEx collection and iterator framework.

A lightweight, serializable three‑element tuple consisting of strongly typed first, second, and third values. Implements ITuple and IEquatable<T> for structural comparison.

A segmented cache implementation that splits a large logical address space into multiple fixed-size cache segments.
The first segment is the base Cache instance, while all additional segments are stored in an internal array of ICache.

A specialized Node<T> that represents a star‑shaped structure, where the node may have an arbitrary number of child nodes.

Represents a logical sub‑stack inside a shared stack buffer. A layer defines its own independent boundaries and a current pointer, allowing multiple virtual stacks to coexist within the same array.

A tuple map that maintains its elements in sorted order.
Sorting is performed using either a custom ICompared<T> implementation or a delegate of type SortTupleFunc.
The map automatically re-sorts itself after insertions when AutoSort is enabled.

A tuple list that maintains its elements in sorted order.
Sorting is performed using either a custom ICompared<T> implementation or a delegate of type SortTupleFunc.
The map automatically re-sorts itself after insertions when AutoSort is enabled.

A sorted tuple map that allows multiple entries with identical tuple keys.
Unlike SortedTupleMap, which prevents duplicate tuples, SortedMultiTupleMap accepts all items without duplicate checks while still maintaining full sorting behavior.

A map that maintains its elements in sorted order using either a custom comparer (ICompared<T>) or a delegate-based sorting function (SortFunc<T, TU>).
Sorting is performed eagerly whenever elements are added or inserted, depending on the AutoSort setting.

A fixed-size array that supports automatic sorting using either a comparer interface or a delegate-based sort function. Sorting can be triggered manually or automatically after insert and remove operations.

A dynamically sized array that supports automatic sorting using either a comparer interface or a delegate-based sort function. Sorting can be triggered manually or automatically after insert, add, or remove operations.

Defines a sorting action used by the Set wrapper. The delegate receives the underlying container and its comparer and performs a complete sort operation on the container's elements.

A simple fixed‑size FIFO queue implemented as a thin wrapper around a Deque<T>.
Provides enqueue and dequeue operations using the deque’s front/back insertion and removal semantics.

A lightweight, serializable four‑element tuple consisting of strongly typed first, second, third, and fourth values.
Implements ITuple for indexed access and structural comparison.

Iterator for PriorityQueueEx<T, TU> that consumes elements in priority order.
Each call to Forward dequeues the next element from the underlying priority queue.

A lightweight, serializable two‑element tuple consisting of a strongly typed key and value. Implements IPair<T, TU> and provides typed comparison helpers as well as ITuple compatibility.

Represents a slice over intrusive Node<T> structures, defined by a starting iterator and a fixed length.
Conceptually similar to Span<T>, but operating on your intrusive node/iterator system instead of contiguous memory.

Represents a simple range defined by a begin and end iterator over intrusive Node<T> structures.
Conceptually similar to std::ranges::subrange, but designed specifically for your intrusive node and iterator system.

Defines the supported traversal orders for Node<T> structures.

A tuple map that allows multiple entries with identical tuple keys.
Unlike TupleMap, which prevents duplicate tuples,.

A map that allows multiple entries with the same key.
Unlike Map<T, TU>, which prevents duplicate pairs, a MultiMap<TT, TU> accepts all entries without checking for existing keys or values.

A cache that maintains a mirrored copy of all written data.
Every write operation is performed on the primary cache and a reversed (byte‑mirrored) version of the data is written to the secondary cache.
During reads, both caches are compared to ensure data integrity.

A dynamic map storing Pair<T, TU> elements in a list.
The map supports duplicate keys but prevents duplicate pairs unless explicitly overridden.
Provides key lookup, value lookup, traversal, range operations, and indexed access.

Represents a grouping node that stores an arbitrary number of intrusive Node<T> instances inside a standard List<T>.
Unlike Node<T>’s own Prev/Next chain, a GroupNode<T> does not form a linked structure; it simply aggregates nodes into a collection.

A fixed‑size map storing Pair<T, TU> elements in a contiguous array.
Unlike dynamic maps, a FixedMap<T, TU> never grows: once the capacity is reached, no further insertions are possible.

A fixed-size array container that provides indexed access, insertion, traversal, and basic search operations. Unlike dynamic arrays, this structure never grows and always maintains a constant capacity.

Provides search operations over a container implementing IContainerEx<T>. This struct performs non‑modifying lookups such as first/last occurrence, existence checks and counting matches.

A simple fixed‑size double‑ended queue (deque) implemented using a linear array. Supports pushing and popping at both the front and the back.
This implementation does not use a ring buffer; shifting is performed when inserting or removing at the front.

Defines how the search algorithm treats edge weights during traversal.

Specifies the access mode of a Cache instance.

A fixed-size queue that stores up to two elements. When full, the oldest element is automatically removed to make room for a new one.

Template Parameters
TThe element type stored in the underlying array.
Template Parameters
TThe type of elements stored in the queue.
Template Parameters
TThe type of elements stored in the deque.

Example usage with a vector:

// Create a vector of int with initial values and auto grow enabled
// AutoGrow is controlled by the second parameter:
// growSize > 0 -> AutoGrow ON
// growSize == 0 -> AutoGrow OFF
var vec = new vector<int>( new int[]{10, 20, 30, 40 } );
var finder = new Find<int, vector<int>>(ref vec);
long first20 = finder.First(20); // returns 1
long last20 = finder.Last(20); // returns 2
int count20 = finder.Of(20); // returns 2
bool exists30 = finder.Exists(30); // returns true
Template Parameters
TThe element type stored inside the container.
TContainerThe container type implementing IContainerEx<T> used as the search target.
Template Parameters
TThe key type
TUThe value type
Template Parameters
TThe value type stored in the underlying nodes.
Template Parameters
TThe key type (non‑null).
TUThe value type (non‑null).
Template Parameters
TTThe key type (non‑null).
TUThe value type (non‑null).
Template Parameters
TThe value type stored in the underlying nodes.

var range = new NodeRange<int>(node.First(), node.At(10));

foreach (var x in range) Console.WriteLine(x);

Template Parameters
TThe value type stored in the underlying nodes.

var slice = new NodeSlice<int>(node.At(5), 10);

foreach (var x in slice) Console.WriteLine(x);

Template Parameters
TThe type of the first element (key).
TUThe type of the second element (value).
Template Parameters
TThe stored value type.
TUThe priority type (must implement INumber<TU>).
Template Parameters
TTThe type of the first element.
TUThe type of the second element.
TWThe type of the third element.
TJThe type of the fourth element.
Template Parameters
TThe type of elements stored in the queue.
Template Parameters
TCompareComparer type used to compare two elements.
TContainerContainer type implementing IContainerEx for T.
Parameters
containerReference to the container whose elements should be sorted.
comparerComparer used to determine the ordering of elements.
Template Parameters
TThe type of elements stored in the array.
Template Parameters
TThe type of elements stored in the array.
Template Parameters
TThe key type.
TUThe value type.
Template Parameters
TThe value type stored in the node.

This class supports large continuous write operations by automatically determining the correct segment and offset for each write.
Writes may span multiple segments, and data is written chunk-by-chunk using a temporary FixedArray<T> buffer.

Template Parameters
TTThe type of the first element.
TUThe type of the second element.
TWThe type of the third element.

TypeBuffer<T> provides element access, cloning, clearing and simple fill semantics for fixed‑stride unmanaged types. The buffer owns an internal Cache instance sized to length * sizeof(T). All reads and writes perform endian conversion using the configured Endian value.

This type assumes T is an unmanaged value type and uses a fixed stride equal to sizeof(T). Index and offset parameters are validated by the underlying cache and may throw on out‑of‑range access.

Template Parameters
TAn unmanaged value type stored in the buffer.
Template Parameters
TThe element type stored in the container.
TContainerThe container type that stores the elements. Must implement IContainerEx for the same element type.
Template Parameters
TThe element type stored in the container.
TContainerThe container type that stores the elements. Must implement IContainerEx for the same element type.
Template Parameters
TThe element type stored in the Vector.

Enumeration Type Documentation

◆ CacheType

Enumerator
ToDevice 

Cache is intended for writing data to a device.

FromDevice 

Cache is intended for reading data from a device.

Both 

Cache supports both reading and writing operations.

OnlySystem 

Cache ist only on host, don't used with a device.

29 {
34
39
43 Both,
48 }
@ Both
Cache supports both reading and writing operations.
Definition Cache.cs:43
@ OnlySystem
Cache ist only on host, don't used with a device.
Definition Cache.cs:47
@ FromDevice
Cache is intended for reading data from a device.
Definition Cache.cs:38
@ ToDevice
Cache is intended for writing data to a device.
Definition Cache.cs:33

◆ SearchType

Enumerator
SubtractWeight 

Subtract the edge weight from the current energy: energy = energy - weight.

SetToWeight 

Replace the current energy with the edge weight: energy = weight.

AccumulateCost 

Do not consume energy; instead accumulate the edge weight into the cost: cost += weight.

24 {
37 }
@ SetToWeight
Replace the current energy with the edge weight: energy = weight.
Definition Cluster.cs:32
@ SubtractWeight
Subtract the edge weight from the current energy: energy = energy - weight.
Definition Cluster.cs:28
@ AccumulateCost
Do not consume energy; instead accumulate the edge weight into the cost: cost += weight.
Definition Cluster.cs:36

◆ TraversOrder

Enumerator
Preorder 

Visit the current node before its children and siblings.

Inorder 

Visit the left subtree, then the node, then the right subtree (not implemented).

Postorder 

Visit children and siblings before the current node.

ListOrder 

Traverse the linked list in forward direction.

ReservListOrder 

Traverse the linked list in reverse direction.

30 {
33
35 Inorder,
36
39
42
45 }
@ Inorder
Visit the left subtree, then the node, then the right subtree (not implemented).
Definition Generic/Node.cs:35
@ ListOrder
Traverse the linked list in forward direction.
Definition Generic/Node.cs:41
@ Preorder
Visit the current node before its children and siblings.
Definition Generic/Node.cs:32
@ ReservListOrder
Traverse the linked list in reverse direction.
Definition Generic/Node.cs:44
@ Postorder
Visit children and siblings before the current node.
Definition Generic/Node.cs:38

Function Documentation

◆ AsFlexSpan() [1/3]

virtual ContainerFlexSpan< byte, FixedVector< byte > > SystemEx.Collections.Generic.Cache.AsFlexSpan ( FlexSpanMode mode = FlexSpanMode::System)
virtual

Creates a FlexSpan view over the valid portion of this array. The span does not copy data; it directly references the internal buffer.

Parameters
modeThe indexing mode of the span (System, Reverse, Ring).
Returns
A FlexSpan that views the range [0 .. Ende).
672 => FixedVector<byte>.AsFlexSpan(ref m_rawBuffer, mode);

◆ AsFlexSpan() [2/3]

virtual ContainerFlexSpan< byte, FixedVector< byte > > SystemEx.Collections.Generic.Cache.AsFlexSpan ( long start,
FlexSpanMode mode = FlexSpanMode::System )
virtual

Creates a FlexSpan view starting at the specified offset. The span references the internal buffer directly and does not allocate.

Reimplemented in SystemEx.Collections.Generic.StrippedCache.

680 => FixedVector<byte>.AsFlexSpan(ref m_rawBuffer, start, m_rawBuffer.Length, mode);

◆ AsFlexSpan() [3/3]

virtual ContainerFlexSpan< byte, FixedVector< byte > > SystemEx.Collections.Generic.Cache.AsFlexSpan ( long start,
long endi,
FlexSpanMode mode = FlexSpanMode::System )
virtual

Creates a FlexSpan view starting at the specified offset. The span references the internal buffer directly and does not allocate.

687 => FixedVector<byte>.AsFlexSpan(ref m_rawBuffer, start, endi, mode);

◆ Cache() [1/4]

SystemEx.Collections.Generic.Cache.Cache ( byte[] arr,
CacheType type )

Initializes a new cache from given array.

Parameters
arr
type
157 {
158 m_rawBuffer = new FixedVector<byte>(arr);
159 this.Type = type;
160 LongLength = (ulong)m_rawBuffer.Length;
161 }

◆ Cache() [2/4]

SystemEx.Collections.Generic.Cache.Cache ( Cache cache)

Create a Copy from stream.

Parameters
cacheThe orignal cache
Exceptions
InvalidOperationException
180 {
181 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
182
183 m_rawBuffer = new FixedVector<byte>(cache.ToArray());
184 this.Type = cache.Type;
185 LongLength = cache.LongLength;
186 }
Here is the call graph for this function:

◆ Cache() [3/4]

SystemEx.Collections.Generic.Cache.Cache ( FixedVector< byte > arr,
CacheType type )

Initializes a new cache from given array.

Parameters
arr
type
168 {
169 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
170
171 m_rawBuffer = new FixedVector<byte>(arr.ToNative());
172 this.Type = type;
173 LongLength = (ulong)m_rawBuffer.Length;
174 }
Here is the call graph for this function:

◆ Cache() [4/4]

SystemEx.Collections.Generic.Cache.Cache ( long capacity,
CacheType type = CacheType::OnlySystem )

Initializes a new cache with the specified capacity and type.

134 {
135 m_rawBuffer = new FixedVector<byte>(capacity);
136 this.Type = type;
137 LongLength = (ulong)m_rawBuffer.Length;
138 }
Here is the caller graph for this function:

◆ CacheIsSharedException()

SystemEx.Collections.Generic.CacheIsSharedException.CacheIsSharedException ( )

Exception thrown when an operation is attempted on a shared or locked cache.

57: base() { }

◆ Clear()

void SystemEx.Collections.Generic.Cache.Clear ( )

See SetZero.

150=> SetZero();

◆ Equals() [1/2]

bool SystemEx.Collections.Generic.Set< T, TContainer >.Equals ( Set< T, TContainer > other)

Compares this set with another set for structural equality. Both sets must contain the same number of elements and each element at the same position must be equal. The comparison assumes both containers are sorted and aligned.

Parameters
otherThe set to compare with.
Returns
True if both sets contain the same elements in the same order; otherwise false.
356 {
357 bool _ret = true;
358
359 if ( m_pKeys.Count != other.m_pKeys.Count ) {
360 _ret = false;
361 } else {
362 for ( int i = 0 ; i < m_pKeys.Count ; i++ ) {
363 var a_key = m_pKeys.ElementAt(i);
364 var b_key = other.m_pKeys.ElementAt(i);
365
366 if ( !EqualsKey(a_key, b_key) ) {
367 _ret = false;
368 break;
369 }
370 }
371 }
372
373 return _ret;
374 }
Here is the call graph for this function:

◆ Equals() [2/2]

bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Equals ( UnorderedMultiSet< T, TContainer > other)

Compares this UnorderedMultiSet with another UnorderedMultiSet for structural equality. Both UnorderedMultiSets must contain the same number of elements and each element at the same position must be equal. The comparison assumes both containers are sorted and aligned.

Parameters
otherThe UnorderedMultiSet to compare with.
Returns
True if both UnorderedMultiSets contain the same elements in the same order; otherwise false.
264 {
265 bool _ret = true;
266
267 if ( m_pKeys.Count != other.m_pKeys.Count ) {
268 _ret = false;
269 } else {
270 for ( int i = 0 ; i < m_pKeys.Count ; i++ ) {
271 var a_key = m_pKeys.ElementAt(i);
272 var b_key = other.m_pKeys.ElementAt(i);
273
274 if ( !EqualsKey(a_key, b_key) ) {
275 _ret = false;
276 break;
277 }
278 }
279 }
280
281 return _ret;
282 }
Here is the call graph for this function:

◆ Erase() [1/6]

bool SystemEx.Collections.Generic.Set< T, TContainer >.Erase ( long first,
long last )

Removes a continuous range of elements from the underlying container. The range is defined by the start index first and the end index last . If the removal succeeds, the set is re-sorted to maintain ordering guarantees.

Parameters
firstThe starting index of the range to erase.
lastThe ending index of the range to erase.
Returns
True if the specified range was removed; otherwise false.
291 {
292 bool _ret = m_pKeys.Erase(first, last);
293 if ( _ret ) Sort();
294 return _ret;
295 }

◆ Erase() [2/6]

bool SystemEx.Collections.Generic.Set< T, TContainer >.Erase ( long index)

Removes the element at the specified index and re-sorts the remaining elements.

Parameters
indexThe index of the element to remove.
275 {
276 bool _ret = m_pKeys.Erase(index);
277 if ( _ret ) Sort();
278 return _ret;
279 }

◆ Erase() [3/6]

bool SystemEx.Collections.Generic.Set< T, TContainer >.Erase ( T value)

Removes the first occurrence of the specified value from the set. The element is located using the internal finder. If the element exists, it is removed from the underlying container. After removal, the set is re-sorted to preserve ordering guarantees.

Parameters
valueThe value to erase.
Returns
True if the value was found and removed; otherwise false.
306 {
307 bool _ret = false;
308 long index = m_finder.First(value);
309
310 if(index != -1) {
311 _ret = m_pKeys.Erase(index);
312 }
313 if ( _ret ) Sort();
314
315 return _ret;
316 }

◆ Erase() [4/6]

bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Erase ( long first,
long last )

Removes a continuous range of elements from the underlying container. The range is defined by the start index first and the end index last .

Parameters
firstThe starting index of the range to erase.
lastThe ending index of the range to erase.
Returns
True if the specified range was removed; otherwise false.
201 {
202 bool _ret = m_pKeys.Erase(first, last);
203
204 return _ret;
205 }

◆ Erase() [5/6]

bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Erase ( long index)

Removes the element at the specified index.

Parameters
indexThe index of the element to remove.
186 {
187 bool _ret = m_pKeys.Erase(index);
188
189 return _ret;
190 }

◆ Erase() [6/6]

bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Erase ( T value)

Removes the first occurrence of the specified value from the UnorderedMultiSet. The element is located using the internal finder. If the element exists, it is removed from the underlying container.

Parameters
valueThe value to erase.
Returns
True if the value was found and removed; otherwise false.
215 {
216 bool _ret = false;
217 long index = m_finder.First(value);
218
219 if ( index != -1 ) {
220 _ret = m_pKeys.Erase(index);
221 }
222
223
224 return _ret;
225 }

◆ Exists()

bool SystemEx.Collections.Generic.Find< T, TContainer >.Exists ( T value)

Determines whether the container contains at least one element equal to the specified value.

Parameters
valueThe value to search for.
178 {
179 bool _ret = false;
180 for ( int i = 0 ; i < m_container.Count ; i++ ) {
181 var item = m_container.ElementAt(i);
182
183 if ( item != null && item.Equals(value) ) {
184 _ret = true;
185 break;
186 }
187 }
188 return _ret;
189 }

◆ Extract() [1/2]

T[] SystemEx.Collections.Generic.Set< T, TContainer >.Extract ( long index)

Extracts all elements starting at the given index. The extracted elements are removed from the underlying container and returned as a new array.

Parameters
indexStart index of extraction.
Returns
A new array containing all elements from index to the end. If the index is out of range, an empty array is returned.
143 {
144 T[] _ret = Array.Empty<T>();
145
146 long count = m_pKeys.Count;
147
148 if ( index >= 0 && index < count ) {
149 long extractCount = count - index;
150 _ret = new T[extractCount];
151
152 // copy extracted elements
153 for ( long i = 0 ; i < extractCount ; i++ ) {
154 var itm = m_pKeys.ElementAt(index + i);
155 if(itm != null) {
156 _ret[i] = itm;
157 }
158 }
159
160 // remove extracted elements from container
161 for ( long i = count - 1 ; i >= index ; i-- ) {
162 m_pKeys.Erase(i);
163 }
164 }
165
166 return _ret;
167 }
Here is the caller graph for this function:

◆ Extract() [2/2]

T[] SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Extract ( long index)

Extracts all elements starting at the given index. The extracted elements are removed from the underlying container and returned as a new array.

Parameters
indexStart index of extraction.
Returns
A new array containing all elements from index to the end. If the index is out of range, an empty array is returned.
88 {
89 T[] _ret = Array.Empty<T>();
90
91 long count = m_pKeys.Count;
92
93 if ( index >= 0 && index < count ) {
94 long extractCount = count - index;
95 _ret = new T[extractCount];
96
97 // copy extracted elements
98 for ( long i = 0 ; i < extractCount ; i++ ) {
99 var itm = m_pKeys.ElementAt(index + i);
100 if ( itm != null ) {
101 _ret[i] = itm;
102 }
103 }
104
105 // remove extracted elements from container
106 for ( long i = count - 1 ; i >= index ; i-- ) {
107 m_pKeys.Erase(i);
108 }
109 }
110
111 return _ret;
112 }

◆ Find()

SystemEx.Collections.Generic.Find< T, TContainer >.Find ( ref TContainer container)

Initializes a new search helper bound to the specified container.

Parameters
containerReference to the container to operate on.
63 {
64 m_container = ref container;
65 }

◆ First() [1/2]

long SystemEx.Collections.Generic.Find< T, TContainer >.First ( Func< T, bool > pred)

Returns the index of the first element matching the given predicate. If no element matches, -1 is returned.

Parameters
predThe predicate used to test each element.
91 {
92 long _ret = -1;
93
94 for ( long i = 0 ; i < m_container.Count ; i++ ) {
95 var item = m_container.ElementAt(i);
96
97 if ( item != null && pred(item) ) {
98 _ret = i;
99 break;
100 }
101 }
102 return _ret;
103 }

◆ First() [2/2]

long SystemEx.Collections.Generic.Find< T, TContainer >.First ( T value)

Returns the index of the first occurrence of the specified value. If the value is not found, -1 is returned.

Parameters
valueThe value to search for.
73 {
74 long _ret = -1;
75 for ( long i = 0 ; i < m_container.Count ; i++ ) {
76 var item = m_container.ElementAt(i);
77
78 if ( item != null && item.Equals(value) ) {
79 _ret = i;
80 break;
81 }
82 }
83 return _ret;
84 }

◆ GetSorted()

IContainerEx< T > SystemEx.Collections.Generic.Set< T, TContainer >.GetSorted ( )

Returns a sorted value copy of the underlying container.

The Set container maintains its elements in sorted order at all times. This method therefore does not perform any additional sorting. Instead, it returns a structural duplicate of the internal container using its copy constructor, ensuring that the returned instance is independent and does not reference the original storage.

Returns
A new IContainerEx<T> instance containing the same elements as the underlying container, already sorted.
440 {
441 return m_pKeys.Duplicate();
442 }
Here is the call graph for this function:

◆ Insert() [1/6]

bool SystemEx.Collections.Generic.Set< T, TContainer >.Insert ( long index,
T value )

Inserts a value at the specified index and re-sorts the elements.

Parameters
indexThe index at which the value is inserted.
valueThe value to insert.
188 {
189 bool _ret = false;
190
191 if ( m_finder.First(value) == -1 )
192 _ret = m_pKeys.Insert(index, value);
193
194 if ( _ret ) Sort();
195 return _ret;
196 }

◆ Insert() [2/6]

bool SystemEx.Collections.Generic.Set< T, TContainer >.Insert ( long start,
long end,
T value )

Inserts a value into a range and re-sorts the elements.

Parameters
startStart index of the range.
endEnd index of the range.
valueThe value to insert.
204 {
205 bool _ret = false;
206
207 if ( m_finder.First(value) == -1 )
208 _ret = m_pKeys.Insert(start, end, value);
209
210 if ( _ret ) Sort();
211 return _ret;
212 }

◆ Insert() [3/6]

bool SystemEx.Collections.Generic.Set< T, TContainer >.Insert ( T value)

Inserts a value into the container and re-sorts the elements.

Parameters
valueThe value to insert.
173 {
174 bool _ret = false;
175
176 if( m_finder.First(value) == -1 )
177 _ret = m_pKeys.PushBack(value);
178
179 if ( _ret ) Sort();
180 return _ret;
181 }

◆ Insert() [4/6]

bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Insert ( long index,
T value )

Inserts a value at the specified index.

Parameters
indexThe index at which the value is inserted.
valueThe value to insert.
131 {
132 bool _ret = false;
133
134 _ret = m_pKeys.Insert(index, value);
135
136 return _ret;
137 }

◆ Insert() [5/6]

bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Insert ( long start,
long end,
T value )

Inserts a value into a range.

Parameters
startStart index of the range.
endEnd index of the range.
valueThe value to insert.
145 {
146 bool _ret = false;
147
148 _ret = m_pKeys.Insert(start, end, value);
149
150 return _ret;
151 }

◆ Insert() [6/6]

bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Insert ( T value)

Inserts a value into the container.

Parameters
valueThe value to insert.
118 {
119 bool _ret = false;
120
121 _ret = m_pKeys.PushBack(value);
122
123 return _ret;
124 }

◆ InsertRange() [1/2]

bool SystemEx.Collections.Generic.Set< T, TContainer >.InsertRange ( long start,
T[] values )

Inserts multiple values starting at the specified index and re-sorts the elements.

Parameters
startThe index at which the range begins.
valuesArray of values to insert.
219 {
220 bool insertedAny = false;
221
222 foreach ( var item in values ) {
223 // Element existiert bereits → abbrechen
224 if ( m_finder.First(item) != -1 )
225 continue;
226
227 // Einfügen fehlgeschlagen → abbrechen
228 if ( !m_pKeys.PushBack(item) )
229 break;
230
231 insertedAny = true;
232 }
233
234 if( insertedAny) Sort();
235 return insertedAny;
236 }

◆ InsertRange() [2/2]

bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.InsertRange ( long start,
T[] values )

Inserts multiple values starting at the specified index.

Parameters
startThe index at which the range begins.
valuesArray of values to insert.
158 {
159 bool insertedAny = false;
160
161 foreach ( var item in values ) {
162
163 // Einfügen fehlgeschlagen → abbrechen
164 if ( !m_pKeys.PushBack(item) )
165 break;
166
167 insertedAny = true;
168 }
169
170 return insertedAny;
171 }

◆ Last() [1/2]

long SystemEx.Collections.Generic.Find< T, TContainer >.Last ( Func< T, bool > pred)

Returns the index of the last element matching the given predicate. If no element matches, -1 is returned.

Parameters
predThe predicate used to test each element.
128 {
129 long _ret = -1;
130
131 for ( long i = m_container.Count - 1 ; i >= 0 ; i-- ) {
132 var item = m_container.ElementAt(i);
133
134 if ( item != null && pred(item) ) {
135 _ret = i;
136 break;
137 }
138 }
139 return _ret;
140 }

◆ Last() [2/2]

long SystemEx.Collections.Generic.Find< T, TContainer >.Last ( T value)

Returns the index of the last occurrence of the specified value. If the value is not found, -1 is returned.

Parameters
valueThe value to search for.
110 {
111 long _ret = -1;
112 for ( long i = m_container.Count - 1 ; i >= 0 ; i-- ) {
113 var item = m_container.ElementAt(i);
114
115 if ( item != null && item.Equals(value) ) {
116 _ret = i;
117 break;
118 }
119 }
120 return _ret;
121 }

◆ LowerBound()

long SystemEx.Collections.Generic.Find< T, TContainer >.LowerBound ( T key,
ISimpleCompare< T > cmp )

Finds the first index at which the element is not smaller than the specified key. The comparison is performed using the provided ISimpleCompare<T> predicate, which defines the relation a < b.

Parameters
keyThe key used for comparison.
cmpA simple comparison predicate that returns true when a is considered smaller than b .
Returns
The index of the first element that is not smaller than key , or -1 if no such element exists.
223 {
224 long _ret = -1;
225
226 long lo = 0;
227 long hi = m_container.Count;
228
229 while ( lo < hi ) {
230 long mid = (lo + hi) >> 1;
231 T? val = m_container.ElementAt(mid);
232
233 if ( val == null ) {
234 lo = mid + 1;
235 continue;
236 }
237
238
239 // val < key → move right
240 if ( cmp.Compare(val, key) ) {
241 lo = mid + 1;
242 } else {
243 _ret = mid;
244 hi = mid;
245 }
246 }
247
248 return _ret;
249 }

◆ Merge()

void SystemEx.Collections.Generic.Set< T, TContainer >.Merge ( Set< T, TContainer > source)

Merges all unique elements from the specified source set into this set. Each element in source is checked using the internal finder. If this set does not contain the element, it is extracted from the source and inserted into this set. Elements already present in this set remain in the source. No elements are duplicated.

Parameters
sourceThe set from which elements are merged into this set.
402 {
403 long count = source.m_pKeys.Count;
404
405 for ( long i = 0 ; i < count ; i++ ) {
406 T? value = source.m_pKeys.ElementAt(i);
407 if ( value == null )
408 continue;
409
410 // check if this set already contains the value
411 long idx = m_finder.First(value);
412
413 if ( idx == -1 ) {
414 // extract from source
415 T[] extracted = source.Extract(i);
416
417 // insert into this set
418 m_pKeys.InsertRange(m_pKeys.Count, extracted);
419
420 // adjust loop because source shrinks
421 count--;
422 i--;
423 }
424 }
425 }
Here is the call graph for this function:

◆ Of()

int SystemEx.Collections.Generic.Find< T, TContainer >.Of ( T value)

Counts how many elements in the container equal the specified value.

Parameters
valueThe value to count.
146 {
147 int _ret = 0;
148 for ( long i = 0 ; i < m_container.Count ; i++ ) {
149 var item = m_container.ElementAt(i);
150
151 if ( item != null && item.Equals(value) ) {
152 _ret++;
153 }
154 }
155 return _ret;
156 }

◆ Read() [1/2]

int SystemEx.Collections.Generic.Cache.Read ( byte[] buffer,
int offset,
int count )

Reads bytes into the specified buffer and advances the internal position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

568 {
569 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
570 if ( offset < 0 || count < 0 ) throw new ArgumentOutOfRangeException("offset,count");
571 ArgumentNullException.ThrowIfNull(buffer);
572 ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length);
573
574 if ( offset + count > buffer.Length ) {
575 // Wenn der Caller mehr verlangt als im Zielbuffer Platz ist,
576 // lesen wir nur so viel, wie in den Zielbuffer passt.
577 count = buffer.Length - offset;
578 }
579
580 // Wenn die Leseposition bereits am oder jenseits des Endes ist: EOF
581 if ( (ulong)m_rawBuffer.Length <= m_position ) return 0;
582
583 // Verfügbare Bytes im Rohpuffer ab aktueller Position
584 ulong available = (ulong)m_rawBuffer.Length - m_position;
585 int toRead = (int)System.Math.Min((ulong)count, available);
586
587 if ( toRead <= 0 ) return 0;
588
589 // ReadRange erwartet position als ulong und count als uint
590 byte[]? chunk = ReadRange(m_position, (uint)toRead);
591 if ( chunk == null || chunk.Length == 0 ) return 0;
592
593 Array.Copy(chunk, 0, buffer, offset, chunk.Length);
594
595 // interne Position vorziehen
596 m_position += (ulong)chunk.Length;
597
598 return chunk.Length;
599 }
@ System
forward indexing
Definition FlexSpan.cs:32
Here is the call graph for this function:

◆ Read() [2/2]

byte SystemEx.Collections.Generic.Cache.Read ( ulong position)

Reads a single byte from the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

541 {
542 return m_rawBuffer[(int)position];
543 }

◆ ReadChar()

char SystemEx.Collections.Generic.Cache.ReadChar ( ulong position)

Reads a single character from the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

492 {
493 byte b = m_rawBuffer[(int)position];
494 return (char)b;
495 }

◆ ReadDouble()

double SystemEx.Collections.Generic.Cache.ReadDouble ( ulong position,
Endian endian )

Reads a double-precision floating-point value from the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

514 {
515 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
516
517 byte[] b = new byte[8];
518
519 b[0] = m_rawBuffer[(int)position + 0];
520 b[1] = m_rawBuffer[(int)position + 1];
521 b[2] = m_rawBuffer[(int)position + 2];
522 b[3] = m_rawBuffer[(int)position + 3];
523 b[4] = m_rawBuffer[(int)position + 4];
524 b[5] = m_rawBuffer[(int)position + 5];
525 b[6] = m_rawBuffer[(int)position + 6];
526 b[7] = m_rawBuffer[(int)position + 7];
527
528 return b.ToDouble(endian);
529 }

◆ ReadFloat()

float SystemEx.Collections.Generic.Cache.ReadFloat ( ulong position,
Endian endian )

Reads a single-precision floating-point value from the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

499 {
500 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
501
502 byte[] b = new byte[4];
503
504 b[0] = m_rawBuffer[(int)position + 0];
505 b[1] = m_rawBuffer[(int)position + 1];
506 b[2] = m_rawBuffer[(int)position + 2];
507 b[3] = m_rawBuffer[(int)position + 3];
508
509 return b.ToFloat(endian);
510 }

◆ ReadInt()

int SystemEx.Collections.Generic.Cache.ReadInt ( ulong position,
Endian endian )

Reads a 32-bit signed integer from the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

407 {
408 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
409
410 byte[] b = new byte[4];
411 int _pos = (int)position;
412
413 b[0] = m_rawBuffer[_pos + 0];
414 b[1] = m_rawBuffer[_pos + 1];
415 b[2] = m_rawBuffer[_pos + 2];
416 b[3] = m_rawBuffer[_pos + 3];
417
418 return b.ToInt(endian);
419 }

◆ ReadLong()

long SystemEx.Collections.Generic.Cache.ReadLong ( ulong position,
Endian endian )

Reads a 64-bit signed long from the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

452 {
453 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
454
455 byte[] b = new byte[8];
456 int _pos = (int)position;
457
458 b[0] = m_rawBuffer[_pos + 0];
459 b[1] = m_rawBuffer[_pos + 1];
460 b[2] = m_rawBuffer[_pos + 2];
461 b[3] = m_rawBuffer[_pos + 3];
462 b[4] = m_rawBuffer[_pos + 4];
463 b[5] = m_rawBuffer[_pos + 5];
464 b[6] = m_rawBuffer[_pos + 6];
465 b[7] = m_rawBuffer[_pos + 7];
466
467 return b.ToLong(endian);
468 }

◆ ReadRange()

virtual ? byte[] SystemEx.Collections.Generic.Cache.ReadRange ( ulong position,
uint count )
virtual

Reads a range of bytes starting at the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

Reimplemented in SystemEx.Collections.Generic.MirroredCache.

547 {
548 var readed = ReadRangeEx(position, count);
549
550 return readed.ToNative();
551 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadRangeEx()

virtual FixedVector< byte > SystemEx.Collections.Generic.Cache.ReadRangeEx ( ulong position,
uint count )
virtual

Reads a range of bytes starting at the specified position.

556 {
557 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
558
559 if ( (int)position + count > m_rawBuffer.Length ) throw new IndexOutOfRangeException();
560
561 FixedVector<byte> result = new FixedVector<byte>(count);
562 m_rawBuffer.CopyTo((uint)position, result, 0, (uint)count);
563 return result;
564 }
Here is the caller graph for this function:

◆ ReadShort()

short SystemEx.Collections.Generic.Cache.ReadShort ( ulong position,
Endian endian )

Reads a 16-bit signed short from the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

423 {
424 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
425
426 byte[] b = new byte[2];
427 int _pos = (int)position;
428
429 b[0] = m_rawBuffer[_pos + 0];
430 b[1] = m_rawBuffer[_pos + 1];
431
432 return b.ToShort(endian);
433 }

◆ ReadUInt()

uint SystemEx.Collections.Generic.Cache.ReadUInt ( ulong position,
Endian endian )

Reads a 32-bit unsigned integer from the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

392 {
393 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
394
395 byte[] b = new byte[4];
396
397 b[0] = m_rawBuffer[(int)position + 0];
398 b[1] = m_rawBuffer[(int)position + 1];
399 b[2] = m_rawBuffer[(int)position + 2];
400 b[3] = m_rawBuffer[(int)position + 3];
401
402 return b.ToUInt(endian);
403 }

◆ ReadULong()

ulong SystemEx.Collections.Generic.Cache.ReadULong ( ulong position,
Endian endian )

Reads a 64-bit unsigned long from the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

472 {
473 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
474
475 byte[] b = new byte[8];
476 int _pos = (int)position;
477
478 b[0] = m_rawBuffer[_pos + 0];
479 b[1] = m_rawBuffer[_pos + 1];
480 b[2] = m_rawBuffer[_pos + 2];
481 b[3] = m_rawBuffer[_pos + 3];
482 b[4] = m_rawBuffer[_pos + 4];
483 b[5] = m_rawBuffer[_pos + 5];
484 b[6] = m_rawBuffer[_pos + 6];
485 b[7] = m_rawBuffer[_pos + 7];
486
487 return b.ToULong(endian);
488 }

◆ ReadUShort()

ushort SystemEx.Collections.Generic.Cache.ReadUShort ( ulong position,
Endian endian )

Reads a 16-bit unsigned short from the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

438 {
439 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
440
441 byte[] b = new byte[2];
442 int _pos = (int)position;
443
444 b[0] = m_rawBuffer[_pos + 0];
445 b[1] = m_rawBuffer[_pos + 1];
446
447 return b.ToUShort(endian);
448 }

◆ Seek()

ulong SystemEx.Collections.Generic.Cache.Seek ( SeekOrigin org,
int pos )

Moves the internal position according to the specified origin and offset.

Parameters
orgThe seek origin.
posThe offset relative to the origin.
Returns
The new position.
194 {
195 if ( m_rawBuffer.Length == 0 ) return 0;
196
197 switch ( org ) {
198
199 case SeekOrigin.Begin:
200 m_position = (ulong)System.Math.Max(pos, 0);
201 break;
202 case SeekOrigin.Current:
203 if ( pos >= 0 )
204 m_position += (ulong)pos;
205 else {
206 ulong neg = (ulong)(-pos);
207 m_position = (m_position > neg) ? (m_position - neg) : 0;
208 }
209 break;
210 case SeekOrigin.End:
211 if ( pos >= 0 ) {
212 ulong p = (ulong)pos;
213 m_position = (p > LongLength) ? 0 : (LongLength - p);
214 } else {
215 // End + negative pos = End - (-pos) = End + pos
216 ulong add = (ulong)(-pos);
217 m_position = LongLength + add; // wird unten gekappt
218 }
219 break;
220 }
221
222 if ( m_position > LongLength )
223 m_position = LongLength;
224
225 return m_position;
226 }

◆ Set() [1/2]

SystemEx.Collections.Generic.Set< T, TContainer >.Set ( ref TContainer keys,
ISimpleCompare< T > comparer,
SortAction< ISimpleCompare< T >, TContainer >? sorter = null )

Creates a new sorted view over the given container. The container reference is stored and immediately sorted using the comparer and with an optional sort delegate.

Parameters
keysReference to the underlying container.
comparerComparer used to order the elements.
sorterSort delegate, when null use bubble sort
98 {
99 m_pKeys = ref keys;
100 m_compare = comparer;
101 m_sorter = sorter;
102 m_finder = new Find<T, TContainer>(ref keys);
103
104 Sort();
105 }

◆ Set() [2/2]

SystemEx.Collections.Generic.Set< T, TContainer >.Set ( ref TContainer keys,
SortAction< ISimpleCompare< T >, TContainer >? sorter = null )

Creates a new sorted view over the given container. The container reference is stored and immediately sorted using the comparer and with an optional sort delegate.

Parameters
keysReference to the underlying container.
sorterSort delegate, when null use bubble sort
82 {
83 m_pKeys = ref keys;
84 m_compare = new Less<T>();
85 m_sorter = sorter;
86 m_finder = new Find<T, TContainer>(ref keys);
87
88 Sort();
89 }
Here is the caller graph for this function:

◆ SetZero()

void SystemEx.Collections.Generic.Cache.SetZero ( )

Set Cache to Zero.

142 {
143 for ( int i = 0; i < m_rawBuffer.Length; i++ )
144 m_rawBuffer[i] = 0;
145 m_maxUsedAdress = 0;
146 }

◆ SwapIn() [1/2]

void SystemEx.Collections.Generic.Set< T, TContainer >.SwapIn ( Set< T, TContainer > other)

Moves all elements from this set into the specified target set. The elements are copied into a temporary array, removed from the underlying container of this set, and then inserted into the target set. After insertion, the target set is re-sorted to maintain ordering guarantees. This set becomes empty after the operation.

Parameters
otherThe target set that receives all elements from this set.
328 {
329
330 if ( m_pKeys.Count > 0 ) {
331 // copy all elements into a temporary array
332 T[] tmp = m_pKeys.ToNative();
333
334 // clear myself
335 m_pKeys.Clear();
336
337 // insert all elements into the other set
338 other.m_pKeys.InsertRange(0, tmp);
339
340 // sort the other set (flat_set semantics)
341 other.Sort();
342 }
343 }
Here is the call graph for this function:

◆ SwapIn() [2/2]

void SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.SwapIn ( UnorderedMultiSet< T, TContainer > other)

Moves all elements from this UnorderedMultiSet into the specified target UnorderedMultiSet. The elements are copied into a temporary array, removed from the underlying container of this UnorderedMultiSet, and then inserted into the target UnorderedMultiSet. This UnorderedMultiSet becomes empty after the operation.

Parameters
otherThe target UnorderedMultiSet that receives all elements from this UnorderedMultiSet.
238 {
239
240 if ( m_pKeys.Count > 0 ) {
241 // copy all elements into a temporary array
242 T[] tmp = m_pKeys.ToNative();
243
244 // clear myself
245 m_pKeys.Clear();
246
247 // insert all elements into the other UnorderedMultiSet
248 other.m_pKeys.InsertRange(0, tmp);
249
250 }
251 }
Here is the call graph for this function:

◆ ToArray()

byte[] SystemEx.Collections.Generic.Cache.ToArray ( )

Returns a copy of the internal buffer.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

647 {
648 if ( m_isLocked ) throw new CacheIsSharedException();
649 return m_rawBuffer.ToNative();
650 }
Here is the caller graph for this function:

◆ ToArrayEx()

FixedVector< byte > SystemEx.Collections.Generic.Cache.ToArrayEx ( )

Returns a copy of the internal buffer, as Array<T>.

Returns
Exceptions
CacheIsSharedException
656 {
657 if ( m_isLocked ) throw new CacheIsSharedException();
658 return (FixedVector<byte>)m_rawBuffer.Duplicate();
659 }
Here is the caller graph for this function:

◆ ToBytes< T >()

unsafe byte[] SystemEx.Collections.Generic.Cache.ToBytes< T > ( ref T value)
static

Converts an unmanaged value to its raw byte representation.

Type Constraints
T :unmanaged 
266 : unmanaged {
267
268 int size = sizeof(T);
269 byte[] data = new byte[size];
270
271 fixed ( T* pValue = &value )
272 fixed ( byte* pData = data ) {
273 System.Buffer.MemoryCopy(pValue, pData, size, size);
274 }
275
276 return data;
277 }

◆ TryGet()

bool SystemEx.Collections.Generic.Find< T, TContainer >.TryGet ( T Key,
out int index )

Attempts to find the index of the specified key.

195 {
196 for ( int i = 0 ; i < m_container.Count ; i++ ) {
197 var p = m_container.ElementAt(i);
198
199 if ( p != null && p.Equals(Key) ) {
200 index = i;
201 return true;
202 }
203 }
204 index = -1;
205 return false;
206 }

◆ UnorderedMultiSet()

SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.UnorderedMultiSet ( ref TContainer keys)

Creates a new unsorted view over the given container.

Parameters
keysReference to the underlying container.
46 {
47 m_pKeys = ref keys;
48 m_finder = new Find<T, TContainer>(ref keys);
49
50 }
Here is the caller graph for this function:

◆ UpperBound()

long SystemEx.Collections.Generic.Find< T, TContainer >.UpperBound ( T key,
ISimpleCompare< T > cmp )

Finds the first index at which the element is strictly larger than the specified key. The comparison is performed using the provided ISimpleCompare<T> predicate, which defines the relation a < b.

Parameters
keyThe key used for comparison.
cmpA simple comparison predicate that returns true when a is considered smaller than b .
Returns
The index of the first element that is strictly larger than key , or -1 if no such element exists.
267 {
268 long _ret = -1;
269
270 long lo = 0;
271 long hi = m_container.Count;
272
273 while ( lo < hi ) {
274 long mid = (lo + hi) >> 1;
275 T? val = m_container.ElementAt(mid);
276
277 if ( val == null ) {
278 lo = mid + 1;
279 continue;
280 }
281
282 // val <= key → move right
283 if ( cmp.Compare(val, key) ) {
284 lo = mid + 1;
285 } else {
286 _ret = mid;
287 hi = mid;
288 }
289 }
290
291 return _ret;
292 }

◆ Validate() [1/2]

bool SystemEx.Collections.Generic.Set< T, TContainer >.Validate ( )

Validates the internal ordering of the set. The container must be sorted according to the comparison function.

Returns
True if the container is sorted and contains no duplicates; otherwise false.
246 {
247 bool _ret = true;
248
249 if ( m_pKeys.Count > 1 ) {
250 for ( int i = 1 ; i < m_pKeys.Count ; i++ ) {
251 var prev = m_pKeys.ElementAt(i - 1);
252 var curr = m_pKeys.ElementAt(i);
253
254 if ( prev == null || curr == null ) {
255 _ret = false;
256 break;
257 }
258
259 if ( !m_compare.Compare(prev, curr) ) {
260 _ret = false;
261 break;
262 }
263 }
264 }
265
266 return _ret;
267 }

◆ Validate() [2/2]

bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Validate ( )

tests is this view validated return only true

176 {
177 return true;
178 }

◆ Where()

int SystemEx.Collections.Generic.Find< T, TContainer >.Where ( Func< T, bool > pred)

Counts how many elements in the container satisfy the given predicate.

Parameters
predThe predicate used to test each element.
162 {
163 int _ret = -1;
164 for ( long i = 0 ; i < m_container.Count ; i++ ) {
165 var item = m_container.ElementAt(i);
166
167 if ( item != null && pred(item) ) {
168 _ret++;
169 }
170 }
171 return _ret;
172 }

◆ Write() [1/12]

int SystemEx.Collections.Generic.Cache.Write ( byte data)

Writes a single byte at the current position and advances the position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

533 {
534 var written = WriteRange(m_position, m_position + 1, new byte[1] { data } );
535 m_position += written;
536 return (int)written;
537 }
Here is the call graph for this function:

◆ Write() [2/12]

int SystemEx.Collections.Generic.Cache.Write ( byte[] buffer,
int offset,
int count )

Writes bytes from the specified buffer and advances the internal position.

Parameters
bufferThe byte buffer to write
offset
countSize of the buffer to write
Returns
NUmber of bytes are written
Exceptions
InvalidOperationException
ArgumentOutOfRangeException

Implements SystemEx.Collections.Generic.Interfaces.ICache.

610 {
611 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
612 if ( offset < 0 || count < 0 ) throw new ArgumentOutOfRangeException("offset,count");
613
614 ArgumentNullException.ThrowIfNull(buffer);
615 ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length);
616
617
618
619 // Adjust count if caller asked for more than fits in the target buffer
620 if ( offset + count > buffer.Length ) {
621 count = buffer.Length - offset;
622 }
623
624 // If write position is already at or beyond end, nothing to write
625 if ( (ulong)m_rawBuffer.Length <= m_position ) return 0;
626
627 // How many bytes are available in the raw buffer from current position
628 ulong available = (ulong)m_rawBuffer.Length - m_position;
629 int toWrite = (int)System.Math.Min((ulong)count, available);
630
631 if ( toWrite <= 0 ) return 0;
632
633 for ( int i = 0; i < toWrite; i++ ) {
634 m_rawBuffer[(int)(m_position + (ulong)i)] = buffer[offset + i];
635 }
636
637 // advance internal position
638 m_position += (ulong)toWrite;
639
640 if ( m_position > m_maxUsedAdress ) m_maxUsedAdress = m_position;
641
642 return toWrite;
643 }

◆ Write() [3/12]

int SystemEx.Collections.Generic.Cache.Write ( ulong position,
byte value )

Writes a byte at the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

328 {
329 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
330
331 byte[] b = value.ToBytes(Endian.LittleEndian);
332
333 return (int)WriteRange(position, b);
334 }
Endian
Specifies the byte order used when converting values to and from raw byte sequences.
Definition Conversion.cs:29
Here is the call graph for this function:

◆ Write() [4/12]

int SystemEx.Collections.Generic.Cache.Write ( ulong position,
char value )

Writes a character at the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

318 {
319 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
320
321 byte[] b = value.ToBytes(Endian.LittleEndian);
322
323 return (int)WriteRange(position, b);
324 }
Here is the call graph for this function:

◆ Write() [5/12]

int SystemEx.Collections.Generic.Cache.Write ( ulong position,
double value,
Endian endian )

Writes a double-precision floating-point value at the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

378 {
379 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
380
381 byte[] b = value.ToBytes(endian);
382
383 return (int)WriteRange(position, b);
384 }
Here is the call graph for this function:

◆ Write() [6/12]

int SystemEx.Collections.Generic.Cache.Write ( ulong position,
float value,
Endian endian )

Writes a single-precision floating-point value at the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

368 {
369 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
370
371 byte[] b = value.ToBytes(endian);
372
373 return (int)WriteRange(position, b);
374 }
Here is the call graph for this function:

◆ Write() [7/12]

int SystemEx.Collections.Generic.Cache.Write ( ulong position,
int value,
Endian endian )

Writes a 32-bit signed integer at the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

298 {
299 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
300
301 byte[] b = value.ToBytes(endian);
302
303 return (int)WriteRange(position, b);
304 }
Here is the call graph for this function:

◆ Write() [8/12]

int SystemEx.Collections.Generic.Cache.Write ( ulong position,
long value,
Endian endian )

Writes a 64-bit signed long at the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

348 {
349 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
350
351 byte[] b = value.ToBytes(endian);
352
353 return (int)WriteRange(position, b);
354 }
Here is the call graph for this function:

◆ Write() [9/12]

int SystemEx.Collections.Generic.Cache.Write ( ulong position,
short value,
Endian endian )

Writes a 16-bit signed short at the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

308 {
309 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
310
311 byte[] b = value.ToBytes(endian);
312
313 return (int)WriteRange(position, b);
314 }
Here is the call graph for this function:

◆ Write() [10/12]

int SystemEx.Collections.Generic.Cache.Write ( ulong position,
uint value,
Endian endian )

Writes a 32-bit unsigned integer at the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

288 {
289 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
290
291 byte[] b = value.ToBytes(endian);
292
293 return (int)WriteRange(position, b);
294 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write() [11/12]

int SystemEx.Collections.Generic.Cache.Write ( ulong position,
ulong value,
Endian endian )

Writes a 64-bit unsigned long at the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

358 {
359 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
360
361 byte[] b = value.ToBytes(endian);
362
363 return (int)WriteRange(position, b);
364 }
Here is the call graph for this function:

◆ Write() [12/12]

int SystemEx.Collections.Generic.Cache.Write ( ulong position,
ushort value,
Endian endian )

Writes a 16-bit unsigned short at the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

338 {
339 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
340
341 byte[] b = value.ToBytes(endian);
342
343 return (int)WriteRange(position, b);
344 }
Here is the call graph for this function:

◆ WriteRange() [1/2]

virtual ulong SystemEx.Collections.Generic.Cache.WriteRange ( ulong position,
byte[] data )
virtual

Writes a byte range into the cache starting at the specified position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

Reimplemented in SystemEx.Collections.Generic.StrippedCache.

231 {
232 return WriteRange(position, (ulong)data.LongLength, data);
233 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteRange() [2/2]

virtual ulong SystemEx.Collections.Generic.Cache.WriteRange ( ulong start,
ulong iend,
byte[] data )
virtual

Writes a byte range into the cache between start and iend .

Implements SystemEx.Collections.Generic.Interfaces.ICache.

Reimplemented in SystemEx.Collections.Generic.MirroredCache, and SystemEx.Collections.Generic.StrippedCache.

237 {
238 if ( m_isLocked ) throw new InvalidOperationException("is Locked");
239
240 // Start ungültig?
241 if ( start < 0 || start >= (ulong)m_rawBuffer.Length )
242 return 0;
243
244 // End über Größe → kappen
245 if ( iend > (ulong)m_rawBuffer.Length )
246 iend = (ulong)m_rawBuffer.Length;
247
248 // Bereich ungültig?
249 if ( iend <= start )
250 return 0;
251
252 ulong rangeLen = iend - start;
253 ulong writable = System.Math.Min((uint)rangeLen, (uint)data.Length);
254
255 for ( ulong i = 0; i < (ulong)writable; i++ )
256 m_rawBuffer[(int)(start + i)] = data[i];
257
258 if ( (start + writable) > m_maxUsedAdress ) m_maxUsedAdress = start + writable;
259
260 return (ulong)writable;
261 }

Properties

◆ CanRead

bool SystemEx.Collections.Generic.Cache.CanRead
get

Indicates whether the cache is readable.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

121{ get => !m_isLocked; }

◆ CanWrite

bool SystemEx.Collections.Generic.Cache.CanWrite
get

Indicates whether the cache is writable.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

117{ get => !m_isLocked; }

◆ Count [1/2]

long SystemEx.Collections.Generic.Set< T, TContainer >.Count
get

Returns the number of elements stored in the container.

◆ Count [2/2]

long SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Count
get

Returns the number of elements stored in the container.

◆ Current [1/2]

T SystemEx.Collections.Generic.Set< T, TContainer >.Current
get

Returns the current element of the underlying container.

◆ Current [2/2]

T SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Current
get

Returns the current element of the underlying container.

◆ Free

virtual ulong SystemEx.Collections.Generic.Cache.Free
get

Gets the total free bytes.

◆ IsEmpty [1/3]

bool SystemEx.Collections.Generic.Cache.IsEmpty
get

Indicates whether the cache contains no data.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

◆ IsEmpty [2/3]

bool SystemEx.Collections.Generic.Set< T, TContainer >.IsEmpty
get

Indicates whether the underlying container is empty.

◆ IsEmpty [3/3]

bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.IsEmpty
get

Indicates whether the underlying container is empty.

◆ IsFull [1/2]

bool SystemEx.Collections.Generic.Set< T, TContainer >.IsFull
get

Indicates whether the underlying container is full.

◆ IsFull [2/2]

bool SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.IsFull
get

Indicates whether the underlying container is full.

◆ IsLocked

bool SystemEx.Collections.Generic.Cache.IsLocked
getsetprotected

Gets or sets the internal lock state.

80{ get { return m_isLocked; } set => m_isLocked = value; }

◆ Length [1/3]

virtual ulong SystemEx.Collections.Generic.Cache.Length
get

Gets the total buffer length in bytes.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

◆ Length [2/3]

long SystemEx.Collections.Generic.Set< T, TContainer >.Length
get

Returns the total capacity of the underlying container.

◆ Length [3/3]

long SystemEx.Collections.Generic.UnorderedMultiSet< T, TContainer >.Length
get

Returns the total capacity of the underlying container.

◆ LongLength

virtual ulong SystemEx.Collections.Generic.Cache.LongLength
getset

Gets the logical length of the cache as an unsigned 64-bit value.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

105{ get; internal set; }

◆ Position

ulong SystemEx.Collections.Generic.Cache.Position
getset

Gets and Set the current read/write position.

Implements SystemEx.Collections.Generic.Interfaces.ICache.

125{ get => m_position; set => m_position = value; }

◆ SortFunctions

SortAction<ISimpleCompare<T>, TContainer> SystemEx.Collections.Generic.Set< T, TContainer >.SortFunctions
getset

Gets or sets the delegate-based sort function.

69 {
70 get => m_sorter!;
71 set {
72 m_sorter = value;
73 }
74 }

◆ this[int adress]

byte SystemEx.Collections.Generic.Cache.this[int adress]
getset

Provides indexed access to the raw buffer.

84 {
85 get { return m_rawBuffer[adress]; }
86 set { m_rawBuffer[adress] = value; }
87 }

◆ Type

CacheType SystemEx.Collections.Generic.Cache.Type
get

Gets the configured cache type (read, write, or both).

Implements SystemEx.Collections.Generic.Interfaces.ICache.

113{ get; private set; }

◆ Used

virtual ulong SystemEx.Collections.Generic.Cache.Used
get

Gets the total used bytes.