class Array
Summary
This abstract class represents an array managed by the Max Environment.
public abstract class Array<T> : IDataType where T : unmanaged
Constructors
Array(IntPtr Pointer, ulong Count, ulong Alignment)
Initializes the array with a pointer, array length and alignment.
protected Array(IntPtr Pointer, ulong Count, ulong Alignment)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | Pointer | Pointer |
ulong | Count | Length |
ulong | Alignment | Alignment |
Array(ulong Count)
Initializes an array of a specified length.
protected Array(ulong Count)
Parameters
Type | Name | Description |
---|---|---|
ulong | Count | Count. |
Array()
Initializes an array with 0 length.
protected Array()
Array(T[] Elements)
Initializes an array with an array of elements.
protected Array(T[] Elements)
Parameters
Type | Name | Description |
---|---|---|
T[] | Elements | Elements |
Properties
ElementByteSize
The size of each element of the array in bytes.
public abstract ulong ElementByteSize { get; }
ByteLength
Length of the array in bytes.
public abstract ulong ByteLength { get; }
Methods
CopyFromLength(T[] Array, int Length)
Copies a set number of values from one array to another.
protected abstract void CopyFromLength(T[] Array, int Length);
Parameters
Type | Name | Description |
---|---|---|
T[] | Array | Array to copy |
int | Length | Number of elements |
CopyFrom(T[] Array)
Copies values from one array to this one.
public void CopyFrom(T[] Array)
Parameters
Type | Name | Description |
---|---|---|
T[] | Array | Array |
InstanceCreate(ulong Length)
Creates an instance of this datatype.
public abstract IDataType InstanceCreate(ulong Length);
Parameters
Type | Name | Description |
---|---|---|
ulong | Length | Length |
Returns: Instance ( abstract IDataType )
getByte(int Index)
Gets the value at a certain index as a byte.
protected byte getByte(int Index)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
Returns: Byte value ( byte )
getShort(int Index)
Gets the value at a certain index as a short.
protected short getShort(int Index)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
Returns: Short value ( short )
getInt(int Index)
Gets the value at a certain index as an int.
protected int getInt(int Index)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
Returns: Int value ( int )
getLong(int Index)
Gets the value at a certain index as a long.
protected long getLong(int Index)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
Returns: Long value ( long )
getFloat(int Index)
Gets the value at a certain index as a float.
protected float getFloat(int Index)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
Returns: Float value ( float )
getDouble(int Index)
Gets the value at a certain index as a double.
protected double getDouble(int Index)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
Returns: Double value ( double )
getBool(int Index)
Gets the value at a certain index as a boolean.
protected bool getBool(int Index)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
Returns: Bool value ( bool )
setByte(int Index, byte Value)
Sets the value at the given index as a byte.
protected void setByte(int Index, byte Value)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
byte | Value | Value |
setShort(int Index, short Value)
Sets the value at the given index as a short.
protected void setShort(int Index, short Value)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
short | Value | Value |
setInt(int Index, int Value)
Sets the value at the given index as an int.
protected void setInt(int Index, int Value)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
int | Value | Value |
setLong(int Index, long Value)
Sets the value at the given index as a long.
protected void setLong(int Index, long Value)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
long | Value | Value |
setFloat(int Index, float Value)
Sets the value at the given index as a float.
protected void setFloat(int Index, float Value)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
float | Value | Value |
setDouble(int Index, double Value)
Sets the value at the given index as a double.
protected void setDouble(int Index, double Value)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
double | Value | Value |
setBool(int Index, bool Value)
Sets the value at the given index as a bool.
protected void setBool(int Index, bool Value)
Parameters
Type | Name | Description |
---|---|---|
int | Index | Index |
bool | Value | Value |
SetData(IDataType Data)
Copies the data from the passed DataType to this array.
public void SetData(IDataType Data)
Parameters
Type | Name | Description |
---|---|---|
IDataType | Data | Data |
RePoint(IntPtr Pointer, ulong Count, ulong Alignment)
Repoints the array somewhere else, with new number of elements and alignment.
protected void RePoint(IntPtr Pointer, ulong Count, ulong Alignment)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | Pointer | Pointer |
ulong | Count | Length |
ulong | Alignment | Alignment |