Vuo
1.2.6
|
Manages runtime information associated with each node and port in the composition.
Public Member Functions | |
VuoNodeRegistry (VuoRuntimePersistentState *persistentState) | |
Constructor. | |
void | updateCompositionSymbols (void *compositionBinaryHandle) |
Updates references to symbols defined in the composition's generated code. | |
void | addNodeMetadata (const char *compositionIdentifier, const char *nodeIdentifier) |
Registers metadata for a node. | |
void | addPortMetadata (const char *compositionIdentifier, const char *portIdentifier, const char *portName, unsigned long typeIndex, const char *initialValue) |
Registers metadata for a port. | |
NodeContext * | getNodeContext (const char *compositionIdentifier, unsigned long nodeIndex) |
Returns the node context registered for the node index, or null if none is found. | |
NodeContext * | getCompositionContext (const char *compositionIdentifier) |
Returns the node context registered for the composition (top-level or subcomposition), or null if none is found. | |
void * | getDataForPort (const char *compositionIdentifier, const char *portIdentifier) |
Returns the data field in a port's context, given the port's identifier. | |
dispatch_semaphore_t | getNodeSemaphoreForPort (const char *compositionIdentifier, const char *portIdentifier) |
Returns the semaphore field in a node's context, given the identifier of a port on the node. | |
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. | |
unsigned long | getTypeIndexForPort (const char *compositionIdentifier, const char *portIdentifier) |
Returns the numerical index for a port's type, given the port's identifier. | |
NodeContext * | compositionContextInitHelper (VuoCompositionState *compositionState, bool hasInstanceData, unsigned long publishedOutputPortCount, NodeContext *(*compositionCreateNodeContext)(VuoCompositionState *, unsigned long), void(*compositionDestroyNodeContext)(VuoCompositionState *, const char *, NodeContext *), void(*compositionSetPortValue)(VuoCompositionState *, const char *, const char *, bool, bool, bool, bool, bool)) |
Helper function for compositionContextInit() . | |
void | compositionContextFiniHelper (VuoCompositionState *compositionState, void(*compositionDestroyNodeContext)(VuoCompositionState *, const char *, NodeContext *), void(*compositionReleasePortData)(void *, unsigned long)) |
Helper function for compositionContextFini() . | |
VuoNodeRegistry::VuoNodeRegistry | ( | VuoRuntimePersistentState * | persistentState | ) |
Constructor.
Does not take ownership of persistentState.
void VuoNodeRegistry::addNodeMetadata | ( | const char * | compositionIdentifier, |
const char * | nodeIdentifier | ||
) |
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
.
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
.
void VuoNodeRegistry::compositionContextFiniHelper | ( | VuoCompositionState * | compositionState, |
void(*)(VuoCompositionState *, const char *, NodeContext *) | compositionDestroyNodeContext, | ||
void(*)(void *, unsigned long) | compositionReleasePortData | ||
) |
Helper function for compositionContextFini()
.
If the composition contains subcomposition nodes, this function calls each subcomposition's compositionContextFini()
.
NodeContext * VuoNodeRegistry::compositionContextInitHelper | ( | VuoCompositionState * | compositionState, |
bool | hasInstanceData, | ||
unsigned long | publishedOutputPortCount, | ||
NodeContext *(*)(VuoCompositionState *, unsigned long) | compositionCreateNodeContext, | ||
void(*)(VuoCompositionState *, const char *, NodeContext *) | compositionDestroyNodeContext, | ||
void(*)(VuoCompositionState *, const char *, const char *, bool, bool, bool, bool, bool) | compositionSetPortValue | ||
) |
Helper function for compositionContextInit()
.
If the composition contains subcomposition nodes, this function calls each subcomposition's compositionContextInit()
.
NodeContext * VuoNodeRegistry::getCompositionContext | ( | const char * | compositionIdentifier | ) |
Returns the node context registered for the composition (top-level or subcomposition), or null if none is found.
void * VuoNodeRegistry::getDataForPort | ( | const char * | compositionIdentifier, |
const char * | portIdentifier | ||
) |
Returns the data
field in a port's context, given the port's identifier.
NodeContext * VuoNodeRegistry::getNodeContext | ( | const char * | compositionIdentifier, |
unsigned long | nodeIndex | ||
) |
Returns the node context registered for the node index, or null if none is found.
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.
dispatch_semaphore_t VuoNodeRegistry::getNodeSemaphoreForPort | ( | const char * | compositionIdentifier, |
const char * | portIdentifier | ||
) |
Returns the semaphore
field in a node's context, given the identifier of a port on the node.
unsigned long VuoNodeRegistry::getTypeIndexForPort | ( | const char * | compositionIdentifier, |
const char * | portIdentifier | ||
) |
Returns the numerical index for a port's type, given the port's identifier.
void VuoNodeRegistry::updateCompositionSymbols | ( | void * | compositionBinaryHandle | ) |
Updates references to symbols defined in the composition's generated code.
std::runtime_error | One of the symbols was not found in the composition binary. |