Vuo
1.2.6
|
Manages the diff between composition versions before and after a live-coding reload.
Public Types | |
enum | ChangeType { ChangeStartStop, ChangeNone, ChangeAdd, ChangeRemove, ChangeReplace } |
Possible changes to a node across a live-coding reload. More... | |
Public Member Functions | |
VuoCompositionDiff (void) | |
Constructor. | |
~VuoCompositionDiff (void) | |
Destructor. | |
void | setDiff (char *diff) |
Replaces the composition diff string with diff. | |
ChangeType | findNode (const char *nodeIdentifier, json_object **replacementObj) |
Searches compositionDiff for changes made to the node across a live-coding reload. | |
bool | isNodeBeingRemovedOrReplaced (const char *nodeIdentifier, json_object **replacementObj) |
Returns true if the node is among the removals or replacees across a live-coding reload, or if the composition is being stopped (not a live-coding reload). | |
bool | isNodeBeingAddedOrReplaced (const char *nodeIdentifier, json_object **replacementObj) |
Returns true if the node is among the additions or replacers across a live-coding reload, or if the composition is being started (not a live-coding reload). | |
bool | isPortBeingReplaced (const char *portName, json_object *replacementObj) |
Returns true if the port is among the replacees across a live-coding reload. | |
bool | isPortReplacingAnother (const char *portName, json_object *replacementObj, string &oldNodeIdentifier, string &oldPortIdentifier) |
Returns true if the port is among the replacers across a live-coding reload. | |
bool | isCompositionStartingOrStopping (void) |
Returns true the composition is either starting for the first time or stopping for the last time, false if the composition is being restarted for a live-coding reload. | |
Possible changes to a node across a live-coding reload.
VuoCompositionDiff::VuoCompositionDiff | ( | void | ) |
Constructor.
VuoCompositionDiff::~VuoCompositionDiff | ( | void | ) |
Destructor.
VuoCompositionDiff::ChangeType VuoCompositionDiff::findNode | ( | const char * | nodeIdentifier, |
json_object ** | replacementObj | ||
) |
Searches compositionDiff
for changes made to the node across a live-coding reload.
This needs to be kept in sync with VuoCompilerComposition::diffAgainstOlderComposition()
.
bool VuoCompositionDiff::isCompositionStartingOrStopping | ( | void | ) |
Returns true the composition is either starting for the first time or stopping for the last time, false if the composition is being restarted for a live-coding reload.
bool VuoCompositionDiff::isNodeBeingAddedOrReplaced | ( | const char * | nodeIdentifier, |
json_object ** | replacementObj | ||
) |
Returns true if the node is among the additions or replacers across a live-coding reload, or if the composition is being started (not a live-coding reload).
bool VuoCompositionDiff::isNodeBeingRemovedOrReplaced | ( | const char * | nodeIdentifier, |
json_object ** | replacementObj | ||
) |
Returns true if the node is among the removals or replacees across a live-coding reload, or if the composition is being stopped (not a live-coding reload).
bool VuoCompositionDiff::isPortBeingReplaced | ( | const char * | portName, |
json_object * | replacementObj | ||
) |
Returns true if the port is among the replacees across a live-coding reload.
bool VuoCompositionDiff::isPortReplacingAnother | ( | const char * | portName, |
json_object * | replacementObj, | ||
string & | oldNodeIdentifier, | ||
string & | oldPortIdentifier | ||
) |
Returns true if the port is among the replacers across a live-coding reload.
void VuoCompositionDiff::setDiff | ( | char * | diff | ) |
Replaces the composition diff string with diff.
This class takes ownership of diff, so the caller should not free it.