Share

Getting output values

The graph selected in the GraphContainer may have multiple output and terminal ports. Once the graph has been compiled, all these outputs can be listed using the Job's getOutputs() method that returns a collection of read-only Output descriptors. Since the collection of Output descriptors is dependent on the current graph and is determined when the graph is compiled, each time another graph is selected using GraphContainer::setGraph(), or re-compiled using GraphContainer::compile(), then the collection returned by Job::getOutputs() may change.

Each Output descriptor indicates the output's name, indicates if it is a regular graph output port or a terminal, and indicates if it is enabled or not (at this time, only a terminal output can be disabled).

Once the graph has been executed, you can obtain the value from each regular output port using the Job's getOutputValue() method.

LIMITATION: At present, it is not possible to obtain the value of a terminal port using the Executor SDK.

ValueData argument

The getOutputValue() method receives a TypeTranslation::ValueData pointer that you control, and this pointer will be passed to the TypeTranslation::convertValueToHost() method. You can use this data pointer to pass whatever information you need to convert the Bifrost value of this specific output to a host value, and optionally, to initialize its storage in the host.

Refer to Inputs/Outputs vs TypeTranslation shared libraries for information on the relationship between the Job's getOutputValue() method and the convertValueToHost() method of a TypeTranslation shared library.

Was this information helpful?