Back to Aurora Vision Library website

You are here: Start » Function Reference » All Functions » Array Composition » AccumulateArray

AccumulateArray


This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.

Header: STD.h
Namespace: avl
Module: FoundationLite

Joins arrays appearing in consecutive iterations.

Syntax

void avl::AccumulateArray
(
	const atl::Array<T>& inArray,
	atl::Optional<int> inMaxSize,
	bool inReset,
	atl::Array<Type>& outArray
)

Parameters

Name Type Range Default Description
Input value inArray const Array<T>& Array to be joined
Input value inMaxSize Optional<int> 0 - NIL Maximum number of last elements that are remembered
Input value inReset bool False Reset accumulator state
Output value outArray Array<Type>& Joined array

Examples

To implement basic example perform following steps:
  • Using AvsFilter_CreateArray create 1x3 dimensional array [1, 2, 3]
  • Place AccumulateArray inside the body of Loop (or any Enumerate* filter)
  • Connect created vector to inArray input of the filter
  • After k loop iterations, the output outArray will look like as follows:
k = 1
outArray = [1, 2, 3]

k = 2
outArray = [1, 2, 3, 1, 2, 3]

k = 3
outArray = [1, 2, 3, 1, 2, 3, 1, 2, 3]

It is also possible to set maximum size of outArray. For above described example, when inMaxSize is set to 6, after second iteration new data will be appended to outArray while old data will be erased.

k = 1
outArray = [1, 2, 3]

k = 2
outArray = [1, 2, 3, 1, 2, 3]

k = 3
outArray = 1, 2, 3 [1, 2, 3, 1, 2, 3]

Errors

List of possible exceptions:

Error type Description
DomainError inMaxSize cannot be negative in AccumulateArray.

See Also

  • Loop – Generates a loop that ends at the first invocation with False on the input.