VuoRuntimeContext interface.
Definition in file VuoRuntimeContext.hh.
Go to the source code of this file.
Classes | |
struct | PortContext |
Runtime information about a port. More... | |
struct | NodeContext |
Runtime information about a node. More... | |
Functions | |
struct PortContext * | vuoCreatePortContext (void *data, bool isTrigger, const char *triggerQueueName) |
Creates a port context, initializing its fields to default values. More... | |
struct NodeContext * | vuoCreateNodeContext (bool hasInstanceData, bool isComposition, size_t outputEventCount) |
Creates a node context, initializing its fields to default values. More... | |
void | vuoFreePortContext (struct PortContext *portContext) |
Frees the port context and its fields. More... | |
void | vuoFreeNodeContext (struct NodeContext *nodeContext) |
Frees the port context and its fields. More... | |
void | vuoSetPortContextEvent (struct PortContext *portContext, bool event) |
Sets the port context's event field. More... | |
void | vuoSetPortContextData (struct PortContext *portContext, void *data) |
Sets the port context's data field. More... | |
void | vuoSetPortContextTriggerFunction (struct PortContext *portContext, void *triggerFunction) |
Sets the port context's triggerFunction field. More... | |
bool | vuoGetPortContextEvent (struct PortContext *portContext) |
Gets the port context's event field. More... | |
void * | vuoGetPortContextData (struct PortContext *portContext) |
Gets the port context's data field. More... | |
dispatch_queue_t | vuoGetPortContextTriggerQueue (struct PortContext *portContext) |
Gets the port context's triggerQueue field. More... | |
dispatch_semaphore_t | vuoGetPortContextTriggerSemaphore (struct PortContext *portContext) |
Gets the port context's triggerSemaphore field. More... | |
void * | vuoGetPortContextTriggerFunction (struct PortContext *portContext) |
Gets the port context's triggerFunction field. More... | |
void | vuoRetainPortContextData (struct PortContext *portContext) |
Prevents the port context's data field from being freed by vuoFreePortContext() . More... | |
void | vuoSetNodeContextPortContexts (struct NodeContext *nodeContext, struct PortContext **portContexts, unsigned long portContextCount) |
Sets the node context's portContexts and portContextCount fields. More... | |
void | vuoSetNodeContextInstanceData (struct NodeContext *nodeContext, void *instanceData) |
Sets the node context's instanceData field, freeing the previous value. More... | |
void | vuoSetNodeContextClaimingEventId (struct NodeContext *nodeContext, unsigned long claimingEventId) |
Sets the node context's claimingEventId field. More... | |
void | vuoSetNodeContextOutputEvent (struct NodeContext *nodeContext, size_t index, bool event) |
Sets the array element at the given index of the node context's outputEvents field. More... | |
struct PortContext * | vuoGetNodeContextPortContext (struct NodeContext *nodeContext, size_t index) |
Gets the array element at the given index of the node context's portContexts field. More... | |
void * | vuoGetNodeContextInstanceData (struct NodeContext *nodeContext) |
Gets the node context's instanceData field. More... | |
dispatch_semaphore_t | vuoGetNodeContextSemaphore (struct NodeContext *nodeContext) |
Gets the node context's semaphore field. More... | |
unsigned long | vuoGetNodeContextClaimingEventId (struct NodeContext *nodeContext) |
Gets the node context's claimingEventId field. More... | |
dispatch_group_t | vuoGetNodeContextExecutingGroup (struct NodeContext *nodeContext) |
Gets the node context's executingGroup field. More... | |
bool | vuoGetNodeContextOutputEvent (struct NodeContext *nodeContext, size_t index) |
Gets the array element at the given index of the node context's outputEvents field. More... | |
void | vuoResetNodeContextEvents (struct NodeContext *nodeContext) |
Sets the event field to false for all of the port contexts in this node context. More... | |
void | vuoStartedExecutingEvent (struct NodeContext *nodeContext, unsigned long eventId) |
Sets the node context's executingEventIds field to a list containing the given value, clearing out any old values. More... | |
void | vuoSpunOffExecutingEvent (struct NodeContext *nodeContext, unsigned long eventId) |
Adds the given value to the list in the node context's executingEventIds field. More... | |
bool | vuoFinishedExecutingEvent (struct NodeContext *nodeContext, unsigned long eventId) |
Removes the given value from the list in the node context's executingEventIds field if present. More... | |
unsigned long | vuoGetOneExecutingEvent (struct NodeContext *nodeContext) |
Returns the first list item in the node context's executingEventIds field. More... | |
struct PortContext |
struct NodeContext |
Class Members | ||
---|---|---|
unsigned long | claimingEventId | The ID of the event that currently has exclusive claim on the node. |
void * | executingEventIds |
A vector<unsigned long> containing the ID of the event that most recently came in through the composition's published inputs and any events spun off from it. |
void * | executingEventIdsSync |
A std::mutex that synchronizes access to executingEventIds. |
dispatch_group_t | executingGroup | A dispatch group used by the subcomposition's event function to wait for nodes to finish executing. |
void * | instanceData | A pointer to the node's instance data, or null if this node is stateless. |
bool * | outputEvents | An array used by the subcomposition's event function to track events to published output ports, or null if this is not a subcomposition. |
unsigned long | portContextCount |
The number of elements in portContexts . |
struct PortContext ** | portContexts | An array of contexts for input and output ports, or null if this node is a subcomposition. |
dispatch_semaphore_t | semaphore | A semaphore to wait on while a node's event function is executing. |
struct NodeContext* vuoCreateNodeContext | ( | bool | hasInstanceData, |
bool | isComposition, | ||
size_t | outputEventCount | ||
) |
Creates a node context, initializing its fields to default values.
Definition at line 42 of file VuoRuntimeContext.cc.
struct PortContext* vuoCreatePortContext | ( | void * | data, |
bool | isTrigger, | ||
const char * | triggerQueueName | ||
) |
Creates a port context, initializing its fields to default values.
Definition at line 17 of file VuoRuntimeContext.cc.
bool vuoFinishedExecutingEvent | ( | struct NodeContext * | nodeContext, |
unsigned long | eventId | ||
) |
Removes the given value from the list in the node context's executingEventIds field if present.
Returns true if it was present and was the last item in the list.
Definition at line 302 of file VuoRuntimeContext.cc.
void vuoFreeNodeContext | ( | struct NodeContext * | nodeContext | ) |
Frees the port context and its fields.
Definition at line 94 of file VuoRuntimeContext.cc.
void vuoFreePortContext | ( | struct PortContext * | portContext | ) |
Frees the port context and its fields.
Definition at line 80 of file VuoRuntimeContext.cc.
unsigned long vuoGetNodeContextClaimingEventId | ( | struct NodeContext * | nodeContext | ) |
Gets the node context's claimingEventId field.
Definition at line 244 of file VuoRuntimeContext.cc.
dispatch_group_t vuoGetNodeContextExecutingGroup | ( | struct NodeContext * | nodeContext | ) |
Gets the node context's executingGroup field.
Definition at line 252 of file VuoRuntimeContext.cc.
void* vuoGetNodeContextInstanceData | ( | struct NodeContext * | nodeContext | ) |
Gets the node context's instanceData field.
Definition at line 228 of file VuoRuntimeContext.cc.
bool vuoGetNodeContextOutputEvent | ( | struct NodeContext * | nodeContext, |
size_t | index | ||
) |
Gets the array element at the given index of the node context's outputEvents field.
Definition at line 260 of file VuoRuntimeContext.cc.
struct PortContext* vuoGetNodeContextPortContext | ( | struct NodeContext * | nodeContext, |
size_t | index | ||
) |
Gets the array element at the given index of the node context's portContexts field.
Definition at line 220 of file VuoRuntimeContext.cc.
dispatch_semaphore_t vuoGetNodeContextSemaphore | ( | struct NodeContext * | nodeContext | ) |
Gets the node context's semaphore field.
Definition at line 236 of file VuoRuntimeContext.cc.
unsigned long vuoGetOneExecutingEvent | ( | struct NodeContext * | nodeContext | ) |
Returns the first list item in the node context's executingEventIds field.
This is useful for when you know the list contains exactly one item.
Definition at line 320 of file VuoRuntimeContext.cc.
void* vuoGetPortContextData | ( | struct PortContext * | portContext | ) |
Gets the port context's data field.
Definition at line 146 of file VuoRuntimeContext.cc.
bool vuoGetPortContextEvent | ( | struct PortContext * | portContext | ) |
Gets the port context's event field.
Definition at line 138 of file VuoRuntimeContext.cc.
void* vuoGetPortContextTriggerFunction | ( | struct PortContext * | portContext | ) |
Gets the port context's triggerFunction field.
Definition at line 170 of file VuoRuntimeContext.cc.
dispatch_queue_t vuoGetPortContextTriggerQueue | ( | struct PortContext * | portContext | ) |
Gets the port context's triggerQueue field.
Definition at line 154 of file VuoRuntimeContext.cc.
dispatch_semaphore_t vuoGetPortContextTriggerSemaphore | ( | struct PortContext * | portContext | ) |
Gets the port context's triggerSemaphore field.
Definition at line 162 of file VuoRuntimeContext.cc.
void vuoResetNodeContextEvents | ( | struct NodeContext * | nodeContext | ) |
Sets the event field to false for all of the port contexts in this node context.
Definition at line 268 of file VuoRuntimeContext.cc.
void vuoRetainPortContextData | ( | struct PortContext * | portContext | ) |
Prevents the port context's data field from being freed by vuoFreePortContext()
.
Definition at line 178 of file VuoRuntimeContext.cc.
void vuoSetNodeContextClaimingEventId | ( | struct NodeContext * | nodeContext, |
unsigned long | claimingEventId | ||
) |
Sets the node context's claimingEventId field.
Definition at line 204 of file VuoRuntimeContext.cc.
void vuoSetNodeContextInstanceData | ( | struct NodeContext * | nodeContext, |
void * | instanceData | ||
) |
Sets the node context's instanceData field, freeing the previous value.
Definition at line 195 of file VuoRuntimeContext.cc.
void vuoSetNodeContextOutputEvent | ( | struct NodeContext * | nodeContext, |
size_t | index, | ||
bool | event | ||
) |
Sets the array element at the given index of the node context's outputEvents field.
Definition at line 212 of file VuoRuntimeContext.cc.
void vuoSetNodeContextPortContexts | ( | struct NodeContext * | nodeContext, |
struct PortContext ** | portContexts, | ||
unsigned long | portContextCount | ||
) |
Sets the node context's portContexts and portContextCount fields.
Definition at line 186 of file VuoRuntimeContext.cc.
void vuoSetPortContextData | ( | struct PortContext * | portContext, |
void * | data | ||
) |
Sets the port context's data field.
Definition at line 122 of file VuoRuntimeContext.cc.
void vuoSetPortContextEvent | ( | struct PortContext * | portContext, |
bool | event | ||
) |
Sets the port context's event field.
Definition at line 114 of file VuoRuntimeContext.cc.
void vuoSetPortContextTriggerFunction | ( | struct PortContext * | portContext, |
void * | triggerFunction | ||
) |
Sets the port context's triggerFunction field.
Definition at line 130 of file VuoRuntimeContext.cc.
void vuoSpunOffExecutingEvent | ( | struct NodeContext * | nodeContext, |
unsigned long | eventId | ||
) |
Adds the given value to the list in the node context's executingEventIds field.
Definition at line 289 of file VuoRuntimeContext.cc.
void vuoStartedExecutingEvent | ( | struct NodeContext * | nodeContext, |
unsigned long | eventId | ||
) |
Sets the node context's executingEventIds field to a list containing the given value, clearing out any old values.
Definition at line 277 of file VuoRuntimeContext.cc.