maxon.BaseArray

Description

A generic array class template used to stored any kind of data. It is based on maxon.BaseCollection and maxon.Collection.

Inheritance diagram

Inheritance

Parent Class:

Methods Signature

Append(*args)

Not Implemented yet, use Resize and [].

GetCount()

Gets the number of array elements.

Insert(index, value)

Inserts a new element at index position.

Resize(newCnt[, resizeFlags])

Resizes the array to contain newCnt elements.

ToBlock()

Returns a maxon.Block which represents the elements of the array.

__init__([ob, input, count])

Initialize the BaseContainer in order to store a given type. At the moment only maxon Data Type are supported.

Methods Definition

BaseArray.Append(*args)

Not Implemented yet, use Resize and [].

BaseArray.GetCount()

Gets the number of array elements.

Returns

Number of array elements.

Return type

int

BaseArray.Insert(index, value)

Inserts a new element at index position.

Parameters
  • index (int) – position

  • value (Any) – The value to be copied.

BaseArray.Resize(newCnt, resizeFlags=enums.COLLECTION_RESIZE_FLAGS.DEFAULT)
Resizes the array to contain newCnt elements.
If newCnt is smaller than BaseArray.GetCount() all extra elements are being deleted.
If it is greater the array is expanded and the default constructor is called for new elements.
Parameters
BaseArray.ToBlock()

Returns a maxon.Block which represents the elements of the array.

Returns

The content of this array as a block.

Returns

maxon.Block

BaseArray.__init__(ob=None, input=None, count=None)
Initialize the BaseContainer in order to store a given type. At the moment only maxon Data Type are supported.

If it is an iterable the items are copied over
Parameters
  • ob (Union[str, datatype capsule, WrapperClass] (e.g. maxon.Int32 or maxon.BaseTime)) –

    If it’s a string:

    1. Example 1: “net.maxon.interface.string-C” creates an array of string objects

    2. Example 2: “net.maxon.interface.string-C[A]” creates an array of string arrays

    If it’s a datatype capsule e.g maxon.Int32 it will only accept this kind of datatype later.

  • input (Optional(Union[int, collections.Iterable])) – If it’s an integer, resize the array with this number, if it’s an iterable the data are copied.

  • count (Optional(int)) – Number of elements to fill/copy in case if input is passed.