Vuo
1.2.0
|
A trigger output port.
Public Member Functions | |
VuoCompilerTriggerPort (VuoPort *basePort) | |
Creates a trigger port based on portClass . | |
Value * | generateCreatePortContext (Module *module, BasicBlock *block) |
Generates code to create a heap-allocated PortContext, with the triggerQueue and triggerSemaphore initialized. | |
Function * | generateSynchronousSubmissionToDispatchQueue (Module *module, BasicBlock *block, Value *nodeContextValue, string workerFunctionName, Value *workerFunctionArg=NULL) |
Generates code to submit a task to this trigger's dispatch queue. | |
Function * | getWorkerFunction (Module *module, string functionName, bool isExternal=false) |
Returns a function of type dispatch_function_t . | |
void | generateSignalForSemaphore (Module *module, BasicBlock *block, Value *nodeContextValue) |
Generates code to signal the trigger's semaphore. | |
Value * | generateLoadFunction (Module *module, BasicBlock *block, Value *nodeContextValue) |
Generates code to get the function pointer for the trigger scheduler function. | |
void | generateStoreFunction (Module *module, BasicBlock *block, Value *nodeContextValue, Value *functionValue) |
Generates code to set the function pointer for the trigger scheduler function. | |
Value * | generateLoadPreviousData (Module *module, BasicBlock *block, Value *nodeContextValue) |
Generates code to get the data most recently fired from the trigger. | |
void | generateFreeContext (Module *module, BasicBlock *block, Function *workerFunction) |
Generates code to deallocate the context and its contents created by generateAsynchronousSubmissionToDispatchQueue() and passed to workerFunction. | |
Value * | generateCompositionIdentifierValue (Module *module, BasicBlock *block, Function *workerFunction) |
Generates code to get the composition identifier from the context created by generateAsynchronousSubmissionToDispatchQueue() and passed to workerFunction. | |
Value * | generateDataValue (Module *module, BasicBlock *block, Function *workerFunction) |
Generates code to get the trigger data value from the context created by generateAsynchronousSubmissionToDispatchQueue() and passed to workerFunction. | |
Value * | generateDataValueUpdate (Module *module, BasicBlock *block, Function *workerFunction, Value *nodeContextValue) |
Generates code to update the trigger's data value (if any) with the worker function argument. | |
void | generateDataValueDiscardFromWorker (Module *module, BasicBlock *block, Function *workerFunction) |
Generates code to discard the data value in the worker function argument without updating the trigger's data value. | |
Type * | getDataType (void) |
Returns the type of data associated with the trigger, or NULL if the trigger is event-only. | |
VuoCompilerTriggerPortClass * | getClass (void) |
Returns the trigger port class of this trigger port. | |
![]() | |
bool | hasConnectedCable (void) const |
Returns a boolean indicating whether this port has any attached cables. | |
bool | hasConnectedDataCable (void) const |
Returns a boolean indicating whether this port has any attached data+event cables. | |
VuoType * | getDataVuoType (void) |
Returns this port's data type, or null if this port is event-only. | |
void | setDataVuoType (VuoType *dataType) |
Sets the data type for this port, overriding the type from the port class. | |
void | setNodeIdentifier (string nodeIdentifier) |
Sets an identifier that will be part of the string returned by getIdentifier(). | |
virtual string | getIdentifier (void) |
Returns a unique, consistent identifier for this port. | |
void | setIndexInPortContexts (int indexInPortContexts) |
Sets the index of this node within the array of port contexts within the node context. | |
int | getIndexInPortContexts (void) |
Returns the index of this node within the array of port contexts within the node context. | |
void | setConstantStringCache (VuoCompilerConstantStringCache *constantStrings) |
Sets the cache used to generate constant string values. | |
Value * | getDataVariable (Module *module, BasicBlock *block, Value *nodeContextValue) |
Returns the address of the data field within this port's context. | |
Value * | generateGetPortContext (Module *module, BasicBlock *block, Value *nodeContextValue) |
Returns this port's context. | |
![]() | |
virtual | ~VuoCompilerNodeArgument (void) |
Destructor. | |
![]() | |
VuoBaseDetail (string description, VuoPort *base) | |
Creates a VuoNode detail class. | |
VuoPort * | getBase (void) const |
Returns the VuoNode detail class instance's base class instance. | |
void | setBase (VuoPort *base) |
Sets the VuoNode detail class instance's base class instance. | |
Static Public Member Functions | |
static void | generateAsynchronousSubmissionToDispatchQueue (Module *module, Function *function, BasicBlock *block, Value *compositionIdentifierValue, Value *portContextValue, VuoType *dataType, Function *workerFunction) |
Generates code to submit a task to this trigger's dispatch queue. | |
static Value * | generateNonBlockingWaitForSemaphore (Module *module, BasicBlock *block, Value *portContextValue) |
Generates code to try to claim the trigger's semaphore. | |
static void | generateDataValueDiscardFromScheduler (Module *module, Function *function, BasicBlock *block, VuoType *dataType) |
Generates code to discard the scheduler function argument without updating the trigger's data value. | |
Additional Inherited Members | |
![]() | |
VuoCompilerPort (VuoPort *basePort) | |
Creates a compiler detail from a given basePort . | |
![]() | |
VuoCompilerConstantStringCache * | constantStrings |
Cache used to generate constant string values. | |
VuoCompilerTriggerPort::VuoCompilerTriggerPort | ( | VuoPort * | basePort | ) |
Creates a trigger port based on portClass
.
|
static |
Generates code to submit a task to this trigger's dispatch queue.
Returns the worker function, which will be called by the dispatch queue to execute the task. The caller is responsible for filling in the body of the worker function.
Assumes block is inside the function associated with this trigger. Passes the argument of that function, if any, as the context which will be passed to the worker function.
Value * VuoCompilerTriggerPort::generateCompositionIdentifierValue | ( | Module * | module, |
BasicBlock * | block, | ||
Function * | workerFunction | ||
) |
Generates code to get the composition identifier from the context created by generateAsynchronousSubmissionToDispatchQueue() and passed to workerFunction.
|
virtual |
Generates code to create a heap-allocated PortContext, with the triggerQueue
and triggerSemaphore
initialized.
PortContext *
. Implements VuoCompilerPort.
Value * VuoCompilerTriggerPort::generateDataValue | ( | Module * | module, |
BasicBlock * | block, | ||
Function * | workerFunction | ||
) |
Generates code to get the trigger data value from the context created by generateAsynchronousSubmissionToDispatchQueue() and passed to workerFunction.
|
static |
Generates code to discard the scheduler function argument without updating the trigger's data value.
void VuoCompilerTriggerPort::generateDataValueDiscardFromWorker | ( | Module * | module, |
BasicBlock * | block, | ||
Function * | workerFunction | ||
) |
Generates code to discard the data value in the worker function argument without updating the trigger's data value.
Value * VuoCompilerTriggerPort::generateDataValueUpdate | ( | Module * | module, |
BasicBlock * | block, | ||
Function * | workerFunction, | ||
Value * | nodeContextValue | ||
) |
Generates code to update the trigger's data value (if any) with the worker function argument.
void VuoCompilerTriggerPort::generateFreeContext | ( | Module * | module, |
BasicBlock * | block, | ||
Function * | workerFunction | ||
) |
Generates code to deallocate the context and its contents created by generateAsynchronousSubmissionToDispatchQueue() and passed to workerFunction.
Value * VuoCompilerTriggerPort::generateLoadFunction | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | nodeContextValue | ||
) |
Generates code to get the function pointer for the trigger scheduler function.
Value * VuoCompilerTriggerPort::generateLoadPreviousData | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | nodeContextValue | ||
) |
Generates code to get the data most recently fired from the trigger.
|
static |
Generates code to try to claim the trigger's semaphore.
Returns the value returned by dispatch_semaphore_wait
, which can be checked to determine if the semaphore was claimed.
void VuoCompilerTriggerPort::generateSignalForSemaphore | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | nodeContextValue | ||
) |
Generates code to signal the trigger's semaphore.
void VuoCompilerTriggerPort::generateStoreFunction | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | nodeContextValue, | ||
Value * | functionValue | ||
) |
Generates code to set the function pointer for the trigger scheduler function.
Function * VuoCompilerTriggerPort::generateSynchronousSubmissionToDispatchQueue | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | nodeContextValue, | ||
string | workerFunctionName, | ||
Value * | workerFunctionArg = NULL |
||
) |
Generates code to submit a task to this trigger's dispatch queue.
Returns the worker function, which will be called by the dispatch queue to execute the task. The caller is responsible for filling in the body of the worker function.
VuoCompilerTriggerPortClass * VuoCompilerTriggerPort::getClass | ( | void | ) |
Returns the trigger port class of this trigger port.
Type * VuoCompilerTriggerPort::getDataType | ( | void | ) |
Returns the type of data associated with the trigger, or NULL if the trigger is event-only.
Function * VuoCompilerTriggerPort::getWorkerFunction | ( | Module * | module, |
string | functionName, | ||
bool | isExternal = false |
||
) |
Returns a function of type dispatch_function_t
.