Field Factory

This module provides functions to help the handling of field structures.

MultimodalMiddlewareProtocol.FieldFactory.decode(s, r)

Decodes the input stream r, following the field type sequence specified by s. The input stream will be read from the actual position (access pointer). The returned list has one element for each field specified in the format s.

Parameters:
  • s – field type sequence. Ex.: “LLLI”
  • r – input stream
Return type:

list of values

MultimodalMiddlewareProtocol.FieldFactory.decodeXMLFieldType(type)

This function translates a XML field type description, as specified on the Event Specification Format DTD. Valid fields: byte|short|integer|long|shortstring|char|doublechar|longstring|widestring|record|array

Parameters:
  • type (str) – string with the field XMF-ESF format.
Returns:

respective field code, as defined in the Consts module.

Return type:

str

MultimodalMiddlewareProtocol.FieldFactory.destroyFieldVector(v)

Destroy all Fields objects in v.

Parameters:
MultimodalMiddlewareProtocol.FieldFactory.fieldFromCode(code)

This function creates a field with the type specified by code. You can check the available codes in the Consts module.

Return type:a Field descendant, None in case of error.
MultimodalMiddlewareProtocol.FieldFactory.fieldFromCodeList(codelist)

Initializes a list of Field descendants, using codelist to determine the type of the new fields. For arrays you can use: aL14 to create an array with 14 Long elements. If you do not specify the number of elements, just the subtype of the array will be set.

Parameters:
  • codelist (string) – sequence of field codes
Return type:

list of Fields

MultimodalMiddlewareProtocol.FieldFactory.readFields(fields, dIn)

This function receives an array of Fields and use dIn stream to assign values to them.

Parameters:
MultimodalMiddlewareProtocol.FieldFactory.writeFields(fields)

This fuction writes the list of Fields in a new output stream

Returns:serialized fields
Return type:str

Previous topic

Fields

Next topic

Device

This Page

Quick search