Vuo
0.7.0
|
A collection of nodes and the cables connecting them.
Public Member Functions | |
VuoCompilerComposition (VuoComposition *baseComposition, VuoCompilerGraphvizParser *parser) | |
Creates a composition. | |
void | check (void) |
Checks that the composition is valid (able to be compiled). | |
void | checkForMissingNodeClasses (void) |
Checks that all of the nodes in the composition have a node class known to the compiler. | |
void | updateGenericPortTypes (void) |
Gives each group/network of connected generic ports a unique generic type. | |
set< VuoPort * > | getConnectedGenericPorts (VuoPort *port) |
Returns the set of ports that have the same innermost generic type as the given port. | |
void | createReplacementsToUnspecializePort (VuoPort *port, map< VuoNode *, string > &nodesToReplace, set< VuoCable * > &cablesToDelete) |
Outputs the composition components that would need to be modified in order to unspecialize the given port. | |
VuoNode * | getPublishedInputNode (void) |
Returns the psuedo-node that contains the published input ports, or NULL if this composition has no published input ports. | |
VuoNode * | getPublishedOutputNode (void) |
Returns the psuedo-node that contains the published output ports, or NULL if this composition has no published output ports. | |
void | setPublishedInputNode (VuoNode *node) |
Sets the psuedo-node that contains the published input ports. | |
void | setPublishedOutputNode (VuoNode *node) |
Sets the psuedo-node that contains the published output ports. | |
void | setUniqueGraphvizIdentifierForNode (VuoNode *node) |
If the given node has the same Graphviz identifier as some other node currently in the composition, or a node that was previously passed through this function, changes the given node's Graphviz identifier to one that has never been used by this composition. | |
string | getGraphvizDeclaration (string header="", string footer="") |
Returns the .vuo (Graphviz dot format) representation of this composition. | |
string | getGraphvizDeclarationForComponents (set< VuoNode * > nodeSet, set< VuoCable * > cableSet, vector< VuoPublishedPort * > publishedInputPorts, vector< VuoPublishedPort * > publishedOutputPorts, string header="", string footer="", double xPositionOffset=0, double yPositionOffset=0) |
Returns the .vuo (Graphviz dot format) representation of the given nodes and cables in this composition. | |
string | diffAgainstOlderComposition (string oldCompositionGraphvizDeclaration, VuoCompiler *compiler) |
Returns a string representation of a comparison between the old and the current composition. | |
bool | compliesWithProtocol (VuoProtocol *protocol) |
Returns true if this composition complies with the provided protocol . | |
![]() | |
VuoBaseDetail (string description, VuoComposition *base) | |
Creates a VuoComposition detail class. | |
VuoComposition * | getBase (void) const |
Returns the VuoComposition detail class instance's base class instance. | |
void | setBase (VuoComposition *base) |
Sets the VuoComposition detail class instance's base class instance. | |
Static Public Member Functions | |
static VuoCompilerComposition * | newCompositionFromGraphvizDeclaration (const string &compositionGraphvizDeclaration, VuoCompiler *compiler) |
Creates a composition from the Graphviz-formatted string representation of a composition. | |
Static Public Attributes | |
static const string | defaultGraphDeclaration = "digraph G\n" |
The default graph type and ID to be generated for new .vuo (Graphviz dot format) composition files. | |
VuoCompilerComposition::VuoCompilerComposition | ( | VuoComposition * | baseComposition, |
VuoCompilerGraphvizParser * | parser | ||
) |
Creates a composition.
If a non-null parser is provided, the composition is populated from the parser. Otherwise, the composition is empty.
void VuoCompilerComposition::check | ( | void | ) |
Checks that the composition is valid (able to be compiled).
std::runtime_error | The composition is invalid. |
void VuoCompilerComposition::checkForMissingNodeClasses | ( | void | ) |
Checks that all of the nodes in the composition have a node class known to the compiler.
std::runtime_error | One or more nodes have an unknown node class. |
bool VuoCompilerComposition::compliesWithProtocol | ( | VuoProtocol * | protocol | ) |
Returns true if this composition complies with the provided protocol
.
A composition complies with a given protocol if, for each port specified in the protocol, the composition contains a published port with a matching name and type. The composition may have additional published ports and still comply with the protocol.
void VuoCompilerComposition::createReplacementsToUnspecializePort | ( | VuoPort * | portToUnspecialize, |
map< VuoNode *, string > & | nodesToReplace, | ||
set< VuoCable * > & | cablesToDelete | ||
) |
Outputs the composition components that would need to be modified in order to unspecialize the given port.
portToUnspecialize | The port to unspecialize. |
nodesToReplace | The nodes that would need to be replaced, and the names of the less-specialized node classes that would replace them. |
cablesToDelete | The cables (including published) that would need to be removed because they would become invalid, having a generic port on one end and a non-generic port on the other end. |
string VuoCompilerComposition::diffAgainstOlderComposition | ( | string | oldCompositionGraphvizDeclaration, |
VuoCompiler * | compiler | ||
) |
Returns a string representation of a comparison between the old and the current composition.
This needs to be kept in sync with VuoRuntime function isNodeInBothCompositions().
The string representation has the JSON Patch format. The key used for each node is its Graphviz identifier. Unlike the example below (spaced for readability), the returned string contains no whitespace.
Returns the set of ports that have the same innermost generic type as the given port.
Assumes that updateGenericPortTypes() has been called since any changes affecting the groups/networks of connected generic ports have been made to the composition.
string VuoCompilerComposition::getGraphvizDeclaration | ( | string | header = "" , |
string | footer = "" |
||
) |
Returns the .vuo (Graphviz dot format) representation of this composition.
string VuoCompilerComposition::getGraphvizDeclarationForComponents | ( | set< VuoNode * > | nodeSet, |
set< VuoCable * > | cableSet, | ||
vector< VuoPublishedPort * > | publishedInputPorts, | ||
vector< VuoPublishedPort * > | publishedOutputPorts, | ||
string | header = "" , |
||
string | footer = "" , |
||
double | xPositionOffset = 0 , |
||
double | yPositionOffset = 0 |
||
) |
Returns the .vuo (Graphviz dot format) representation of the given nodes and cables in this composition.
VuoNode * VuoCompilerComposition::getPublishedInputNode | ( | void | ) |
Returns the psuedo-node that contains the published input ports, or NULL
if this composition has no published input ports.
VuoNode * VuoCompilerComposition::getPublishedOutputNode | ( | void | ) |
Returns the psuedo-node that contains the published output ports, or NULL
if this composition has no published output ports.
|
static |
Creates a composition from the Graphviz-formatted string representation of a composition.
void VuoCompilerComposition::setPublishedInputNode | ( | VuoNode * | node | ) |
Sets the psuedo-node that contains the published input ports.
void VuoCompilerComposition::setPublishedOutputNode | ( | VuoNode * | node | ) |
Sets the psuedo-node that contains the published output ports.
void VuoCompilerComposition::setUniqueGraphvizIdentifierForNode | ( | VuoNode * | node | ) |
If the given node has the same Graphviz identifier as some other node currently in the composition, or a node that was previously passed through this function, changes the given node's Graphviz identifier to one that has never been used by this composition.
void VuoCompilerComposition::updateGenericPortTypes | ( | void | ) |
Gives each group/network of connected generic ports a unique generic type.
This does not update the backing types for the generic types. Before compiling the composition, VuoCompiler::reifyGenericPortTypes() needs to be called to update them.
|
static |
The default graph type and ID to be generated for new .vuo (Graphviz dot format) composition files.