Vuo  2.0.0
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...
 
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. 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 25 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 109 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 130 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 53 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 758 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 905 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 337 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 366 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 318 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 394 of file VuoNodeRegistry.cc.

◆ getNodeSemaphoreForPort()

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.

Definition at line 380 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 893 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 881 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 408 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 640 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 869 of file VuoNodeRegistry.cc.

◆ updateCompositionSymbols()

void VuoNodeRegistry::updateCompositionSymbols ( void *  compositionBinaryHandle)

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

Exceptions
std::runtime_errorOne of the symbols was not found in the composition binary.

Definition at line 36 of file VuoNodeRegistry.cc.


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