Python Component API: class DataRecord

The following methods are available for Python class DataRecord.

This page discusses:

Description

This class is a simple wrapper around swigpython3.iDataRecord. It is part of the pilotpython module, which is available in the Python (on Server) component.

class DataRecord(builtins.object)

DataRecord.__init__(data)
Description Constructor. Takes the swigpython3.iDataRecord to wrap as its parameter.
Input parameters param data: iDataRecord to wrap

type data: swigpython3.iDataRecord

Return value None
DataRecord.findRoot()
Description Returns the top-level node for the data record. This method allows the caller to begin navigation of the node hierarchy contained by the data record.If you only need to work with the flat data record property collection, you do not need to use this method.
Input parameters None
Return value returns: Root node or None

rtype: Node

DataRecord.getProperties()
Description Gets the data record's property list.
Input parameters None
Return value returns: Properties of the data record.

rtype: PropertyCollection

DataRecord.getRawDataRecord()
Description Returns the raw swigpython3.iDataRecord
Input parameters None
Return value returns: Raw SWIG-generated object

rtype: swigpython3.iDataRecord

DataRecord.getRoot()
Description Returns the top-level node of the data record, if set.This method allows the caller to begin navigation of the node hierarchy contained by the data record. If you only need to work with the flatdata record property collection, you do not need to use this method.If a root node is not set for the record, this method throws an exception.
Input parameters None
Return value returns: Root node

rtype: Node

DataRecord.isNewData()
Description Determines if the current data record is new. This method is useful when the component state is eitherREADY_FOR_NEW_DATA or READY_FOR_INPUT_THEN_NEW_DATA.
Input parameters None
Return value returns: True if the data is new (no children of any kind), False otherwise
DataRecord.routeTo(port)
Description Sends the data record to the specified port. If this method is not called, the record is routed to the component's Pass port by default.
Input parameters param port: The port to which to send the record:* pilotpython.NO_PORTDoes not send the record to any port; essentially deletes the record.* pilotpython.PASS_PORTSends the data record to the Pass port. This is the default behavior.* pilotpython.FAIL_PORT:Sends the data record to the Fail port.
Return value None
DataRecord.setRoot(node)
Description Assigns the specified node to the data record as the root node.If you only need to work with the flat data record property collection, you do not need to use this method. It is generally used by reader and generator components that create nodes of a domain-specific type.
Input parameters param node: Node to set

type node: Node

Return value None
DataRecord.throwDataTypeException(expectedType)
Description Throws a data type exception when used in the onProcess() function of a component. Execution of the onProcess() code will break at that point.You should use this method when the input data record is not of an expected or supported type. Use the string argument to specifythe name of the expected type, for example SciTegic.Image.
Input parameters param expectedType: Name of type that was expected

type expectedType: str

Return value None

Data descriptors defined here

DataRecord.__dict__
Description dictionary for instance variables (if defined)
DataRecord.__weakref__
Description list of weak references to the object (if defined)