Manages the diff between composition versions before and after a live-coding reload.
Definition at line 18 of file VuoCompositionDiff.hh.
Public Types | |
enum | ChangeType { ChangeStartStop, ChangeNone, ChangeAdd, ChangeRemove, ChangeReplace, ChangeMove } |
Possible changes to a node across a live-coding reload. More... | |
Public Member Functions | |
VuoCompositionDiff (void) | |
Constructor. More... | |
~VuoCompositionDiff (void) | |
Destructor. More... | |
void | setDiff (char *diff) |
Replaces the composition diff string with diff. More... | |
ChangeType | findNode (const char *compositionIdentifier, const char *nodeIdentifier, json_object **replacementObj) |
Searches compositionDiff for changes made to the node across a live-coding reload. More... | |
bool | isNodeBeingRemovedOrReplaced (const char *compositionIdentifier, 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). More... | |
bool | isNodeBeingAddedOrReplaced (const char *compositionIdentifier, 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). More... | |
bool | isPortBeingReplaced (const char *portName, json_object *replacementObj) |
Returns true if the port is among the replacees across a live-coding reload. More... | |
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. More... | |
bool | isNodeBeingMovedToHere (const char *newCompositionIdentifier, const char *nodeIdentifier, json_object *replacementObj, string &oldCompositionIdentifier) |
Returns true if the node is being moved to the new composition across a live-coding reload. More... | |
bool | isPortBeingCopied (const char *portName, json_object *replacementObj, string &destinationCompositionIdentifier, string &destinationPortIdentifier) |
Returns true if the port's data is being copied to another port across a live-coding reload. More... | |
bool | isCompositionStartingOrStopping (void) |
Returns true if 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. More... | |
Possible changes to a node across a live-coding reload.
Definition at line 24 of file VuoCompositionDiff.hh.
VuoCompositionDiff::VuoCompositionDiff | ( | void | ) |
Constructor.
Definition at line 18 of file VuoCompositionDiff.cc.
VuoCompositionDiff::~VuoCompositionDiff | ( | void | ) |
Destructor.
Definition at line 26 of file VuoCompositionDiff.cc.
VuoCompositionDiff::ChangeType VuoCompositionDiff::findNode | ( | const char * | compositionIdentifier, |
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 VuoCompilerCompositionDiff::diff.
compositionIdentifier
argument. Definition at line 81 of file VuoCompositionDiff.cc.
bool VuoCompositionDiff::isCompositionStartingOrStopping | ( | void | ) |
Returns true if 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.
Definition at line 296 of file VuoCompositionDiff.cc.
bool VuoCompositionDiff::isNodeBeingAddedOrReplaced | ( | const char * | compositionIdentifier, |
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).
compositionIdentifier
argument. Definition at line 149 of file VuoCompositionDiff.cc.
bool VuoCompositionDiff::isNodeBeingMovedToHere | ( | const char * | newCompositionIdentifier, |
const char * | nodeIdentifier, | ||
json_object * | replacementObj, | ||
string & | oldCompositionIdentifier | ||
) |
Returns true if the node is being moved to the new composition across a live-coding reload.
Definition at line 233 of file VuoCompositionDiff.cc.
bool VuoCompositionDiff::isNodeBeingRemovedOrReplaced | ( | const char * | compositionIdentifier, |
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).
compositionIdentifier
argument. Definition at line 136 of file VuoCompositionDiff.cc.
bool VuoCompositionDiff::isPortBeingCopied | ( | const char * | portName, |
json_object * | replacementObj, | ||
string & | destinationCompositionIdentifier, | ||
string & | destinationPortIdentifier | ||
) |
Returns true if the port's data is being copied to another port across a live-coding reload.
Definition at line 259 of file VuoCompositionDiff.cc.
bool VuoCompositionDiff::isPortBeingReplaced | ( | const char * | portName, |
json_object * | replacementObj | ||
) |
Returns true if the port is among the replacees across a live-coding reload.
Definition at line 159 of file VuoCompositionDiff.cc.
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.
Definition at line 186 of file VuoCompositionDiff.cc.
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.
Definition at line 36 of file VuoCompositionDiff.cc.