Vuo  1.2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions
VuoRuntimeContext.c File Reference

Description

VuoRuntimeContext implementation.

Classes

struct  PortContext
 Runtime information about a port. More...
 
struct  NodeContext
 Runtime information about a node. More...
 

Functions

struct PortContextvuoCreatePortContext (void *data, bool isTrigger, const char *triggerQueueName)
 Creates a port context, initializing its fields to default values.
 
struct NodeContextvuoCreateNodeContext (bool hasInstanceData, bool isComposition, size_t outputEventCount)
 Creates a node context, initializing its fields to default values.
 
void vuoFreePortContext (struct PortContext *portContext)
 Frees the port context and its fields.
 
void vuoFreeNodeContext (struct NodeContext *nodeContext)
 Frees the port context and its fields.
 
void vuoSetPortContextEvent (struct PortContext *portContext, bool event)
 Sets the port context's event field.
 
void vuoSetPortContextData (struct PortContext *portContext, void *data)
 Sets the port context's data field.
 
void vuoSetPortContextTriggerFunction (struct PortContext *portContext, void *triggerFunction)
 Sets the port context's triggerFunction field.
 
bool vuoGetPortContextEvent (struct PortContext *portContext)
 Gets the port context's event field.
 
void * vuoGetPortContextData (struct PortContext *portContext)
 Gets the port context's data field.
 
dispatch_queue_t vuoGetPortContextTriggerQueue (struct PortContext *portContext)
 Gets the port context's triggerQueue field.
 
dispatch_semaphore_t vuoGetPortContextTriggerSemaphore (struct PortContext *portContext)
 Gets the port context's triggerSemaphore field.
 
void * vuoGetPortContextTriggerFunction (struct PortContext *portContext)
 Gets the port context's triggerFunction field.
 
void vuoRetainPortContextData (struct PortContext *portContext)
 Prevents the port context's data field from being freed by vuoFreePortContext().
 
void vuoSetNodeContextPortContexts (struct NodeContext *nodeContext, struct PortContext **portContexts, unsigned long portContextCount)
 Sets the node context's portContexts and portContextCount fields.
 
void vuoSetNodeContextInstanceData (struct NodeContext *nodeContext, void *instanceData)
 Sets the node context's instanceData field, freeing the previous value.
 
void vuoSetNodeContextClaimingEventId (struct NodeContext *nodeContext, unsigned long claimingEventId)
 Sets the node context's claimingEventId field.
 
void vuoSetNodeContextExecutingEventId (struct NodeContext *nodeContext, unsigned long executingEventId)
 Sets the node context's executingEventId field.
 
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.
 
struct PortContextvuoGetNodeContextPortContext (struct NodeContext *nodeContext, size_t index)
 Gets the array element at the given index of the node context's portContexts field.
 
void * vuoGetNodeContextInstanceData (struct NodeContext *nodeContext)
 Gets the node context's instanceData field.
 
dispatch_semaphore_t vuoGetNodeContextSemaphore (struct NodeContext *nodeContext)
 Gets the node context's semaphore field.
 
unsigned long vuoGetNodeContextClaimingEventId (struct NodeContext *nodeContext)
 Gets the node context's claimingEventId field.
 
dispatch_group_t vuoGetNodeContextExecutingGroup (struct NodeContext *nodeContext)
 Gets the node context's executingGroup field.
 
unsigned long vuoGetNodeContextExecutingEventId (struct NodeContext *nodeContext)
 Gets the node context's executingEventId field.
 
bool vuoGetNodeContextOutputEvent (struct NodeContext *nodeContext, size_t index)
 Gets the array element at the given index of the node context's outputEvents field.
 
void vuoResetNodeContextEvents (struct NodeContext *nodeContext)
 Sets the event field to false for all of the port contexts in this node context.
 

Class Documentation

