Vuo  2.0.0
Typedefs | Functions | Variables
VuoRuntime.h File Reference

Description

VuoRuntime interface.

Definition in file VuoRuntime.h.

Go to the source code of this file.

Typedefs

typedef void() VuoInitInProcessType(void *ZMQContext, const char *controlURL, const char *telemetryURL, bool isPaused, pid_t runnerPid, int runnerPipe, bool continueIfRunnerDies, const char *workingDirectory, void *compositionBinaryHandle, void *runtimePersistentState, bool doAppInit)
 Type for vuoInitInProcess. More...
 
typedef void *() VuoFiniType(void)
 Type for vuoFini. More...
 
typedef void() VuoFiniRuntimeStateType(void *)
 Type for vuoFiniRuntimeState. More...
 
typedef void() VuoSendErrorType(struct VuoCompositionState *, const char *)
 Type for vuoSendError. More...
 
typedef bool() VuoIsCurrentCompositionStoppedType(void)
 Type for vuoIsCurrentCompositionStopped. 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...
 

Variables

VuoSendErrorType vuoSendError
 Sends a telemetry message indicating that an error has occurred. More...
 
VuoIsCurrentCompositionStoppedType vuoIsCurrentCompositionStopped
 Returns true if the composition has not yet started or if it has stopped. More...
 

Typedef Documentation

◆ VuoFiniRuntimeStateType

typedef void() VuoFiniRuntimeStateType(void *)

Type for vuoFiniRuntimeState.

Definition at line 40 of file VuoRuntime.h.

◆ VuoFiniType

typedef void*() VuoFiniType(void)

Type for vuoFini.

Definition at line 33 of file VuoRuntime.h.

◆ VuoInitInProcessType

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

Type for vuoInitInProcess.

Definition at line 22 of file VuoRuntime.h.

◆ VuoIsCurrentCompositionStoppedType

typedef bool() VuoIsCurrentCompositionStoppedType(void)

Type for vuoIsCurrentCompositionStopped.

Definition at line 55 of file VuoRuntime.h.

◆ VuoSendErrorType

typedef void() VuoSendErrorType(struct VuoCompositionState *, const char *)

Type for vuoSendError.

Definition at line 45 of file VuoRuntime.h.

Function Documentation

◆ vuoFini()

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 286 of file VuoRuntime.cc.

◆ vuoInit()

void vuoInit ( int  argc,
char **  argv 
)

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

Definition at line 33 of file VuoRuntime.cc.

◆ vuoInitInProcess()

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.

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.
workingDirectoryThe directory that the composition should use to resolve relative paths.
compositionBinaryHandleThe handle of the composition's dynamic library or executable returned by dlopen().
previousRuntimeStateIf the composition is restarting for a live-coding reload, pass the value returned by the previous call to vuoFini(). Otherwise, pass null.
doAppInitShould we call VuoApp_init()?

Definition at line 232 of file VuoRuntime.cc.

Variable Documentation

◆ vuoIsCurrentCompositionStopped

VuoIsCurrentCompositionStoppedType vuoIsCurrentCompositionStopped

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 62 of file VuoRuntime.h.

◆ vuoSendError

VuoSendErrorType vuoSendError

Sends a telemetry message indicating that an error has occurred.

Definition at line 50 of file VuoRuntime.h.