Class GraphExecutionState

The GraphExecutionState class contains persistent state for the graph. Nodes that subclass ControlFlowNodeBase inject their data into the state upon execution and return the corresponding values when the pin data is requested.

Hierarchy (view full)

Constructors

Properties

_executionCache: Map<GraphPin, GraphStateValue>
_executionCacheTargetUUID: bigint
_inputVariableData: Map<bigint, GraphStateValue>
_nodeValues: WeakMap<GraphNode, GraphStateValue>
_pinValues: WeakMap<GraphPin, GraphStateValue>
_variableValues: WeakMap<GraphVariable, GraphStateValue>
eventSubscribers: Map<Function, (() => void)>

A set of all active event subscribers. Must be cleaned up when the graph finishes execution.

Methods

  • Returns void

  • Gets the cached value for the specified output pin.

    Parameters

    • pin: GraphPin

      The pin to retrieve the pin for.

    Returns any

  • Gets a previously inserted value for the node.

    Parameters

    Returns any

  • Gets a previously inserted value for the pin.

    Parameters

    Returns any

  • Gets the input value for the specified variable, if not specified, the default value is returned.

    Parameters

    Returns any

  • Sets the next node to be executed.

    Parameters

    Returns void

    This is an important call to optimize the execution of expression trees. Values and nodes that are visited multiple times from the same node will require full evaluation of the tree until the lowest level, unless this function is called to mark the current node as executing. It allows the graph system to cache all retrieves values and each expression must only be visited once.

  • Sets the value for the node.

    Parameters

    Returns void

  • Sets the value for the pin.

    Parameters

    Returns void

  • Gets the input value for the specified variable, if not specified, the default value is returned.

    Parameters

    Returns void