Vuo
1.2.3
|
VuoRuntime implementation.
Typedefs | |
typedef void(* | VuoCompositionFiniCallback )(void) |
Callback prototype. | |
typedef std::list < VuoCompositionFiniCallback > | VuoCompositionFiniCallbackListType |
Type for fini callback list. | |
Functions | |
static void | stopComposition (bool isBeingReplaced) |
This function is called when the composition receives a stop request (VuoControlRequestCompositionStop), or when the a node or library requests a clean shutdown (VuoStopComposition). | |
void | vuoStopComposition (void) |
Nodes/libraries can call this function (via its wrapper, VuoStopComposition) to initiate a clean shutdown of the composition. | |
char * | getInputPortString (char *portIdentifier, bool shouldUseInterprocessSerialization) |
Returns a string representation of the input port's current value. | |
char * | getOutputPortString (char *portIdentifier, bool shouldUseInterprocessSerialization) |
Returns a string representation of the output port's current value. | |
static char * | getInputPortSummary (char *portIdentifier) |
Returns a summary of the input port's current value. | |
static char * | getOutputPortSummary (char *portIdentifier) |
Returns a summary of the output port's current value. | |
static void | vuoControlReplySend (enum VuoControlReply reply, zmq_msg_t *messages, unsigned int messageCount) |
This function may only be called on dispatch queue VuoControlQueue . | |
void | vuoTelemetrySend (enum VuoTelemetry type, zmq_msg_t *messages, unsigned int messageCount) |
This function may be called from any thread. | |
void | vuoInit (int argc, char **argv) |
Parses command-line arguments, then calls vuoInitInProcess() . | |
char * | VuoRuntime_mergeEnumDetails (string type, char *details) |
If type is an enum, merges the allowed enum values into details and returns it (caller responsible for freeing). | |
void | vuoInitInProcess (void *_ZMQContext, const char *controlURL, const char *telemetryURL, bool _isPaused, pid_t _runnerPid, int runnerPipe, bool continueIfRunnerDies, bool trialRestrictionsEnabled, void *_VuoCompositionFiniCallbackList) |
Sets up ZMQ control and telemetry sockets, then calls the generated function vuoSetup() . | |
void | sendNodeExecutionStarted (char *nodeIdentifier) |
Constructs and sends a message on the telemetry socket, indicating that a node has started execution. | |
void | sendNodeExecutionFinished (char *nodeIdentifier) |
Constructs and sends a message on the telemetry socket, indicating that a node has finished execution. | |
void | sendInputPortsUpdated (char *portIdentifier, bool receivedEvent, bool receivedData, char *portDataSummary) |
Constructs and sends a message on the telemetry socket, indicating that an input port has received an event or data. | |
void | sendOutputPortsUpdated (char *portIdentifier, bool sentData, char *portDataSummary) |
Constructs and sends a message on the telemetry socket, indicating that an output port has transmitted or fired an event. | |
void | sendPublishedOutputPortsUpdated (char *portIdentifier, bool sentData, char *portDataSummary) |
Constructs and sends a message on the telemetry socket, indicating that a published output port has transmitted an event. | |
void | sendEventDropped (char *portIdentifier) |
Constructs and sends a message on the telemetry socket, indicating that a trigger port has dropped an event. | |
void | sendError (const char *message) |
Constructs and sends a message on the telemetry socket, indicating that an uncaught error has occurred. | |
bool | vuoShouldSendPortDataTelemetry (const char *portIdentifier) |
Returns true if telemetry containing the port data summary should be sent for this port. | |
char * | vuoSerializeTelemetryState (void) |
Serializes the variables controlling telemetry-sending to a JSON-formatted string. | |
void | vuoUnserializeTelemetryState (char *serialized) |
Unserializes the variables controlling telemetry-sending from a JSON-formatted string. | |
void | vuoAddCompositionFiniCallback (VuoCompositionFiniCallback fini) |
Registers a callback to be invoked when the composition is shutting down, after all nodes have been fini'd. | |
void | vuoFini (void) |
Cleans up composition execution: closes the ZMQ sockets and dispatch source and queues. | |
void | vuoSetup (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
void | vuoCleanup (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
void | vuoInstanceInit (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
void | vuoInstanceFini (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
void | vuoInstanceTriggerStart (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
void | vuoInstanceTriggerStop (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
void | vuoSetInputPortValue (char *portIdentifier, char *valueAsString) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
void | fireTriggerPortEvent (char *portIdentifier) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
char * | vuoGetPortValue (char *portIdentifier, int serializationType) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
unsigned int | getPublishedInputPortCount (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
unsigned int | getPublishedOutputPortCount (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
char ** | getPublishedInputPortNames (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
char ** | getPublishedOutputPortNames (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
char ** | getPublishedInputPortTypes (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
char ** | getPublishedOutputPortTypes (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
char ** | getPublishedInputPortDetails (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
char ** | getPublishedOutputPortDetails (void) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
void | firePublishedInputPortEvent (char *name) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
void | setPublishedInputPortValue (char *portIdentifier, char *valueAsString) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
char * | getPublishedInputPortValue (char *portIdentifier, int shouldUseInterprocessSerialization) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
char * | getPublishedOutputPortValue (char *portIdentifier, int shouldUseInterprocessSerialization) |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
void | VuoHeap_report () |
Sends a telemetry error with information about any objects remaining in the reference counting table. | |
Variables | |
bool | hasZMQConnection = false |
True if the ZMQControl and ZMQTelemetry sockets are connected to something. | |
static dispatch_queue_t | VuoControlQueue |
Dispatch queue for protecting access to the ZMQControl socket. | |
static dispatch_queue_t | VuoTelemetryQueue |
Dispatch queue for protecting access to the ZMQTelemetry socket. | |
static void * | ZMQContext |
The context used to initialize sockets. | |
static void * | ZMQControl |
The control socket. Use only on VuoControlQueue. | |
static void * | ZMQSelfReceive = 0 |
Used to break out of a ZMQControl poll. | |
static void * | ZMQSelfSend = 0 |
Used to break out of a ZMQControl poll. | |
static void * | ZMQTelemetry = 0 |
The telemetry socket. Use only on VuoTelemetryQueue. | |
static bool | hasBeenUnpaused |
True if node execution was unpaused initially, or if it has since been unpaused. | |
bool | isStopped |
True if composition execution has stopped. | |
bool | isStopRequested |
True if vuoStopComposition() has been called. | |
static dispatch_source_t | telemetryTimer |
Timer for sending telemetry messages. | |
static dispatch_source_t | controlTimer |
Timer for receiving control messages. | |
static dispatch_source_t | waitForStopTimer = NULL |
Timer for checking if the runner will stop the composition. | |
static dispatch_semaphore_t | telemetryCanceledSemaphore |
Signaled when telemetry events are no longer being processed. | |
static dispatch_semaphore_t | controlCanceledSemaphore |
Signaled when control events are no longer being processed. | |
static dispatch_semaphore_t | waitForStopCanceledSemaphore |
Signaled when no longer checking if the runner will stop the composition. | |
static bool | isSendingAllTelemetry = false |
True if all telemetry should be sent. | |
static bool | isSendingEventTelemetry = false |
True if all telemetry about events (not including data) should be sent. | |
static set< string > | portsSendingDataTelemetry |
Port identifiers for which data-and-event telemetry should be sent. | |
static pid_t | runnerPid |
Process ID of the runner that started the composition. | |
VuoCompositionFiniCallbackListType * | VuoCompositionFiniCallbackList |
Fini callbacks to invoke upon composition shutdown. Non-static, so that VuoCompositionLoader can fetch and restore it during live-coding reloads. | |
static dispatch_queue_t | VuoCompositionFiniCallbackQueue = NULL |
Serializes access to the list of fini callbacks. | |
static dispatch_queue_t | VuoCompositionStopQueue = NULL |
Ensures stops happen serially. | |
static bool | wasStopCompositionCalled = false |
Prevents the composition from being finalized twice. | |
bool | isPaused |
True if node execution is currently paused. | |
char * | compositionDiff |
Differences between the old and new composition, when replacing compositions for live coding. | |
typedef void(* VuoCompositionFiniCallback)(void) |
Callback prototype.
typedef std::list<VuoCompositionFiniCallback> VuoCompositionFiniCallbackListType |
Type for fini callback list.
void firePublishedInputPortEvent | ( | char * | name | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
void fireTriggerPortEvent | ( | char * | portIdentifier | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
char * getInputPortString | ( | char * | portIdentifier, |
bool | shouldUseInterprocessSerialization | ||
) |
Returns a string representation of the input port's current value.
|
static |
Returns a summary of the input port's current value.
char * getOutputPortString | ( | char * | portIdentifier, |
bool | shouldUseInterprocessSerialization | ||
) |
Returns a string representation of the output port's current value.
|
static |
Returns a summary of the output port's current value.
unsigned int getPublishedInputPortCount | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
char** getPublishedInputPortDetails | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
char** getPublishedInputPortNames | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
char** getPublishedInputPortTypes | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
char* getPublishedInputPortValue | ( | char * | portIdentifier, |
int | shouldUseInterprocessSerialization | ||
) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
unsigned int getPublishedOutputPortCount | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
char** getPublishedOutputPortDetails | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
char** getPublishedOutputPortNames | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
char** getPublishedOutputPortTypes | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
char* getPublishedOutputPortValue | ( | char * | portIdentifier, |
int | shouldUseInterprocessSerialization | ||
) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
void sendError | ( | const char * | message | ) |
Constructs and sends a message on the telemetry socket, indicating that an uncaught error has occurred.
void sendEventDropped | ( | char * | portIdentifier | ) |
Constructs and sends a message on the telemetry socket, indicating that a trigger port has dropped an event.
void sendInputPortsUpdated | ( | char * | portIdentifier, |
bool | receivedEvent, | ||
bool | receivedData, | ||
char * | portDataSummary | ||
) |
Constructs and sends a message on the telemetry socket, indicating that an input port has received an event or data.
void sendNodeExecutionFinished | ( | char * | nodeIdentifier | ) |
Constructs and sends a message on the telemetry socket, indicating that a node has finished execution.
void sendNodeExecutionStarted | ( | char * | nodeIdentifier | ) |
Constructs and sends a message on the telemetry socket, indicating that a node has started execution.
void sendOutputPortsUpdated | ( | char * | portIdentifier, |
bool | sentData, | ||
char * | portDataSummary | ||
) |
Constructs and sends a message on the telemetry socket, indicating that an output port has transmitted or fired an event.
void sendPublishedOutputPortsUpdated | ( | char * | portIdentifier, |
bool | sentData, | ||
char * | portDataSummary | ||
) |
Constructs and sends a message on the telemetry socket, indicating that a published output port has transmitted an event.
void setPublishedInputPortValue | ( | char * | portIdentifier, |
char * | valueAsString | ||
) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
|
static |
This function is called when the composition receives a stop request (VuoControlRequestCompositionStop), or when the a node or library requests a clean shutdown (VuoStopComposition).
Stop requests are sent both when VuoRunner::stop is called, and during live-coding reloads (so, in the latter case, the composition process will resume after this function is called).
This function may only be called on dispatch queue VuoControlQueue
.
void vuoAddCompositionFiniCallback | ( | VuoCompositionFiniCallback | fini | ) |
Registers a callback to be invoked when the composition is shutting down, after all nodes have been fini'd.
Libraries should call the wrapper VuoAddCompositionFiniCallback.
void vuoCleanup | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
|
static |
This function may only be called on dispatch queue VuoControlQueue
.
void vuoFini | ( | void | ) |
Cleans up composition execution: closes the ZMQ sockets and dispatch source and queues.
Assumes the composition has received and replied to a VuoControlRequestCompositionStop
message.
char* vuoGetPortValue | ( | char * | portIdentifier, |
int | serializationType | ||
) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
void VuoHeap_report | ( | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
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, | ||
void * | _VuoCompositionFiniCallbackList | ||
) |
Sets up ZMQ control and telemetry sockets, then calls the generated function vuoSetup()
.
If the composition is not paused, also calls vuoInstanceInit()
and vuoInstanceTriggerStart()
.
void vuoInstanceFini | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
void vuoInstanceInit | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
void vuoInstanceTriggerStart | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
void vuoInstanceTriggerStop | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
char* VuoRuntime_mergeEnumDetails | ( | string | type, |
char * | details | ||
) |
If type
is an enum, merges the allowed enum values into details
and returns it (caller responsible for freeing).
Otherwise, returns NULL.
char* vuoSerializeTelemetryState | ( | void | ) |
Serializes the variables controlling telemetry-sending to a JSON-formatted string.
void vuoSetInputPortValue | ( | char * | portIdentifier, |
char * | valueAsString | ||
) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
void vuoSetup | ( | void | ) |
Sends a telemetry error with information about any objects remaining in the reference counting table.
bool vuoShouldSendPortDataTelemetry | ( | const char * | portIdentifier | ) |
Returns true if telemetry containing the port data summary should be sent for this port.
void vuoStopComposition | ( | 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 vuoTelemetrySend | ( | enum VuoTelemetry | type, |
zmq_msg_t * | messages, | ||
unsigned int | messageCount | ||
) |
This function may be called from any thread.
void vuoUnserializeTelemetryState | ( | char * | serialized | ) |
Unserializes the variables controlling telemetry-sending from a JSON-formatted string.
char* compositionDiff |
Differences between the old and new composition, when replacing compositions for live coding.
|
static |
Signaled when control events are no longer being processed.
|
static |
Timer for receiving control messages.
|
static |
True if node execution was unpaused initially, or if it has since been unpaused.
bool hasZMQConnection = false |
True if the ZMQControl and ZMQTelemetry sockets are connected to something.
bool isPaused |
True if node execution is currently paused.
|
static |
True if all telemetry should be sent.
|
static |
True if all telemetry about events (not including data) should be sent.
bool isStopped |
True if composition execution has stopped.
True if the composition has stopped.
bool isStopRequested |
True if vuoStopComposition() has been called.
|
static |
Port identifiers for which data-and-event telemetry should be sent.
|
static |
Process ID of the runner that started the composition.
|
static |
Signaled when telemetry events are no longer being processed.
|
static |
Timer for sending telemetry messages.
VuoCompositionFiniCallbackListType* VuoCompositionFiniCallbackList |
Fini callbacks to invoke upon composition shutdown. Non-static, so that VuoCompositionLoader can fetch and restore it during live-coding reloads.
|
static |
Serializes access to the list of fini callbacks.
|
static |
Ensures stops happen serially.
|
static |
Dispatch queue for protecting access to the ZMQControl
socket.
|
static |
Dispatch queue for protecting access to the ZMQTelemetry
socket.
|
static |
Signaled when no longer checking if the runner will stop the composition.
|
static |
Timer for checking if the runner will stop the composition.
|
static |
Prevents the composition from being finalized twice.
|
static |
The context used to initialize sockets.
|
static |
The control socket. Use only on VuoControlQueue.
|
static |
Used to break out of a ZMQControl poll.
|
static |
Used to break out of a ZMQControl poll.
|
static |
The telemetry socket. Use only on VuoTelemetryQueue.