class Array

Summary

This abstract class represents an array managed by the Max Environment.

syntax:
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.

syntax:
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.

syntax:
protected Array(ulong Count)

Parameters

Type Name Description
ulong Count Count.

Array()

Initializes an array with 0 length.

syntax:
protected Array()

Array(T[] Elements)

Initializes an array with an array of elements.

syntax:
protected Array(T[] Elements)

Parameters

Type Name Description
T[] Elements Elements

Properties

ElementByteSize

The size of each element of the array in bytes.

syntax:
public abstract ulong ElementByteSize { get; }

ByteLength

Length of the array in bytes.

syntax:
public abstract ulong ByteLength { get; }

Methods

CopyFromLength(T[] Array, int Length)

Copies a set number of values from one array to another.

syntax:
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.

syntax:
public void CopyFrom(T[] Array)

Parameters

Type Name Description
T[] Array Array

InstanceCreate(ulong Length)

Creates an instance of this datatype.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
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.

syntax:
protected void RePoint(IntPtr Pointer, ulong Count, ulong Alignment)

Parameters

Type Name Description
IntPtr Pointer Pointer
ulong Count Length
ulong Alignment Alignment