Vuo  2.3.2
Classes | Public Member Functions | List of all members
VuoNodeRegistry Class Reference

Description

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...
 
NodeContextgetNodeContext (const char *compositionIdentifier, unsigned long nodeIndex)
 Returns the node context registered for the node index, or null if none is found. More...
 
NodeContextgetCompositionContext (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...
 

Constructor & Destructor Documentation

◆ VuoNodeRegistry()

VuoNodeRegistry::VuoNodeRegistry ( VuoRuntimePersistentState persistentState)

Constructor.

Does not take ownership of persistentState.

Definition at line 26 of file VuoNodeRegistry.cc.

Member Function Documentation

◆ addNodeMetadata()

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.

Changed in Vuo 2.0.0:
Added callback arguments.

Definition at line 110 of file VuoNodeRegistry.cc.

◆ addPortMetadata()

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.

◆ defaultToTopLevelCompositionIdentifier()

const char * VuoNodeRegistry::defaultToTopLevelCompositionIdentifier ( const char *  compositionIdentifier)

Returns the top-level composition identifier if compositionIdentifier is empty, otherwise compositionIdentifier.

Changed in Vuo 2.0.0:
New.

Definition at line 54 of file VuoNodeRegistry.cc.

◆ finiContextForTopLevelComposition()

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.

Changed in Vuo 2.0.0:
New.

Definition at line 747 of file VuoNodeRegistry.cc.

◆ fireTriggerPortEvent()

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.

Changed in Vuo 2.0.0:
New.

Definition at line 903 of file VuoNodeRegistry.cc.

◆ getCompositionContext()

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.

◆ getDataForPort()

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.

◆ getNodeContext()

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.

◆ getNodeIndexForPort()

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.

◆ getPortSummary()

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.

Changed in Vuo 2.0.0:
New.

Definition at line 888 of file VuoNodeRegistry.cc.

◆ getPortValue()

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.

Changed in Vuo 2.0.0:
New.

Definition at line 873 of file VuoNodeRegistry.cc.

◆ getTypeIndexForPort()

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.

◆ initContextForTopLevelComposition()

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.

Changed in Vuo 2.0.0:
New.

Definition at line 603 of file VuoNodeRegistry.cc.

◆ setPortValue()

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.

Changed in Vuo 2.0.0:
New.

Definition at line 858 of file VuoNodeRegistry.cc.

◆ updateCompositionSymbols()

void VuoNodeRegistry::updateCompositionSymbols ( void *  compositionBinaryHandle)

Updates references to symbols defined in the composition's generated code.

Exceptions
VuoExceptionOne of the symbols was not found in the composition binary.

Definition at line 37 of file VuoNodeRegistry.cc.


The documentation for this class was generated from the following files: