Class: ArrayType

ArrayType(type, lengthopt)

An array type

Constructor

new ArrayType(type, lengthopt)

Construct an array type

Parameters:
Name Type Attributes Default Description
type Type.<T>

The type of the elements in the array

length number | lengthCallback <optional>
null

The length of the array

Source:

Extends

Classes

ArrayType

Methods

alloc(memoryManager, unmarshalledIndex, unmarshalledArgs) → {number}

Allocate memory for the array.

Parameters:
Name Type Description
memoryManager MemoryManager

The memory manager

unmarshalledIndex number

The index to the unmarshalled array

unmarshalledArgs Array.<*>

The unmarshalled arguments

Source:
Returns:

The address of the allocated memory.

Type
number

copy(dest, source) → {Array.<T>}

Copy an array

Parameters:
Name Type Description
dest Array.<T>

The array to receive the data

source Array.<T>

The source array

Source:
Returns:

The array to which the data was copied.

Type
Array.<T>

free(memoryManager, address, unmarshalledIndex, unmarshalledArgs) → {void}

Free allocated memory.

Parameters:
Name Type Description
memoryManager MemoryManager

The memory manager

address number

The address of the memory to be freed

unmarshalledIndex number

The index of the unmarshalled array or -1

unmarshalledArgs Array.<*>

The unmarshalled args

Source:
Returns:
Type
void

getLength(unmarshalledIndex, unmarshalledArgs) → {number}

Get the length of the array

Parameters:
Name Type Description
unmarshalledIndex number

The index of the unmarshalled argument or -1

unmarshalledArgs Array.<*>

The unmarshalled arguments

Source:
Returns:

The length of the array.

Type
number

marshall(memoryManager, unmarshalledIndex, unmarshalledArgs) → {number}

Marshall a possibly nested array.

Parameters:
Name Type Description
memoryManager MemoryManager

The memory manager

unmarshalledIndex number

The index of the unmarshalled value

unmarshalledArgs Array.<*>

The unmarshalled arguments

Source:
Returns:

The address of the marshalled array

Type
number

unmarshall(memoryManager, address, unmarshalledIndex, unmarshalledArgs) → {Array.<T>}

Unmarshall a possibly nested array.

Parameters:
Name Type Description
memoryManager MemoryManager

The memory manager

address number

The address of the marshalled array

unmarshalledIndex number

The index of the unmarshalled arg or -1

unmarshalledArgs Array.<*>

The unmarshalled args

Source:
Returns:

The unmarshalled array

Type
Array.<T>