Computes the diff between composition versions before and after a live-editing reload.
Definition at line 20 of file VuoCompilerCompositionDiff.hh.
Public Member Functions | |
string | diff (const string &oldCompositionGraphvizDeclaration, VuoCompilerComposition *newComposition, VuoCompiler *compiler) |
Returns a JSON-formatted comparison between the old and the new composition, including subcompositions. More... | |
void | addNodeReplacement (const string &compositionIdentifier, const string &oldNodeIdentifier, const string &newNodeIdentifier) |
Adds a mapping for a node replaced in a composition. More... | |
void | addNodeReplacement (const string &compositionIdentifier, const string &oldNodeIdentifier, const string &newNodeIdentifier, const map< string, string > &oldAndNewPortIdentifiers) |
Adds a mapping for a node replaced in a composition. More... | |
void | addNodeClassReplacement (VuoCompilerNodeClass *oldNodeClass, VuoCompilerNodeClass *newNodeClass) |
Adds a mapping for a node class replaced with a new implementation. More... | |
void | addModuleReplacement (const string &moduleKey) |
Adds a mapping for a module replaced with a new implementation. More... | |
void | addRefactoring (const string &compositionIdentifier, const set< VuoCompilerNode * > &nodesMoved, VuoCompilerNode *subcompositionMovedTo) |
Adds a mapping for nodes refactored into a subcomposition. More... | |
set< string > | getModuleKeysReplaced (void) const |
Returns the names of all node classes and other modules being replaced with a new implementation. More... | |
Friends | |
class | TestVuoCompilerComposition |
bool | operator< (const NodeReplacement &lhs, const NodeReplacement &rhs) |
Needed so this type can be used in STL containers. More... | |
bool | operator< (const NodeClassReplacement &lhs, const NodeClassReplacement &rhs) |
Needed so this type can be used in STL containers. More... | |
bool | operator< (const Refactoring &lhs, const Refactoring &rhs) |
Needed so this type can be used in STL containers. More... | |
void VuoCompilerCompositionDiff::addModuleReplacement | ( | const string & | moduleKey | ) |
Adds a mapping for a module replaced with a new implementation.
If not calling addNodeClassReplacement, call this.
Definition at line 700 of file VuoCompilerCompositionDiff.cc.
void VuoCompilerCompositionDiff::addNodeClassReplacement | ( | VuoCompilerNodeClass * | oldNodeClass, |
VuoCompilerNodeClass * | newNodeClass | ||
) |
Adds a mapping for a node class replaced with a new implementation.
This class does not keep references to oldNodeClass and newNodeClass. It's safe to delete them after calling this function.
Definition at line 665 of file VuoCompilerCompositionDiff.cc.
void VuoCompilerCompositionDiff::addNodeReplacement | ( | const string & | compositionIdentifier, |
const string & | oldNodeIdentifier, | ||
const string & | newNodeIdentifier | ||
) |
Adds a mapping for a node replaced in a composition.
Ports in the old node are mapped to identically-named ports in the new node.
Definition at line 635 of file VuoCompilerCompositionDiff.cc.
void VuoCompilerCompositionDiff::addNodeReplacement | ( | const string & | compositionIdentifier, |
const string & | oldNodeIdentifier, | ||
const string & | newNodeIdentifier, | ||
const map< string, string > & | oldAndNewPortIdentifiers | ||
) |
Adds a mapping for a node replaced in a composition.
Definition at line 648 of file VuoCompilerCompositionDiff.cc.
void VuoCompilerCompositionDiff::addRefactoring | ( | const string & | compositionIdentifier, |
const set< VuoCompilerNode * > & | nodesMoved, | ||
VuoCompilerNode * | subcompositionMovedTo | ||
) |
Adds a mapping for nodes refactored into a subcomposition.
compositionIdentifier | The composition containing the nodes in the old composition. |
nodesMoved | The nodes factored out, moved inside a subcomposition in the new composition. |
subcompositionMovedTo | The subcomposition in the new composition. |
Definition at line 712 of file VuoCompilerCompositionDiff.cc.
string VuoCompilerCompositionDiff::diff | ( | const string & | oldCompositionGraphvizDeclaration, |
VuoCompilerComposition * | newComposition, | ||
VuoCompiler * | compiler | ||
) |
Returns a JSON-formatted comparison between the old and the new composition, including subcompositions.
The comparison is a JSON array loosely based on the JSON Patch format. The key used for each node is a path constructed from its Graphviz identifier and the identifiers of the (sub)compositions containing the node. Unlike the examples below (spaced for readability), the returned string contains no whitespace.
The comparison follows the compiler's rule that the PublishedInputs and PublishedOutputs pseudo-nodes are either both present or both absent in a compiled composition.
This needs to be kept in sync with VuoCompositionDiff::findNode.
Definition at line 112 of file VuoCompilerCompositionDiff.cc.
set< string > VuoCompilerCompositionDiff::getModuleKeysReplaced | ( | void | ) | const |
Returns the names of all node classes and other modules being replaced with a new implementation.
Definition at line 728 of file VuoCompilerCompositionDiff.cc.
|
friend |
Needed so this type can be used in STL containers.
Definition at line 598 of file VuoCompilerCompositionDiff.cc.
|
friend |
Needed so this type can be used in STL containers.
Definition at line 586 of file VuoCompilerCompositionDiff.cc.
|
friend |
Needed so this type can be used in STL containers.
Definition at line 606 of file VuoCompilerCompositionDiff.cc.