Vuo
1.2.5
|
Encapsulates the state of the runtime when running a single composition, including both state that is preserved across live-coding reloads and state that only lives for a single start-stop of the composition.
Public Member Functions | |
VuoRuntimeState (void *zmqContext, const char *controlUrl, const char *telemetryUrl, bool isPaused, pid_t runnerPid, int runnerPipe, bool continueIfRunnerDies, const char *workingDirectory, void *compositionBinaryHandle, VuoRuntimePersistentState *persistentState) | |
Creates a runtime state instance, updates its references to symbols defined in the composition binary, and opens a connection between it and the runner. | |
~VuoRuntimeState (void) | |
Destructor. | |
void | updateCompositionSymbols (void *compositionBinaryHandle) |
Updates references to symbols defined in the composition's generated code. | |
bool | isPaused (void) |
Returns true if the composition is currently paused. | |
bool | isStopped (void) |
Returns true if the composition hasn't started yet or has been stopped. | |
pid_t | getRunnerPid (void) |
Returns the process ID of the runner that started the composition. | |
void | disableTermination (void) |
Temporarily disables automatic termination. | |
void | enableTermination (void) |
Resumes automatic termination. | |
void | startComposition (void) |
Initializes the composition's node and port data, starts the composition's triggers firing if the composition is supposed to be unpaused initially, and starts communicating with the runner. | |
void | pauseComposition (void) |
Pauses firing of the composition's triggers. | |
void | unpauseComposition (void) |
Resumes firing of the composition's triggers. | |
void | stopCompositionAsOrderedByRunner (bool isBeingReplaced, int timeoutInSeconds) |
Stops the composition, either for a live-coding reload or permanently, as a result of a stop message from the runner. | |
void | stopCompositionAsOrderedByComposition (void) |
Nodes/libraries can call this function (via its wrapper, VuoStopComposition) to initiate a clean shutdown of the composition. | |
void | breakOutOfEventLoop (void) |
Carries out the final stage of stopping the composition, which entails interrupting the event loop. | |
Public Attributes | |
VuoRuntimePersistentState * | persistentState |
State preserved across live-coding reloads. | |
VuoRuntimeState::VuoRuntimeState | ( | void * | zmqContext, |
const char * | controlUrl, | ||
const char * | telemetryUrl, | ||
bool | isPaused, | ||
pid_t | runnerPid, | ||
int | runnerPipe, | ||
bool | continueIfRunnerDies, | ||
const char * | workingDirectory, | ||
void * | compositionBinaryHandle, | ||
VuoRuntimePersistentState * | persistentState | ||
) |
Creates a runtime state instance, updates its references to symbols defined in the composition binary, and opens a connection between it and the runner.
Does not take ownership of persistentState.
std::runtime_error | One of the symbols was not found in the composition binary. |
VuoRuntimeState::~VuoRuntimeState | ( | void | ) |
Destructor.
void VuoRuntimeState::breakOutOfEventLoop | ( | void | ) |
Carries out the final stage of stopping the composition, which entails interrupting the event loop.
AFter this function has returned, isStopped() returns true.
void VuoRuntimeState::disableTermination | ( | void | ) |
Temporarily disables automatic termination.
When a composition is asked to shut down, a watchdog timer waits a few seconds then force-quits if it hasn't cleanly shut down by then. This disables that watchdog.
void VuoRuntimeState::enableTermination | ( | void | ) |
Resumes automatic termination.
pid_t VuoRuntimeState::getRunnerPid | ( | void | ) |
Returns the process ID of the runner that started the composition.
bool VuoRuntimeState::isPaused | ( | void | ) |
Returns true if the composition is currently paused.
bool VuoRuntimeState::isStopped | ( | void | ) |
Returns true if the composition hasn't started yet or has been stopped.
void VuoRuntimeState::pauseComposition | ( | void | ) |
Pauses firing of the composition's triggers.
void VuoRuntimeState::startComposition | ( | void | ) |
Initializes the composition's node and port data, starts the composition's triggers firing if the composition is supposed to be unpaused initially, and starts communicating with the runner.
void VuoRuntimeState::stopCompositionAsOrderedByComposition | ( | void | ) |
Nodes/libraries can call this function (via its wrapper, VuoStopComposition) to initiate a clean shutdown of the composition.
It's also called if the VuoRunner dies, the composition is still running, and VuoRunner has requested that the composition be stopped when it dies.
void VuoRuntimeState::stopCompositionAsOrderedByRunner | ( | bool | isBeingReplaced, |
int | timeoutInSeconds | ||
) |
Stops the composition, either for a live-coding reload or permanently, as a result of a stop message from the runner.
void VuoRuntimeState::unpauseComposition | ( | void | ) |
Resumes firing of the composition's triggers.
void VuoRuntimeState::updateCompositionSymbols | ( | void * | compositionBinaryHandle | ) |
Updates references to symbols defined in the composition's generated code.
std::runtime_error | One of the symbols was not found in the composition binary. |
VuoRuntimePersistentState* VuoRuntimeState::persistentState |
State preserved across live-coding reloads.