Vuo  1.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
VuoRuntimeState Class Reference

Description

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)
 Returns a partially initialized runtime instance.
 
 ~VuoRuntimeState (void)
 Cleans up after the composition has stopped for the last time.
 
void init (void *zmqContext, const char *controlUrl, const char *telemetryUrl, bool isPaused, pid_t runnerPid, int runnerPipe, bool continueIfRunnerDies, const char *workingDirectory, void *compositionBinaryHandle)
 Initializes a runtime state instance, updates its references to symbols defined in the composition binary, and opens a connection between it and the runner.
 
void fini (void)
 Cleans up after the composition has stopped for a live-coding reload.
 
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, bool isLastEverInProcess)
 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

VuoRuntimePersistentStatepersistentState
 State preserved across live-coding reloads.
 

Constructor & Destructor Documentation

VuoRuntimeState::VuoRuntimeState ( void  )

Returns a partially initialized runtime instance.

VuoRuntimeState::init() should be called to finish the job.

VuoRuntimeState::~VuoRuntimeState ( void  )

Cleans up after the composition has stopped for the last time.

Member Function Documentation

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.

void VuoRuntimeState::fini ( void  )

Cleans up after the composition has stopped for a live-coding reload.

pid_t VuoRuntimeState::getRunnerPid ( void  )

Returns the process ID of the runner that started the composition.

void VuoRuntimeState::init ( void *  zmqContext,
const char *  controlUrl,
const char *  telemetryUrl,
bool  isPaused,
pid_t  runnerPid,
int  runnerPipe,
bool  continueIfRunnerDies,
const char *  workingDirectory,
void *  compositionBinaryHandle 
)

Initializes a runtime state instance, updates its references to symbols defined in the composition binary, and opens a connection between it and the runner.

Exceptions
std::runtime_errorOne of the symbols was not found in the composition binary.
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,
bool  isLastEverInProcess 
)

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.

Exceptions
std::runtime_errorOne of the symbols was not found in the composition binary.

Member Data Documentation

VuoRuntimePersistentState* VuoRuntimeState::persistentState

State preserved across live-coding reloads.


The documentation for this class was generated from the following files: