Vuo  1.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Typedefs | Functions | Variables
VuoRuntime.cc File Reference

Description

VuoRuntime implementation.

Typedefs

typedef void(* VuoCompositionFiniCallback )(void)
 Callback prototype for vuoAddCompositionFiniCallback.
 

Functions

void vuoInit (int argc, char **argv)
 Parses command-line arguments, then calls vuoInitInProcess().
 
void vuoInitInProcess (void *ZMQContext, const char *controlURL, const char *telemetryURL, bool isPaused, pid_t runnerPid, int runnerPipe, bool continueIfRunnerDies, bool trialRestrictionsEnabled, const char *workingDirectory, void *compositionBinaryHandle, void *runtimePersistentState)
 Starts a composition running in the current process.
 
void * vuoFini (void)
 Cleans up the ØMQ connections.
 
void vuoFiniRuntimePersistentState (void *runtimePersistentState)
 Deallocates the return value of vuoFini().
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
bool vuoIsCurrentCompositionStopped (void)
 Returns true if the composition has not yet started or if it has stopped.
 

Variables

static VuoRuntimeStateruntimeState = NULL
 Runtime instance specific to this composition, keeping it separate from any other compositions running in the current process.
 
void * vuoRuntimeState = NULL
 Casted version of runtimeState for use by generated bitcode.
 

Typedef Documentation

typedef void(* VuoCompositionFiniCallback)(void)

Callback prototype for vuoAddCompositionFiniCallback.

Function Documentation

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.

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.

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.

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 vuoFiniRuntimePersistentState().

void vuoFiniRuntimePersistentState ( void *  runtimePersistentState)

Deallocates the return value of vuoFini().

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.

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.

void vuoInit ( int  argc,
char **  argv 
)

Parses command-line arguments, then calls vuoInitInProcess().

void vuoInitInProcess ( void *  ZMQContext,
const char *  controlURL,
const char *  telemetryURL,
bool  isPaused,
pid_t  runnerPid,
int  runnerPipe,
bool  continueIfRunnerDies,
bool  trialRestrictionsEnabled,
const char *  workingDirectory,
void *  compositionBinaryHandle,
void *  runtimePersistentState 
)

Starts a composition running in the current process.

Parameters
ZMQContextA ØMQ context shared with the runner (since ØMQ only allows one context per process). If not needed, pass null.
controlURLThe URL to which the runtime should bind the ØMQ socket that it uses to receive control requests and send replies.
telemetryURLThe URL to which the runtime should bind the ØMQ socket that it uses to publish telemetry.
isPausedIf true, the composition starts out paused, and it's up to the runner to unpause it.
runnerPidThe process ID of the runner.
runnerPipeThe file descriptor of the pipe that the runtime should use to check if the runner process has ended. If not needed, pass -1.
continueIfRunnerDiesIf 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.
trialRestrictionsEnabledIf true, the composition should run in free-trial mode.
workingDirectoryThe directory that the composition should use to resolve relative paths.
compositionBinaryHandleThe handle of the composition's dynamic library or executable returned by dlopen().
runtimePersistentStateIf the composition is restarting for a live-coding reload, pass the value returned by the previous call to vuoFini(). Otherwise, pass null.
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.

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.

Variable Documentation

VuoRuntimeState* runtimeState = NULL
static

Runtime instance specific to this composition, keeping it separate from any other compositions running in the current process.

void* vuoRuntimeState = NULL

Casted version of runtimeState for use by generated bitcode.