3.1.18. c3po.LocalExchanger module

Inheritance diagram of c3po.LocalExchanger

Contains the classes LocalExchanger, ShortcutToField and ShortcutToValue. ShortcutToData is for internal use only.

class c3po.LocalExchanger.LocalExchanger(method, fieldsToGet, fieldsToSet, valuesToGet=[], valuesToSet=[])

Bases: Exchanger

LocalExchanger is an Exchanger for local data exchanges between DataAccessor objects (PhysicsDriver or LocalDataManager).

Once the object has been constructed, a call to exchange() triggers the exchanges of data.

__init__(method, fieldsToGet, fieldsToSet, valuesToGet=[], valuesToSet=[])

Build a LocalExchanger object.

Parameters:
  • method

    A user-defined function (or class with the special method __call__).

    • method must have three input lists:
      • The MED fields obtained by (get/update)OutputMED(Double/Int/String)Field() from the fieldsToGet objects, in the same order.

      • The MED fields obtained by getInputMED(Double/Int/String)FieldTemplate() from the fieldsToSet objects, in the same order.

      • The scalars obtained by (get/update)Output(Double/Int/String)Value() from the valuesToGet objects, in the same order.

    • It must have two ouput lists:
      • The MED fields to impose by setInputMED(Double/Int/String)Field() to the fieldsToSet objects, in the same order.

      • The scalars to impose by setIntput(Double/Int/String)Value() to the valuesToSet objects, in the same order.

  • fieldsToGet (list[tuple]) –

    A list of tuples (object, name, type).

  • fieldsToSet (list[tuple]) – A list of tuples in the same format as fieldsToGet. name is the name of the field to set in object.

  • valuesToGet (list[tuple]) – Idem fieldsToGet but for scalars.

  • valuesToSet (list[tuple]) – Idem fieldsToSet but for scalars.

clean()

See Exchanger.clean().

exchange()

Trigger the exchange of data.

class c3po.LocalExchanger.ShortcutToField(container, name, type_=None)

Bases: object

INTERNAL.

__init__(container, name, type_=None)

INTERNAL.

clean()

INTERNAL.

get()

INTERNAL.

getFieldTemplate()

INTERNAL.

initialize()

INTERNAL.

set(field)

INTERNAL.

class c3po.LocalExchanger.ShortcutToValue(container, name, type_=None)

Bases: object

INTERNAL.

__init__(container, name, type_=None)

INTERNAL.

get()

INTERNAL.

initialize()

INTERNAL.

set(value)

INTERNAL.