Overview

The input object is the input of a BRAHMS Python Process. The object passed in is constructed anew by the bindings before every call.

Fields

Notes
  • On the first event called, EVENT_MODULE_INIT, only the fields event is present (this is because time and the input/output interfaces are not yet instantiated).
event
Analogous to the Event object passed to a native BRAHMS process. Sub-fields type and flags are as in Event.
time
Component Time, converted to a Python representation.
iif
The process input interface, converted to a Python representation. In particular, any available data on the input interface are present in this field. The field has a sub-field for each input set, <set name>, described below. The sub-field default will always be present, representing the Default Set. If you don't use Sets, it is in this latter field that you will find all of your input ports.
iif.<set name>
The set structure has two sub-fields, index and ports, described below.
iif.<set name>.ports
Input ports are available in this 1xN struct object, in the order they sit in the set. Each entry is a structure having sub-fields for the name, class, structure and content (data) on the port.
iif.<set name>.index
It is possible to find named inputs by walking through the ports field, and checking the name of each port. This supplementary field provides an associative index to make it easier to find named ports (see the example below).

Example

Py Source Code (against 1262)
... # switch on event type elif input['event']['type'] == EVENT_INIT_CONNECT: ... # on last call if input['event']['flags'] & F_LAST_CALL: # get reference to our input called "in" on the default set i = input['iif']['default']['index']['in'] persist['in'] = input['iif']['default']['ports'][i] ... # switch on event type elif input['event']['type'] == EVENT_RUN_SERVICE: # print value of our input at this time instant print persist['in']['data'] ...