Manages runtime information associated with each node and port in the composition.
Definition at line 20 of file VuoNodeRegistry.hh.
Public Member Functions | |
VuoNodeRegistry (VuoRuntimePersistentState *persistentState) | |
Constructor. More... | |
void | updateCompositionSymbols (void *compositionBinaryHandle) |
Updates references to symbols defined in the composition's generated code. More... | |
const char * | defaultToTopLevelCompositionIdentifier (const char *compositionIdentifier) |
Returns the top-level composition identifier if compositionIdentifier is empty, otherwise compositionIdentifier. More... | |
void | addNodeMetadata (const char *compositionIdentifier, const char *nodeIdentifier, NodeContext *(*compositionCreateContextForNode)(unsigned long), void(*compositionSetPortValue)(VuoCompositionState *, const char *, const char *, bool, bool, bool, bool, bool), char *(*compositionGetPortValue)(VuoCompositionState *, const char *, int, bool), void(*compositionFireTriggerPortEvent)(VuoCompositionState *, const char *), void(*compositionReleasePortData)(void *, unsigned long)) |
Registers metadata for a node. More... | |
void | addPortMetadata (const char *compositionIdentifier, const char *portIdentifier, const char *portName, unsigned long typeIndex, const char *initialValue) |
Registers metadata for a port. More... | |
NodeContext * | getNodeContext (const char *compositionIdentifier, unsigned long nodeIndex) |
Returns the node context registered for the node index, or null if none is found. More... | |
NodeContext * | getCompositionContext (const char *compositionIdentifier) |
Returns the node context registered for the composition (top-level or subcomposition), or null if none is found. More... | |
void * | getDataForPort (const char *compositionIdentifier, const char *portIdentifier) |
Returns the data field in a port's context, given the port's identifier. More... | |
unsigned long | getNodeIndexForPort (const char *compositionIdentifier, const char *portIdentifier) |
Returns the numerical index for a node, given the identifier of a port on the node. More... | |
unsigned long | getTypeIndexForPort (const char *compositionIdentifier, const char *portIdentifier) |
Returns the numerical index for a port's type, given the port's identifier. More... | |
void | initContextForTopLevelComposition (VuoCompositionState *compositionState, bool hasInstanceData, unsigned long publishedOutputPortCount) |
Initializes a node context for the top-level composition, for each node and port in the top-level composition, and recursively for each subcomposition. More... | |
void | finiContextForTopLevelComposition (VuoCompositionState *compositionState) |
Finalizes the node context for the top-level composition, for each node and port in the top-level composition, and recursively for each subcomposition. More... | |
void | setPortValue (VuoCompositionState *compositionState, const char *portIdentifier, const char *valueAsString) |
Sets the data value of the port to valueAsString. More... | |
char * | getPortValue (VuoCompositionState *compositionState, const char *portIdentifier, bool shouldUseInterprocessSerialization) |
Returns the data value of the port. More... | |
char * | getPortSummary (VuoCompositionState *compositionState, const char *portIdentifier) |
Returns a text summary of the data value of the port. More... | |
void | fireTriggerPortEvent (VuoCompositionState *compositionState, const char *portIdentifier) |
Fires an event from the trigger port. More... | |
VuoNodeRegistry::VuoNodeRegistry | ( | VuoRuntimePersistentState * | persistentState | ) |
Constructor.
Does not take ownership of persistentState.
Definition at line 26 of file VuoNodeRegistry.cc.
void VuoNodeRegistry::addNodeMetadata | ( | const char * | compositionIdentifier, |
const char * | nodeIdentifier, | ||
NodeContext *(*)(unsigned long) | compositionCreateContextForNode, | ||
void(*)(VuoCompositionState *, const char *, const char *, bool, bool, bool, bool, bool) | compositionSetPortValue, | ||
char *(*)(VuoCompositionState *, const char *, int, bool) | compositionGetPortValue, | ||
void(*)(VuoCompositionState *, const char *) | compositionFireTriggerPortEvent, | ||
void(*)(void *, unsigned long) | compositionReleasePortData | ||
) |
Registers metadata for a node.
When a (sub)composition is added or recompiled, this function should be called for each node in the composition, in the same order as VuoCompilerBitcodeGenerator::orderedNodes
.
Definition at line 110 of file VuoNodeRegistry.cc.
void VuoNodeRegistry::addPortMetadata | ( | const char * | compositionIdentifier, |
const char * | portIdentifier, | ||
const char * | portName, | ||
unsigned long | typeIndex, | ||
const char * | initialValue | ||
) |
Registers metadata for a port.
After vuoAddNodeMetadata() is called for a node, this function should be called for each port on the node, in the same order that ports are added to NodeContext.portContexts
.
Definition at line 131 of file VuoNodeRegistry.cc.
const char * VuoNodeRegistry::defaultToTopLevelCompositionIdentifier | ( | const char * | compositionIdentifier | ) |
Returns the top-level composition identifier if compositionIdentifier is empty, otherwise compositionIdentifier.
Definition at line 54 of file VuoNodeRegistry.cc.
void VuoNodeRegistry::finiContextForTopLevelComposition | ( | VuoCompositionState * | compositionState | ) |
Finalizes the node context for the top-level composition, for each node and port in the top-level composition, and recursively for each subcomposition.
Also erases all stored node metadatas.
Definition at line 747 of file VuoNodeRegistry.cc.
void VuoNodeRegistry::fireTriggerPortEvent | ( | VuoCompositionState * | compositionState, |
const char * | portIdentifier | ||
) |
Fires an event from the trigger port.
The port is found by looking in the (sub)composition specified by compositionState for a port with the given identifier.
Definition at line 903 of file VuoNodeRegistry.cc.
NodeContext * VuoNodeRegistry::getCompositionContext | ( | const char * | compositionIdentifier | ) |
Returns the node context registered for the composition (top-level or subcomposition), or null if none is found.
Definition at line 339 of file VuoNodeRegistry.cc.
void * VuoNodeRegistry::getDataForPort | ( | const char * | compositionIdentifier, |
const char * | portIdentifier | ||
) |
Returns the data
field in a port's context, given the port's identifier.
Definition at line 368 of file VuoNodeRegistry.cc.
NodeContext * VuoNodeRegistry::getNodeContext | ( | const char * | compositionIdentifier, |
unsigned long | nodeIndex | ||
) |
Returns the node context registered for the node index, or null if none is found.
Definition at line 320 of file VuoNodeRegistry.cc.
unsigned long VuoNodeRegistry::getNodeIndexForPort | ( | const char * | compositionIdentifier, |
const char * | portIdentifier | ||
) |
Returns the numerical index for a node, given the identifier of a port on the node.
Definition at line 382 of file VuoNodeRegistry.cc.
char * VuoNodeRegistry::getPortSummary | ( | VuoCompositionState * | compositionState, |
const char * | portIdentifier | ||
) |
Returns a text summary of the data value of the port.
The port is found by looking in the (sub)composition specified by compositionState for a port with the given identifier.
Definition at line 888 of file VuoNodeRegistry.cc.
char * VuoNodeRegistry::getPortValue | ( | VuoCompositionState * | compositionState, |
const char * | portIdentifier, | ||
bool | shouldUseInterprocessSerialization | ||
) |
Returns the data value of the port.
The port is found by looking in the (sub)composition specified by compositionState for a port with the given identifier.
Definition at line 873 of file VuoNodeRegistry.cc.
unsigned long VuoNodeRegistry::getTypeIndexForPort | ( | const char * | compositionIdentifier, |
const char * | portIdentifier | ||
) |
Returns the numerical index for a port's type, given the port's identifier.
Definition at line 396 of file VuoNodeRegistry.cc.
void VuoNodeRegistry::initContextForTopLevelComposition | ( | VuoCompositionState * | compositionState, |
bool | hasInstanceData, | ||
unsigned long | publishedOutputPortCount | ||
) |
Initializes a node context for the top-level composition, for each node and port in the top-level composition, and recursively for each subcomposition.
Definition at line 603 of file VuoNodeRegistry.cc.
void VuoNodeRegistry::setPortValue | ( | VuoCompositionState * | compositionState, |
const char * | portIdentifier, | ||
const char * | valueAsString | ||
) |
Sets the data value of the port to valueAsString.
The port is found by looking in the (sub)composition specified by compositionState for a port with the given identifier.
Definition at line 858 of file VuoNodeRegistry.cc.
void VuoNodeRegistry::updateCompositionSymbols | ( | void * | compositionBinaryHandle | ) |
Updates references to symbols defined in the composition's generated code.
VuoException | One of the symbols was not found in the composition binary. |
Definition at line 37 of file VuoNodeRegistry.cc.