PlugDescriptor

Inheritance diagram of rumba.PlugDescriptor
class PlugDescriptor

A plug descriptor to pass to the Registry::register_node() function.

Methods

__init__

Constructor(s)

class InternalDependencies

A plug internal dependency descriptor.

__init__()
__init__()

Constructor(s)

PlugDescriptor (plug_name: unicode,default_value: Value,flags: int,ui: unicode)

Register an input plug.

An input plug has a value, it is serialized. It can be connected in input or output.

Parameters
  • plug_name (unicode) - in The plug name

  • default_value (Value) - in The plug type and default value

  • flags (int) - in A combinaison of PlugDescription::Flags flags

  • ui (unicode) - in A json string with display options used by the user interface

PlugDescriptor (plug_name: unicode,default_value: Value,flags: int,ui: unicode,eval_handler,intern_deps: list(InternalDependencies),partial_invalidation_handler,dyn_evaluate,first_extern_deps: int,extern_deps: list(ExternalDependencies))

Register an evaluated plug.

An evaluated plug computes a value using a function, the eval handler. The plug has dependencies to compute the value. The dependencies can be internal or external. It’s output can be connected to other plugs.

The internal dependencies are registered, they are not serialized.

The external dependencies connections are serialized. They are organized as an array of structure. Each element of the structure have a name, a type and a default value. The structure can be repeated in an array.

Parameters
  • plug_name (unicode) - in The plug name

  • default_value (Value) - in The plug type and default value

  • flags (int) - in A combinaison of PlugDescription::Flags flags

  • ui (unicode) - in A json string with display options used by the user interface

  • eval_handler - in The evaluation handler to compute the plug value

  • intern_deps (list(InternalDependencies)) - in The external dependencies description

  • partial_invalidation_handler - in The evaluation handler to compute the PartialInvalidation, if required

  • dyn_evaluate - in An optional function to tell if the plug’s dynamic dependencies must be evaluated. If the function returns true (default), the dynamic dependency is computed and is valid during the plug’s evaluation. If the function returns false, the dynamic dependency is not computed and no value is passed to the plug’s evaluation function. That dependence value is invalid and shall not be requested. The context object can be used to get information about the current plug evaluation.

  • first_extern_deps (int) - in index of the first external dependency

  • extern_deps (list(ExternalDependencies)) - in The external dependencies description