struct PortContext
Class Members
void * data A pointer to the port's data, or null if this port is event-only.
bool dataRetained A rudimentary retain system for data. If retained, data won't be freed when the port context is.
bool event Whether this port has just received an event.
void * triggerFunction A function pointer for the trigger scheduler function, or null if this is not a trigger port.
dispatch_queue_t triggerQueue A queue for synchronizing fired events, or null if this is not a trigger port.
dispatch_semaphore_t triggerSemaphore A semaphore for checking if events should be dropped, or null if this is not a trigger port.
struct NodeContext
Class Members
unsigned long claimingEventId The ID of the event that currently has exclusive claim on the node.
unsigned long executingEventId The ID of the most recent event that came from the composition's event function.
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.

Function Documentation

struct NodeContext* vuoCreateNodeContext ( bool  hasInstanceData,
bool  isComposition,
size_t  outputEventCount 
)
read

Creates a node context, initializing its fields to default values.

struct PortContext* vuoCreatePortContext ( void *  data,
bool  isTrigger,
const char *  triggerQueueName 
)
read

Creates a port context, initializing its fields to default values.

void vuoFreeNodeContext ( struct NodeContext nodeContext)

Frees the port context and its fields.

void vuoFreePortContext ( struct PortContext portContext)

Frees the port context and its fields.

unsigned long vuoGetNodeContextClaimingEventId ( struct NodeContext nodeContext)

Gets the node context's claimingEventId field.

unsigned long vuoGetNodeContextExecutingEventId ( struct NodeContext nodeContext)

Gets the node context's executingEventId field.

dispatch_group_t vuoGetNodeContextExecutingGroup ( struct NodeContext nodeContext)

Gets the node context's executingGroup field.

void* vuoGetNodeContextInstanceData ( struct NodeContext nodeContext)

Gets the node context's instanceData field.

bool vuoGetNodeContextOutputEvent ( struct NodeContext nodeContext,
size_t  index 
)

Gets the array element at the given index of the node context's outputEvents field.

struct PortContext* vuoGetNodeContextPortContext ( struct NodeContext nodeContext,
size_t  index 
)
read

Gets the array element at the given index of the node context's portContexts field.

dispatch_semaphore_t vuoGetNodeContextSemaphore ( struct NodeContext nodeContext)

Gets the node context's semaphore field.

void* vuoGetPortContextData ( struct PortContext portContext)

Gets the port context's data field.

bool vuoGetPortContextEvent ( struct PortContext portContext)

Gets the port context's event field.

void* vuoGetPortContextTriggerFunction ( struct PortContext portContext)

Gets the port context's triggerFunction field.

dispatch_queue_t vuoGetPortContextTriggerQueue ( struct PortContext portContext)

Gets the port context's triggerQueue field.

dispatch_semaphore_t vuoGetPortContextTriggerSemaphore ( struct PortContext portContext)

Gets the port context's triggerSemaphore field.

void vuoResetNodeContextEvents ( struct NodeContext nodeContext)

Sets the event field to false for all of the port contexts in this node context.

void vuoRetainPortContextData ( struct PortContext portContext)

Prevents the port context's data field from being freed by vuoFreePortContext().

void vuoSetNodeContextClaimingEventId ( struct NodeContext nodeContext,
unsigned long  claimingEventId 
)

Sets the node context's claimingEventId field.

void vuoSetNodeContextExecutingEventId ( struct NodeContext nodeContext,
unsigned long  executingEventId 
)

Sets the node context's executingEventId field.

void vuoSetNodeContextInstanceData ( struct NodeContext nodeContext,
void *  instanceData 
)

Sets the node context's instanceData field, freeing the previous value.

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.

void vuoSetNodeContextPortContexts ( struct NodeContext nodeContext,
struct PortContext **  portContexts,
unsigned long  portContextCount 
)

Sets the node context's portContexts and portContextCount fields.

void vuoSetPortContextData ( struct PortContext portContext,
void *  data 
)

Sets the port context's data field.

void vuoSetPortContextEvent ( struct PortContext portContext,
bool  event 
)

Sets the port context's event field.

void vuoSetPortContextTriggerFunction ( struct PortContext portContext,
void *  triggerFunction 
)

Sets the port context's triggerFunction field.