A collection of nodes and the cables connecting them.
Definition at line 34 of file VuoCompilerComposition.hh.
Public Member Functions | |
VuoCompilerComposition (VuoComposition *baseComposition, VuoCompilerGraphvizParser *parser) | |
Creates a composition. More... | |
~VuoCompilerComposition (void) | |
Destructor. More... | |
void | getChangesToReplaceNode (VuoNode *oldNode, VuoNode *newNode, map< VuoCable *, VuoPort * > &cablesToTransferFromPort, map< VuoCable *, VuoPort * > &cablesToTransferToPort, set< VuoCable * > &cablesToRemove) const |
Outputs the modifications to cables that would be made by VuoCompilerComposition::replaceNode without actually modifying anything. More... | |
void | replaceNode (VuoNode *oldNode, VuoNode *newNode) |
Replaces oldNode with newNode in the composition, transferring all cable and published port connections from oldNode to newNode where port names and data types correspond, and severing the rest. More... | |
VuoCompilerGraph * | getCachedGraph (VuoCompiler *compiler=nullptr) |
Returns the graph for this composition, using the most recently generated graph if it still applies. More... | |
void | invalidateCachedGraph (void) |
Indicates that the most recently generated graph for this composition no longer applies. More... | |
void | check (VuoCompilerIssues *issues) |
Checks that the composition is valid (able to be compiled). More... | |
void | checkForMissingNodeClasses (VuoCompilerIssues *issues) |
Checks that all of the nodes in the composition have a node class known to the compiler. More... | |
void | checkForEventFlowIssues (VuoCompilerIssues *issues) |
Checks that the event flow in the composition is valid. More... | |
void | checkForEventFlowIssues (set< VuoCompilerCable * > potentialCables, VuoCompilerIssues *issues) |
Checks that the event flow in the composition is valid. More... | |
void | updateGenericPortTypes (void) |
Gives each group/network of connected generic ports a unique generic type. More... | |
set< VuoPort * > | getCorrelatedGenericPorts (VuoNode *entryNode, VuoPort *entryPort, bool useOriginalType) |
Returns the set of ports that have the same innermost generic type as entryPort. More... | |
VuoPort * | findNearestUpstreamTriggerPort (VuoNode *node) |
Returns the trigger port that is nearest upstream to node, or null if no trigger is upstream. More... | |
void | setModule (Module *module) |
Takes ownership of the LLVM module containing the compiled composition. More... | |
Module * | takeModule (void) |
Relinquishes ownership of the LLVM module previously passed to setModule. More... | |
void | setUniqueGraphvizIdentifierForNode (VuoNode *node, const string &preferredIdentifier="", const string &identifierPrefix="") |
If the given node has the same Graphviz identifier as another node currently in the composition, a node that was in the composition when it was originally parsed from Graphviz, 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. More... | |
void | clearGraphvizNodeIdentifierHistory () |
Clears the map containing the records of previously used Graphviz node identifiers. More... | |
void | setUniqueGraphvizIdentifierForComment (VuoComment *comment) |
If the given comment has the same Graphviz identifier as another comment currently in the composition, a comment that was in the composition when it was originally parsed from Graphviz, or a comment that was previously passed through this function, changes the given comment's Graphviz identifier to one that has never been used by this composition. More... | |
void | clearGraphvizCommentIdentifierHistory () |
Clears the map containing the records of previously used Graphviz comment identifiers. More... | |
void | setManuallyFirableInputPort (VuoNode *nodeContainingPort, VuoPort *portFiredInto) |
Selects the input port into which a hidden trigger port can fire events on demand. More... | |
VuoNode * | getManuallyFirableInputNode (void) |
Returns the node most recently set by VuoCompilerComposition::setManuallyFirableInputPort(). More... | |
VuoPort * | getManuallyFirableInputPort (void) |
Returns the input port most recently set by VuoCompilerComposition::setManuallyFirableInputPort(). More... | |
string | getGraphvizDeclaration (VuoProtocol *activeProtocol=NULL, string header="", string footer="") |
Returns the .vuo (Graphviz dot format) representation of this composition. More... | |
string | getGraphvizDeclarationForComponents (set< VuoNode * > nodeSet, set< VuoCable * > cableSet, set< VuoComment * > commentSet, 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. More... | |
VuoCompilerTargetSet | getCompatibleTargets (void) |
Returns the set of targets (operating system versions) with which this composition is compatible. More... | |
Public Member Functions inherited from VuoBaseDetail< VuoComposition > | |
VuoBaseDetail (string description, VuoComposition *base) | |
Creates a detail class. More... | |
VuoComposition * | getBase (void) const |
Returns the detail class instance's base class instance. More... | |
void | setBase (VuoComposition *base) |
Sets the detail class instance's base class instance. More... | |
Static Public Member Functions | |
static VuoCompilerComposition * | newCompositionFromGraphvizDeclaration (const string &compositionGraphvizDeclaration, VuoCompiler *compiler) |
Creates a composition from the Graphviz-formatted string representation of a composition. More... | |
static bool | portsMatch (VuoPort *oldPort, VuoPort *newPort) |
Returns true if a port on an old node corresponds to a port on a new node replacing the old one (same name, same data type). More... | |
static bool | portClassesMatch (VuoPortClass *oldPortClass, VuoPortClass *newPortClass) |
Returns true if a port on an old node class corresponds to a port on a new node class replacing the old one (same name, same data type). More... | |
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. More... | |
static const string | topLevelCompositionIdentifier = "Top" |
The key of the top-level composition when looking up node contexts. More... | |
Friends | |
class | TestCompilingAndLinking |
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.
Definition at line 40 of file VuoCompilerComposition.cc.
VuoCompilerComposition::~VuoCompilerComposition | ( | void | ) |
Destructor.
Definition at line 89 of file VuoCompilerComposition.cc.
void VuoCompilerComposition::check | ( | VuoCompilerIssues * | issues | ) |
Checks that the composition is valid (able to be compiled).
issues | Any issues found are appended to this. |
VuoCompilerException | The composition is invalid. |
Definition at line 227 of file VuoCompilerComposition.cc.
void VuoCompilerComposition::checkForEventFlowIssues | ( | set< VuoCompilerCable * > | potentialCables, |
VuoCompilerIssues * | issues | ||
) |
Checks that the event flow in the composition is valid.
potentialCables | Cables that are not yet in the composition but should be included in the check. |
issues | Any issues found are appended to this. |
VuoCompilerException | There is an infinite or deadlocked feedback loop. |
Definition at line 381 of file VuoCompilerComposition.cc.
void VuoCompilerComposition::checkForEventFlowIssues | ( | VuoCompilerIssues * | issues | ) |
Checks that the event flow in the composition is valid.
issues | Any issues found are appended to this. |
VuoCompilerException | There is an infinite or deadlocked feedback loop. |
Definition at line 369 of file VuoCompilerComposition.cc.
void VuoCompilerComposition::checkForMissingNodeClasses | ( | VuoCompilerIssues * | issues | ) |
Checks that all of the nodes in the composition have a node class known to the compiler.
issues | Any issues found are appended to this. |
VuoCompilerException | One or more nodes have an unknown node class. |
Definition at line 240 of file VuoCompilerComposition.cc.
void VuoCompilerComposition::clearGraphvizCommentIdentifierHistory | ( | ) |
Clears the map containing the records of previously used Graphviz comment identifiers.
Definition at line 820 of file VuoCompilerComposition.cc.
void VuoCompilerComposition::clearGraphvizNodeIdentifierHistory | ( | ) |
Clears the map containing the records of previously used Graphviz node identifiers.
Definition at line 781 of file VuoCompilerComposition.cc.
Returns the trigger port that is nearest upstream to node, or null if no trigger is upstream.
Definition at line 720 of file VuoCompilerComposition.cc.
VuoCompilerGraph * VuoCompilerComposition::getCachedGraph | ( | VuoCompiler * | compiler = nullptr | ) |
Returns the graph for this composition, using the most recently generated graph if it still applies.
Definition at line 188 of file VuoCompilerComposition.cc.
void VuoCompilerComposition::getChangesToReplaceNode | ( | VuoNode * | oldNode, |
VuoNode * | newNode, | ||
map< VuoCable *, VuoPort * > & | cablesToTransferFromPort, | ||
map< VuoCable *, VuoPort * > & | cablesToTransferToPort, | ||
set< VuoCable * > & | cablesToRemove | ||
) | const |
Outputs the modifications to cables that would be made by VuoCompilerComposition::replaceNode without actually modifying anything.
Definition at line 112 of file VuoCompilerComposition.cc.
VuoCompilerTargetSet VuoCompilerComposition::getCompatibleTargets | ( | void | ) |
Returns the set of targets (operating system versions) with which this composition is compatible.
Definition at line 978 of file VuoCompilerComposition.cc.
set< VuoPort * > VuoCompilerComposition::getCorrelatedGenericPorts | ( | VuoNode * | entryNode, |
VuoPort * | entryPort, | ||
bool | useOriginalType | ||
) |
Returns the set of ports that have the same innermost generic type as entryPort.
Assumes that updateGenericPortTypes() has been called since any changes affecting the groups/networks of connected generic ports have been made to the composition.
entryNode | The node containing entryPort. |
entryPort | The port whose type is to be matched in the returned ports. |
useOriginalType | If true, considers a port generic if it's currently generic or if it's specialized from a generic. If false, only looks at ports that are currently generic. |
Definition at line 620 of file VuoCompilerComposition.cc.
string VuoCompilerComposition::getGraphvizDeclaration | ( | VuoProtocol * | activeProtocol = NULL , |
string | header = "" , |
||
string | footer = "" |
||
) |
Returns the .vuo (Graphviz dot format) representation of this composition.
Definition at line 857 of file VuoCompilerComposition.cc.
string VuoCompilerComposition::getGraphvizDeclarationForComponents | ( | set< VuoNode * > | nodeSet, |
set< VuoCable * > | cableSet, | ||
set< VuoComment * > | commentSet, | ||
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.
Definition at line 871 of file VuoCompilerComposition.cc.
VuoNode * VuoCompilerComposition::getManuallyFirableInputNode | ( | void | ) |
Returns the node most recently set by VuoCompilerComposition::setManuallyFirableInputPort().
Definition at line 841 of file VuoCompilerComposition.cc.
VuoPort * VuoCompilerComposition::getManuallyFirableInputPort | ( | void | ) |
Returns the input port most recently set by VuoCompilerComposition::setManuallyFirableInputPort().
Definition at line 849 of file VuoCompilerComposition.cc.
void VuoCompilerComposition::invalidateCachedGraph | ( | void | ) |
Indicates that the most recently generated graph for this composition no longer applies.
Definition at line 214 of file VuoCompilerComposition.cc.
|
static |
Creates a composition from the Graphviz-formatted string representation of a composition.
VuoCompilerException | Couldn't parse the composition. |
Definition at line 100 of file VuoCompilerComposition.cc.
|
static |
Returns true if a port on an old node class corresponds to a port on a new node class replacing the old one (same name, same data type).
Definition at line 1047 of file VuoCompilerComposition.cc.
Returns true if a port on an old node corresponds to a port on a new node replacing the old one (same name, same data type).
Definition at line 1020 of file VuoCompilerComposition.cc.
Replaces oldNode with newNode in the composition, transferring all cable and published port connections from oldNode to newNode where port names and data types correspond, and severing the rest.
If oldNode or newNode lacks a compiler detail (its node class is not loaded), then cables are transferred where port names correspond.
Definition at line 166 of file VuoCompilerComposition.cc.
void VuoCompilerComposition::setManuallyFirableInputPort | ( | VuoNode * | nodeContainingPort, |
VuoPort * | portFiredInto | ||
) |
Selects the input port into which a hidden trigger port can fire events on demand.
The trigger port and the cable from it to portFiredInto are not included in the lists of nodes or cables stored in the VuoComposition. The trigger port can be accessed with VuoCompilerGraph::getManuallyFirableTrigger().
Definition at line 832 of file VuoCompilerComposition.cc.
void VuoCompilerComposition::setModule | ( | Module * | module | ) |
Takes ownership of the LLVM module containing the compiled composition.
Definition at line 730 of file VuoCompilerComposition.cc.
void VuoCompilerComposition::setUniqueGraphvizIdentifierForComment | ( | VuoComment * | comment | ) |
If the given comment has the same Graphviz identifier as another comment currently in the composition, a comment that was in the composition when it was originally parsed from Graphviz, or a comment that was previously passed through this function, changes the given comment's Graphviz identifier to one that has never been used by this composition.
Definition at line 792 of file VuoCompilerComposition.cc.
void VuoCompilerComposition::setUniqueGraphvizIdentifierForNode | ( | VuoNode * | node, |
const string & | preferredIdentifier = "" , |
||
const string & | identifierPrefix = "" |
||
) |
If the given node has the same Graphviz identifier as another node currently in the composition, a node that was in the composition when it was originally parsed from Graphviz, 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.
Definition at line 751 of file VuoCompilerComposition.cc.
Module * VuoCompilerComposition::takeModule | ( | void | ) |
Relinquishes ownership of the LLVM module previously passed to setModule.
Definition at line 738 of file VuoCompilerComposition.cc.
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.
Definition at line 495 of file VuoCompilerComposition.cc.
|
static |
The default graph type and ID to be generated for new .vuo (Graphviz dot format) composition files.
Definition at line 69 of file VuoCompilerComposition.hh.
|
static |
The key of the top-level composition when looking up node contexts.
Definition at line 70 of file VuoCompilerComposition.hh.