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

Description

Facilitates communication between open subcompositions and open compositions that contain instances of them.

Definition at line 20 of file VuoSubcompositionMessageRouter.hh.

Public Types

typedef void(^ CompositionCallback) (VuoEditorComposition *)
 Callbacks. More...
 
typedef void(^ CompositionCallbackWithIdentifier) (VuoEditorComposition *, string)
 Callbacks. More...
 
typedef void(^ CompositionCallbackWithPath) (VuoEditorComposition *, string)
 Callbacks. More...
 

Public Member Functions

 VuoSubcompositionMessageRouter (void)
 Creates a new message router with no compositions registered yet. More...
 
 ~VuoSubcompositionMessageRouter (void)
 Destructor. More...
 
void addComposition (VuoEditorWindow *window)
 Registers the composition in the message router, so that it can start sending and receiving messages. More...
 
void removeComposition (VuoEditorWindow *window)
 Unregisters the composition, so that it can no longer send or receive messages. More...
 
void linkSubcompositionToNodeInSupercomposition (VuoEditorComposition *subcompositionInstance, VuoEditorComposition *supercomposition, VuoRendererNode *nodeInSupercomposition)
 Informs the message router that subcompositionInstance corresponds to nodeInSupercomposition in supercomposition, so that messages can be routed up and down the composition hierarchy. More...
 
void unlinkSubcompositionFromNodeInSupercomposition (VuoEditorComposition *subcompositionInstance)
 Dissociates this subcomposition from the node in the supercomposition that it was previously linked to (if any), changing the subcomposition back to a top-lvel composition as far as message routing is concerned. More...
 
void unlinkNodeInSupercompositionFromSubcomposition (VuoEditorComposition *supercomposition, const string &nodeIdentifier)
 Dissociates this node in the supercomposition from the subcomposition that it was previously linked to (if any), changing the subcomposition back to a top-lvel composition as far as message routing is concerned. More...
 
void relinkNodeInSupercompositionToSubcomposition (VuoEditorComposition *supercomposition, const string &nodeIdentifier)
 Undoes the most recent call to unlinkNodeInSupercompositionFromSubcomposition for this supercomposition and node, re-associating the subcomposition that was previously linked to them (if any), unless that subcomposition has already been removed. More...
 
string getCompositionIdentifier (VuoEditorComposition *composition)
 Returns the composition identifier of composition if it has been registered with addComposition and, if a subcomposition, recorded as part of a composition hierarchy by linkSubcompositionToNodeInSupercomposition; otherwise, an empty string. More...
 
void applyToLinkedTopLevelComposition (VuoEditorComposition *currComposition, CompositionCallbackWithIdentifier doForComposition)
 Calls doForComposition for the top-level composition associated with currComposition, which is either currComposition itself or in the composition hierarchy established by linkSubcompositionToNodeInSupercomposition. More...
 
void applyToLinkedCompositionWithIdentifier (VuoEditorComposition *currComposition, string compositionIdentifier, CompositionCallback doForComposition)
 Calls doForComposition for the composition associated with currComposition, in the hierarchy established by linkSubcompositionToNodeInSupercomposition, whose composition identifier is compositionIdentifier (if any). More...
 
void applyToAllLinkedCompositions (VuoEditorComposition *currComposition, CompositionCallbackWithIdentifier doForComposition)
 Calls doForComposition for currComposition and all compositions associated with it in the hierarchy established by linkSubcompositionToNodeInSupercomposition. More...
 
void applyToAllOtherTopLevelCompositions (VuoEditorComposition *currComposition, CompositionCallback doForComposition)
 Calls doForComposition for all top-level compositions that have been registered with addComposition except for currComposition. More...
 
void applyIfInstalledAsSubcomposition (VuoEditorComposition *currComposition, CompositionCallbackWithPath doForComposition)
 Calls doForComposition for currComposition if it is installed as a subcomposition. More...
 
void applyToAllOtherCompositionsInstalledAsSubcompositions (VuoEditorComposition *currComposition, CompositionCallbackWithPath doForComposition)
 Calls doForComposition for all compositions that have been registered with addComposition and are installed as subcompositions, except for currComposition. More...
 

Member Typedef Documentation

◆ CompositionCallback

typedef void(^ VuoSubcompositionMessageRouter::CompositionCallback) (VuoEditorComposition *)

Callbacks.

Definition at line 35 of file VuoSubcompositionMessageRouter.hh.

◆ CompositionCallbackWithIdentifier

typedef void(^ VuoSubcompositionMessageRouter::CompositionCallbackWithIdentifier) (VuoEditorComposition *, string)

Callbacks.

Definition at line 36 of file VuoSubcompositionMessageRouter.hh.

◆ CompositionCallbackWithPath

typedef void(^ VuoSubcompositionMessageRouter::CompositionCallbackWithPath) (VuoEditorComposition *, string)

Callbacks.

Definition at line 37 of file VuoSubcompositionMessageRouter.hh.

Constructor & Destructor Documentation

◆ VuoSubcompositionMessageRouter()

VuoSubcompositionMessageRouter::VuoSubcompositionMessageRouter ( void  )

Creates a new message router with no compositions registered yet.

Definition at line 55 of file VuoSubcompositionMessageRouter.cc.

◆ ~VuoSubcompositionMessageRouter()

VuoSubcompositionMessageRouter::~VuoSubcompositionMessageRouter ( void  )

Destructor.

Waits for any member functions in progress on other threads to complete.

Definition at line 62 of file VuoSubcompositionMessageRouter.cc.

Member Function Documentation

◆ addComposition()

void VuoSubcompositionMessageRouter::addComposition ( VuoEditorWindow window)

Registers the composition in the message router, so that it can start sending and receiving messages.

