VuoRuntime implementation.
Definition in file VuoRuntime.cc.
Go to the source code of this file.
Typedefs | |
typedef void(* | VuoCompositionFiniCallback) (void) |
Callback prototype for vuoAddCompositionFiniCallback. More... | |
Functions | |
void | vuoInit (int argc, char **argv) |
Parses command-line arguments, then calls vuoInitInProcess(). More... | |
void | vuoInitInProcess (void *ZMQContext, const char *controlURL, const char *telemetryURL, bool isPaused, pid_t runnerPid, int runnerPipe, bool continueIfRunnerDies, const char *workingDirectory, void *compositionBinaryHandle, void *previousRuntimeState, bool doAppInit) |
Starts a composition running in the current process. More... | |
void * | vuoFini (void) |
Cleans up the ØMQ connections. More... | |
void | vuoFiniRuntimeState (void *runtimeState) |
Deallocates the return value of vuoFini(). More... | |
char * | vuoGetWorkingDirectory (VuoCompositionState *compositionState) |
Calls VuoRuntimePersistentState::getWorkingDirectory() on the given runtime state if any, otherwise on the current runtime state if any, otherwise returns null. More... | |
pid_t | vuoGetRunnerPid (VuoCompositionState *compositionState) |
Calls VuoRuntimeState::getRunnerPid() on the given runtime state if any, otherwise on the current runtime state if any, otherwise returns -1. More... | |
void | vuoStopComposition (VuoCompositionState *compositionState) |
Calls VuoRuntimeState::stopCompositionAsOrderedByComposition() on the given runtime state if any, otherwise on the current runtime state if any, otherwise does nothing. More... | |
void | vuoAddCompositionFiniCallback (VuoCompositionState *compositionState, VuoCompositionFiniCallback fini) |
Calls VuoRuntimePersistentState::addFiniCallback() on the given runtime state if any, otherwise on the current runtime state if any, otherwise does nothing. More... | |
void | vuoDisableTermination (VuoCompositionState *compositionState) |
Calls VuoRuntimeState::disableTermination() on the given runtime state if any, otherwise on the current runtime state if any, otherwise does nothing. More... | |
void | vuoEnableTermination (VuoCompositionState *compositionState) |
Calls VuoRuntimeState::enableTermination() on the given runtime state if any, otherwise on the current runtime state if any, otherwise does nothing. More... | |
bool | vuoIsCurrentCompositionStopped (void) |
Returns true if the composition has not yet started or if it has stopped. More... | |
Variables | |
static VuoRuntimeState * | runtimeState = NULL |
Runtime instance specific to this composition, keeping it separate from any other compositions running in the current process. More... | |
void * | vuoRuntimeState = NULL |
Casted version of runtimeState for use by generated bitcode. More... | |
typedef void(* VuoCompositionFiniCallback) (void) |
Callback prototype for vuoAddCompositionFiniCallback.
Definition at line 308 of file VuoRuntime.cc.
void vuoAddCompositionFiniCallback | ( | VuoCompositionState * | compositionState, |
VuoCompositionFiniCallback | fini | ||
) |
Calls VuoRuntimePersistentState::addFiniCallback() on the given runtime state if any, otherwise on the current runtime state if any, otherwise does nothing.
Definition at line 351 of file VuoRuntime.cc.
void vuoDisableTermination | ( | VuoCompositionState * | compositionState | ) |
Calls VuoRuntimeState::disableTermination() on the given runtime state if any, otherwise on the current runtime state if any, otherwise does nothing.
Definition at line 362 of file VuoRuntime.cc.
void vuoEnableTermination | ( | VuoCompositionState * | compositionState | ) |
Calls VuoRuntimeState::enableTermination() on the given runtime state if any, otherwise on the current runtime state if any, otherwise does nothing.
Definition at line 373 of file VuoRuntime.cc.
void* vuoFini | ( | void | ) |
Cleans up the ØMQ connections.
To be called after the composition has stopped.
Returns a data structure containing runtime state that should persist across a live-coding reload. If this function is called for a live-coding reload, pass the return value to the next call to vuoInitInProcess(). Otherwise, pass it to vuoFiniRuntimeState().
Definition at line 291 of file VuoRuntime.cc.
void vuoFiniRuntimeState | ( | void * | runtimeState | ) |
Deallocates the return value of vuoFini().
Definition at line 300 of file VuoRuntime.cc.
pid_t vuoGetRunnerPid | ( | VuoCompositionState * | compositionState | ) |
Calls VuoRuntimeState::getRunnerPid() on the given runtime state if any, otherwise on the current runtime state if any, otherwise returns -1.
Definition at line 327 of file VuoRuntime.cc.
char* vuoGetWorkingDirectory | ( | VuoCompositionState * | compositionState | ) |
Calls VuoRuntimePersistentState::getWorkingDirectory() on the given runtime state if any, otherwise on the current runtime state if any, otherwise returns null.
Definition at line 314 of file VuoRuntime.cc.
void vuoInit | ( | int | argc, |
char ** | argv | ||
) |
Parses command-line arguments, then calls vuoInitInProcess().
Definition at line 33 of file VuoRuntime.cc.
void vuoInitInProcess | ( | void * | ZMQContext, |
const char * | controlURL, | ||
const char * | telemetryURL, | ||
bool | isPaused, | ||
pid_t | runnerPid, | ||
int | runnerPipe, | ||
bool | continueIfRunnerDies, | ||
const char * | workingDirectory, | ||
void * | compositionBinaryHandle, | ||
void * | previousRuntimeState, | ||
bool | doAppInit | ||
) |
Starts a composition running in the current process.
ZMQContext | A ØMQ context shared with the runner (since ØMQ only allows one context per process). If not needed, pass null. |
controlURL | The URL to which the runtime should bind the ØMQ socket that it uses to receive control requests and send replies. |
telemetryURL | The URL to which the runtime should bind the ØMQ socket that it uses to publish telemetry. |
isPaused | If true, the composition starts out paused, and it's up to the runner to unpause it. |
runnerPid | The process ID of the runner. |
runnerPipe | The file descriptor of the pipe that the runtime should use to check if the runner process has ended. If not needed, pass -1. |
continueIfRunnerDies | If true, the runtime should allow the composition to keep running if runnerPipe indicates that the runner process has ended. If false, the runtime should instead stop the composition. |
workingDirectory | The directory that the composition should use to resolve relative paths. |
compositionBinaryHandle | The handle of the composition's dynamic library or executable returned by dlopen() . |
previousRuntimeState | If the composition is restarting for a live-coding reload, pass the value returned by the previous call to vuoFini(). Otherwise, pass null. |
doAppInit | Should we call VuoApp_init()? |
Definition at line 235 of file VuoRuntime.cc.
bool vuoIsCurrentCompositionStopped | ( | void | ) |
Returns true if the composition has not yet started or if it has stopped.
Assumes that just one composition is running in the process.
Definition at line 385 of file VuoRuntime.cc.
void vuoStopComposition | ( | VuoCompositionState * | compositionState | ) |
Calls VuoRuntimeState::stopCompositionAsOrderedByComposition() on the given runtime state if any, otherwise on the current runtime state if any, otherwise does nothing.
Definition at line 340 of file VuoRuntime.cc.
|
static |
Runtime instance specific to this composition, keeping it separate from any other compositions running in the current process.
Definition at line 27 of file VuoRuntime.cc.
void* vuoRuntimeState = NULL |
Casted version of runtimeState
for use by generated bitcode.
Definition at line 28 of file VuoRuntime.cc.