Class MappedArray<TMapped, T>
A mapped huge array wrapping another array.
Inherited Members
Namespace: Mars.Common.IO.Mapped.Arrays
Assembly: Mars.IO.dll
Syntax
public class MappedArray<TMapped, T> : ArrayBase<TMapped>, ISerializableToStream, IEnumerable<TMapped> where TMapped : struct where T : struct
Type Parameters
Name | Description |
---|---|
TMapped | The more 'advanced' stucture. |
T | The 'simple' structure. |
Remarks
Used to map a more generic class or type to a more simple type like ints or floats.
Constructors
MappedArray(ArrayBase<T>, Int32, MappedArray<TMapped, T>.MapTo, MappedArray<TMapped, T>.MapFrom)
Creates a new mapped huge array.
Declaration
public MappedArray(ArrayBase<T> baseArray, int elementSize, MappedArray<TMapped, T>.MapTo mapTo, MappedArray<TMapped, T>.MapFrom mapFrom)
Parameters
Type | Name | Description |
---|---|---|
ArrayBase<T> | baseArray | The base array. |
System.Int32 | elementSize | The size of one mapped structure when translate to the simpler structure. |
MappedArray.MapTo<> | mapTo | The map to implementation. |
MappedArray.MapFrom<> | mapFrom | The map from implementation. |
Properties
CanResize
Returns true if this array can resize.
Declaration
public override bool CanResize { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
Mars.Common.IO.Mapped.Arrays.ArrayBase<TMapped>.CanResize
Item[Int64]
Returns the element at the given index.
Declaration
public override TMapped this[long idx] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | idx |
Property Value
Type | Description |
---|---|
TMapped |
Overrides
Mars.Common.IO.Mapped.Arrays.ArrayBase<TMapped>.Item[System.Int64]
Length
Returns the length of this array.
Declaration
public override long Length { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Overrides
Mars.Common.IO.Mapped.Arrays.ArrayBase<TMapped>.Length
Methods
Dispose()
Disposes of all native resources associated with this object.
Declaration
public override void Dispose()
Overrides
Mars.Common.IO.Mapped.Arrays.ArrayBase<TMapped>.Dispose()
Resize(Int64)
Resizes this array.
Declaration
public override void Resize(long size)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | size |
Overrides
Mars.Common.IO.Mapped.Arrays.ArrayBase<TMapped>.Resize(System.Int64)
Implements
IEnumerable<>