Class CodeGeneratingGraphNodeAbstract Hidden Children

The CodeGeneratingGraphNode implements a GraphNode that emits code when visited.

Hierarchy (view full)

Constructors

Accessors

  • get customName(): string
  • The custom name for the node.

    Returns string

    By default, names should be inferred from the GraphNodeReflection data. Only set this field if the name cannot or should not be inferred from reflection data.

  • set customName(value): void
  • Parameters

    • value: string

    Returns void

  • get id(): UUID
  • The ID.

    Returns UUID

  • get inputPins(): GraphPin[]
  • The input pins.

    Returns GraphPin[]

  • get isCustomInvocationRequired(): boolean
  • Virtual

    To enable custom invocation for your Graph during code generation this function must return true.

    Returns boolean

    true if your class implemented a custom invocation.

  • get isEmittingBodyCode(): boolean
  • Virtual

    Determines if the Graph is being invoked during code generation to emit it's function body. If this function returns false emitCode will not be invoked.

    Returns boolean

    true if your class generates code or false if only an invocation is required.

  • get outputPins(): GraphPin[]
  • The output pins.

    Returns GraphPin[]

  • get userData(): Map<string, any>
  • A map suitable for storing custom user-defined data.

    Returns Map<string, any>

Methods

  • Removes all connections to this node.

    Returns void

  • Virtual

    This function emits the graph's function header and body.

    Parameters

    Returns void

  • Virtual

    Graph function invocation during code generation follows language specified rules. Typically a method is being invoked in c-style. This can require emitting temporaries and other variables. In certain cases Graphs might have to override the nvocation model to implement specific behavior.

    Implement this function in your child class to fully control the code generation for your Graph. To enable your custom invocation during code generation override isCustomInvocationRequired to return true.

    Parameters

    Returns void

    Context type specific behavior must be implemented by the developer.

  • Enables the node and its pins in the specified graph.

    Parameters

    Returns void

  • Gets a pin that supports a connection to (or from) the otherPin.

    Parameters

    • otherPin: GraphPin

      The pin to find a compatible pin for.

    Returns GraphPin

    The first pin that matches the connection criteria.

    The orientation of the test depends on the type of the otherPin. The input pin denotes the type that must be supported by the output pin in the form

    	`outputPin isSubclassOf inputPin`
    
  • Gets the value for the specified user data key. If the key does not exist the defaultValue will be returned instead. If no defaultValue is specified, undefined is returned.

    Type Parameters

    • T

    Parameters

    • node: GraphNode
    • key: string

      A key that uniquely identifies the property to be fetched.

    • OptionaldefaultValue: T

      The default value, to be returned in case the property is not defined.

    Returns T

    The user defined property or defaultValue if not defined.

  • Iterates all connections to pins of this node. First input pins are iterated over, then output pins.

    Returns Generator<GraphPin, any, any>

  • Called when the node has been instanced and is about to be added to a graph. This is a good place to initialize the default values for the node pins as it will then not be done during deserialization, which might otherwise discard newly instances values immediately.

    Returns void

  • Emits the invocation for the node.

    Parameters

    Returns void

    The symbol name.

    If temporaries are invloved, the temporary symbol will be emitted instead.

  • Virtual

    Emits the invocation for the node.

    Parameters

    Returns void

    The symbol name.

  • Virtual

    Emits the code.

    Parameters

    Returns void

    The symbol name.

  • Called before the node is removed from a graph.

    Returns void

  • Virtual

    Visits the node during code generation to determine if temporaries are required.

    Parameters

    Returns void

  • Virtual

    Visits the node's input pins during code generation to determine if temporaries are required.

    Parameters

    Returns void

  • Removes the user data key.

    Parameters

    • key: string

    Returns void

  • Sets the user data key to the specified value.

    Type Parameters

    • T

    Parameters

    • key: string

      A key that uniquely identifies the property to be defined.

    • value: T

      The value to set the property to. The value type must support serialization.

    Returns void

  • Synchronizes the node pins with the reflection data by adding missing pins and removing superfluous pins on the node.

    Returns void

  • Returns a string representation of an object.

    Returns string

  • Virtual

    Ensures that the state of the node is valid.

    Parameters

    Returns GraphValidationStatus

    Implementing classes must call super. The method is typically called after deserialization or major edits to the graph. If validation fails, error information must be added to the validationStatus map.

  • Invokes the callback while prevent events to be dispatched.

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

Events

onDirty: Event<[EnumValueTyped<GraphNodeDirtyFlags, number>], void>

An event when the node is dirtied.