The composition is registered as a top-level composition, not yet associated with any supercomposition or subcompositions.

Definition at line 74 of file VuoSubcompositionMessageRouter.cc.

◆ applyIfInstalledAsSubcomposition()

void VuoSubcompositionMessageRouter::applyIfInstalledAsSubcomposition ( VuoEditorComposition currComposition,
CompositionCallbackWithPath  doForComposition 
)

Calls doForComposition for currComposition if it is installed as a subcomposition.

currComposition and its file path are passed to doForComposition.

Definition at line 296 of file VuoSubcompositionMessageRouter.cc.

◆ applyToAllLinkedCompositions()

void VuoSubcompositionMessageRouter::applyToAllLinkedCompositions ( VuoEditorComposition currComposition,
CompositionCallbackWithIdentifier  doForComposition 
)

Calls doForComposition for currComposition and all compositions associated with it in the hierarchy established by linkSubcompositionToNodeInSupercomposition.

Each composition in the hierarchy and its composition identifier are passed to doForComposition.

Definition at line 259 of file VuoSubcompositionMessageRouter.cc.

◆ applyToAllOtherCompositionsInstalledAsSubcompositions()

void VuoSubcompositionMessageRouter::applyToAllOtherCompositionsInstalledAsSubcompositions ( VuoEditorComposition currComposition,
CompositionCallbackWithPath  doForComposition 
)

Calls doForComposition for all compositions that have been registered with addComposition and are installed as subcompositions, except for currComposition.

Each composition and its file path are passed to doForComposition.

Definition at line 318 of file VuoSubcompositionMessageRouter.cc.

◆ applyToAllOtherTopLevelCompositions()

void VuoSubcompositionMessageRouter::applyToAllOtherTopLevelCompositions ( VuoEditorComposition currComposition,
CompositionCallback  doForComposition 
)

Calls doForComposition for all top-level compositions that have been registered with addComposition except for currComposition.

Each top-level composition is passed to doForComposition.

Definition at line 279 of file VuoSubcompositionMessageRouter.cc.

◆ applyToLinkedCompositionWithIdentifier()

void VuoSubcompositionMessageRouter::applyToLinkedCompositionWithIdentifier ( VuoEditorComposition currComposition,
string  compositionIdentifier,
CompositionCallback  doForComposition 
)

Calls doForComposition for the composition associated with currComposition, in the hierarchy established by linkSubcompositionToNodeInSupercomposition, whose composition identifier is compositionIdentifier (if any).

The composition whose identifier is compositionIdentifier is passed to doForComposition.

Definition at line 238 of file VuoSubcompositionMessageRouter.cc.

◆ applyToLinkedTopLevelComposition()

void VuoSubcompositionMessageRouter::applyToLinkedTopLevelComposition ( VuoEditorComposition currComposition,
CompositionCallbackWithIdentifier  doForComposition 
)

Calls doForComposition for the top-level composition associated with currComposition, which is either currComposition itself or in the composition hierarchy established by linkSubcompositionToNodeInSupercomposition.

The top-level composition and currComposition's composition identifier are passed to doForComposition.

Definition at line 220 of file VuoSubcompositionMessageRouter.cc.

◆ getCompositionIdentifier()

string VuoSubcompositionMessageRouter::getCompositionIdentifier ( VuoEditorComposition composition)

Returns the composition identifier of composition if it has been registered with addComposition and, if a subcomposition, recorded as part of a composition hierarchy by linkSubcompositionToNodeInSupercomposition; otherwise, an empty string.

Definition at line 200 of file VuoSubcompositionMessageRouter.cc.

◆ linkSubcompositionToNodeInSupercomposition()

void VuoSubcompositionMessageRouter::linkSubcompositionToNodeInSupercomposition ( VuoEditorComposition subcompositionInstance,
VuoEditorComposition supercomposition,
VuoRendererNode nodeInSupercomposition 
)

Informs the message router that subcompositionInstance corresponds to nodeInSupercomposition in supercomposition, so that messages can be routed up and down the composition hierarchy.

Definition at line 109 of file VuoSubcompositionMessageRouter.cc.

◆ relinkNodeInSupercompositionToSubcomposition()

void VuoSubcompositionMessageRouter::relinkNodeInSupercompositionToSubcomposition ( VuoEditorComposition supercomposition,
const string &  nodeIdentifier 
)

Undoes the most recent call to unlinkNodeInSupercompositionFromSubcomposition for this supercomposition and node, re-associating the subcomposition that was previously linked to them (if any), unless that subcomposition has already been removed.

Definition at line 177 of file VuoSubcompositionMessageRouter.cc.

◆ removeComposition()

void VuoSubcompositionMessageRouter::removeComposition ( VuoEditorWindow window)

Unregisters the composition, so that it can no longer send or receive messages.

Definition at line 86 of file VuoSubcompositionMessageRouter.cc.

◆ unlinkNodeInSupercompositionFromSubcomposition()

void VuoSubcompositionMessageRouter::unlinkNodeInSupercompositionFromSubcomposition ( VuoEditorComposition supercomposition,
const string &  nodeIdentifier 
)

Dissociates this node in the supercomposition from the subcomposition that it was previously linked to (if any), changing the subcomposition back to a top-lvel composition as far as message routing is concerned.

Definition at line 155 of file VuoSubcompositionMessageRouter.cc.

◆ unlinkSubcompositionFromNodeInSupercomposition()

void VuoSubcompositionMessageRouter::unlinkSubcompositionFromNodeInSupercomposition ( VuoEditorComposition subcompositionInstance)

Dissociates this subcomposition from the node in the supercomposition that it was previously linked to (if any), changing the subcomposition back to a top-lvel composition as far as message routing is concerned.

Definition at line 136 of file VuoSubcompositionMessageRouter.cc.


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