1.7.5. Virtual single-connectors¶
This section contains helper classes, that are returned by the []
operator of MultiInputConnector
and MultiOutputConnector
and simulate single input- and output-connectors.
-
class
connectors._common._multiinput_item.
MultiInputItem
(connector, instance, replace_method, key, observers, executor)¶ An object, that is returned by the
__getitem__()
overload.It simulates the behavior of a single-input connector, so it is possible to use a multi-input connector as arbitrarily many single-inputs.
Parameters: - connector – the multi-input connector
- instance – the instance of which the method was replaced by the multi-input connector
- replace_method – an unbound method, that is used to replace data, that has been added through the multi-input connector
- key – the key with which the multi-input has been accessed.
- observers – a sequence of output connectors, that observe the multi-input connector’s value changes.
- executor – an
Executor
instance, that is used, when calling the instance of this class.
-
connect
(connector)¶ Connects this virtual single-input to an output.
Parameters: connector – the connector, to which this connector shall be connected Returns: the instance of which the method was replaced by the multi-input connector
-
disconnect
(connector)¶ Disconnects this virtual single-input from an output, to which is has been connected..
Parameters: connector – the connector, from which this connector shall be disconnected Returns: the instance of which the method was replaced by the multi-input connector
-
class
connectors._common._multioutput_item.
MultiOutputItem
(connector, instance, key)¶ An object, that is returned by the
__getitem__()
overload.It simulates the behavior of a single-output connector, so it is possible to use a multi-output connector as arbitrarily many single-outputs.
Parameters: - connector – the multi-output connector
- instance – the instance of which the method was replaced by the multi-output connector
- key – the key with which the multi-output has been accessed.
-
connect
(connector)¶ Connects this virtual single-output to an output.
Parameters: connector – the connector, to which this connector shall be connected Returns: the instance of which the method was replaced by the multi-output connector
-
disconnect
(connector)¶ Disconnects this virtual single-output from an input, to which is has been connected..
Parameters: connector – the connector, from which this connector shall be disconnected Returns: the instance of which the method was replaced by the multi-output connector
-
key
()¶ Returns the key, with which the multi-output connector has been accessed.