maxon.BaseArray¶
Description¶
A generic array class template used to stored any kind of data. It is based on
maxon.BaseCollection
and maxon.Collection
.
Methods Signature¶
|
Not Implemented yet, use Resize and []. |
|
|
|
Gets the number of array elements. |
|
Inserts a new element at index position. |
|
Resizes the array to contain newCnt elements.
|
|
Returns a |
|
Initialize the BaseContainer in order to store a given type. At the moment only maxon Data Type are supported.
|
Methods Definition¶
-
BaseArray.
Append
(value)¶ Not Implemented yet, use Resize and [].
-
BaseArray.
CopyFrom
(other)¶
-
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
newCnt (int) – New array size.
resizeFlags (
maxon.COLLECTION_RESIZE_FLAGS
) – How the resizing should be performed.
-
BaseArray.
ToBlock
()¶ Returns a
maxon.Block
which represents the elements of the array.- Returns
The content of this array as a block.
- Returns
-
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:
Example 1: “net.maxon.interface.string-C” creates an array of string objects
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.