A plug descriptor to pass to the Registry::register_node() function.
More...
#include <PlugDescriptor.h>
|
| enum | Flags {
none = 0,
cache = 1 << 0,
time_varying = 1 << 1,
serial = 1 << 3,
graph_invisible = 1 << 8,
hidden = 1 << 8,
channel = 1 << 9,
constant = 1 << 10,
cache_exact = 1 << 11,
main = 1 << 12,
auto_connect = 1 << 13,
no_input = 1 << 15,
background = 1 << 30
} |
| |
|
| | PlugDescriptor (const char *plug_name, const Value &default_value, uint32_t flags=serial, const char *ui="") |
| | Register an input plug. More...
|
| |
| | PlugDescriptor (const char *plug_name, const Value &default_value, uint32_t flags, const char *ui, const std::function< Value(EvalContext &)> &eval_handler, const std::vector< InternalDependencies > &intern_deps, PartialInvalidationPtr(*partial_invalidation_handler)(const Plug &plug, int dep, const PartialInvalidationPtr &pi)=nullptr, bool(*dyn_evaluate)(const ConditionalEvalContext &context, int dep)=nullptr, int first_extern_deps=-1, const std::vector< ExternalDependencies > &extern_deps={}) |
| | Register an evaluated plug. More...
|
| |
A plug descriptor to pass to the Registry::register_node() function.
◆ Flags
| Enumerator |
|---|
| none | |
| cache | This plug value should be keeped in memory because it takes time to be computed.
|
| time_varying | This plug is never constant.
|
| serial | This plug value should be serialized.
|
| graph_invisible | This plug should not be visible in the graph editor.
|
| hidden | This plug should be hidden in the UI by default.
|
| channel | This plug is a channel.
|
| constant | This plug is not animable (i.e no animation curve, only constant values)
|
| cache_exact | This plug is cached with the exact value.
|
| main | This plug is always visible.
|
| auto_connect | This plug may be connected automatically when the node is dropped over a connection.
|
| no_input | This plug cannot be connected with an input.
|
| background | This plug is evaluated by the background engine.
|
◆ PlugDescriptor() [1/2]
| maquina::PlugDescriptor::PlugDescriptor |
( |
const char * |
plug_name, |
|
|
const Value & |
default_value, |
|
|
uint32_t |
flags = serial, |
|
|
const char * |
ui = "" |
|
) |
| |
|
inline |
Register an input plug.
An input plug has a value, it is serialized. It can be connected in input or output.
- Parameters
-
| plug_name | in The plug name |
| default_value | in The plug type and default value |
| flags | in A combinaison of PlugDescription::Flags flags |
| ui | in A json string with display options used by the user interface |
◆ PlugDescriptor() [2/2]
| maquina::PlugDescriptor::PlugDescriptor |
( |
const char * |
plug_name, |
|
|
const Value & |
default_value, |
|
|
uint32_t |
flags, |
|
|
const char * |
ui, |
|
|
const std::function< Value(EvalContext &)> & |
eval_handler, |
|
|
const std::vector< InternalDependencies > & |
intern_deps, |
|
|
PartialInvalidationPtr(*)(const Plug &plug, int dep, const PartialInvalidationPtr &pi) |
partial_invalidation_handler = nullptr, |
|
|
bool(*)(const ConditionalEvalContext &context, int dep) |
dyn_evaluate = nullptr, |
|
|
int |
first_extern_deps = -1, |
|
|
const std::vector< ExternalDependencies > & |
extern_deps = {} |
|
) |
| |
|
inline |
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 | in The plug name |
| default_value | in The plug type and default value |
| flags | in A combinaison of PlugDescription::Flags flags |
| ui | 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 | 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 | in index of the first external dependency |
| extern_deps | in The external dependencies description |
◆ _default_value
| Value maquina::PlugDescriptor::_default_value |
◆ _dyn_evaluate
◆ _eval_handler
◆ _extern_deps
◆ _first_extern_deps
| int maquina::PlugDescriptor::_first_extern_deps = -1 |
◆ _flags
| uint32_t maquina::PlugDescriptor::_flags = 0 |
◆ _has_conditional_evaluation
| bool maquina::PlugDescriptor::_has_conditional_evaluation = false |
◆ _intern_deps
◆ _partial_invalidation_handler
◆ _plug_name
| std::string maquina::PlugDescriptor::_plug_name |
◆ _ui
| std::string maquina::PlugDescriptor::_ui |
The documentation for this class was generated from the following file: