Class Vector<T>
- Namespace
- WoWLib
- Assembly
- WoWLib.dll
A reference-semantic C++ std::vector, generic over the element. A
scalar/enum element reads and writes through a zero-copy span over the C++
buffer (AsSpan() is the buffer-protocol view, valid until a size-changing
operation or Dispose); a welded-class element hands out LIVE views, so
v[i].Field = x writes through.
public sealed class Vector<T> : IDisposable
Type Parameters
T
- Inheritance
-
Vector<T>
- Implements
- Inherited Members
Constructors
Vector()
A fresh, empty vector (any element type the module binds).
public Vector()
Properties
Count
public int Count { get; }
Property Value
this[int]
public T this[int i] { get; set; }
Parameters
iint
Property Value
- T
Methods
Add(T)
public void Add(T item)
Parameters
itemT
AsSpan<TData>()
Reinterpret the contiguous native storage as ONE span of blittable record values — a single interop crossing for the whole buffer, where the live-view indexer pays per element. TData is the element's nested Data mirror (size-checked at runtime; the layout itself is asserted in the native build). Writes go straight to native memory. Valid until a size-changing operation or Dispose.
public Span<TData> AsSpan<TData>() where TData : unmanaged
Returns
- Span<TData>
Type Parameters
TData
Clear()
public void Clear()
CopyFrom(ReadOnlySpan<T>)
Replace the whole contents (scalar/enum elements only).
public void CopyFrom(ReadOnlySpan<T> src)
Parameters
srcReadOnlySpan<T>
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetEnumerator()
public Vector<T>.Enumerator GetEnumerator()
Returns
- Vector<T>.Enumerator
ToArray()
public T[] ToArray()
Returns
- T[]
Operators
implicit operator Vector<T>(T[])
public static implicit operator Vector<T>(T[] a)
Parameters
aT[]
Returns
- Vector<T>