maxon.Pair¶
Description¶
maxon.Pair
provides in-place static storage for elements of arbitrary types.maxon.Tuple
, but supports only 2 elements.Methods Signature¶
|
Returns an entry of the Pair. |
|
Retrieves the first entry stored in the maxon.Pair. |
Retrieves the second entry stored in the maxon.Pair. |
|
Retrieves the |
|
|
Defines a value of the Pair. |
|
Defines the returned type. |
|
Gets the item at the given index in the pair. |
|
Initializes the appropriate C++ Data object and store it within the _data member. |
|
Iterates over the two elements of the pair. |
|
|
|
Sets the item for the given index in the pair. |
Methods Definition¶
-
Pair.
Get
(ELEMENTTYPE)¶ Returns an entry of the Pair.
- Parameters
ELEMENTTYPE (int) – The index of the element to retrieve from the this maxon.Pair.
- Returns
The data stored
- Return type
-
Pair.
GetFirst
()¶ Retrieves the first entry stored in the maxon.Pair.
- Returns
The first entry of this maxon.Pair.
- Return type
-
Pair.
GetSecond
()¶ Retrieves the second entry stored in the maxon.Pair.
- Returns
The second entry of this maxon.Pair.
- Return type
-
Pair.
GetTypeArguments
()¶ Retrieves the
maxon.DataType
from an argument- Returns
The list of argument and
maxon.DataType
.- Return type
list[
maxon.DataType
, type)
-
Pair.
Set
(ELEMENTTYPE, obj)¶ Defines a value of the Pair.
- Parameters
ELEMENTTYPE (int) – The index of the element to set the value from the this maxon.Pair.
obj (
maxon.Data
) – The data to store stored
-
Pair.
SetReturnType
(type)¶ Defines the returned type.
- Parameters
type – The return type expected.
- Type
type
-
Pair.
__getitem__
(index)¶ Gets the item at the given index in the pair.
- Parameters
index (int) – The index to retrieve the value for.
- Raises
IndexError – When index is out of bounds.
- Returns
The retrieved item.
- Return type
-
Pair.
__init__
(typename)¶ Initializes the appropriate C++ Data object and store it within the _data member.
If C is a Data then _data store a copy the C++ Data is done and stored.If C is a C++ Data then _data store a reference of the C++ Data.If C is not defined the C++ data is created and stored in the _data member.- Parameters
C (Union[None,
maxon.Data
]) – Input data from which the Data should be created.
-
Pair.
__iter__
()¶ Iterates over the two elements of the pair.
-
Pair.
__maxon_convert__
(expected=None)¶
-
Pair.
__setitem__
(key, value)¶ Sets the item for the given index in the pair.
- Parameters
index (int) – The index of the value to set.
value (Optional[
maxon.Data
]) – The value to set for index.
- Raises
IndexError – When index is out of bounds.