VPI - Vision Programming Interface

0.4.4 Release

User-Defined Function

Submits a user-defined function to be executed on the stream. More...

Typedefs

typedef void(* VPIHostFunction) (void *hostData)
 Pointer to a host function. More...
 
typedef VPIStatus(* VPIHostFunctionEx) (VPIStatus status, void *hostData)
 Pointer to a host function that handles stream status. More...
 

Functions

VPIStatus vpiSubmitHostFunction (VPIStream stream, VPIHostFunction hostFunc, void *hostData)
 Pushes a command that will invoke a custom host-side function after all prior commands have been processed. More...
 
VPIStatus vpiSubmitHostFunctionEx (VPIStream stream, VPIHostFunctionEx hostFunc, void *hostData)
 Pushes a command that will invoke a custom host-side function after all prior commands have been processed. More...
 

Detailed Description

Submits a user-defined function to be executed on the stream.

Typedef Documentation

◆ VPIHostFunction

typedef void(* VPIHostFunction) (void *hostData)

#include <vpi/HostFunction.h>

Pointer to a host function.

Parameters
hostData[in] callback data

Definition at line 86 of file HostFunction.h.

◆ VPIHostFunctionEx

typedef VPIStatus(* VPIHostFunctionEx) (VPIStatus status, void *hostData)

#include <vpi/HostFunction.h>

Pointer to a host function that handles stream status.

Parameters
hostData[in] callback data

Definition at line 108 of file HostFunction.h.

Function Documentation

◆ vpiSubmitHostFunction()

VPIStatus vpiSubmitHostFunction ( VPIStream  stream,
VPIHostFunction  hostFunc,
void *  hostData 
)

#include <vpi/HostFunction.h>

Pushes a command that will invoke a custom host-side function after all prior commands have been processed.

The execution of commands submitted after this call is suspended until the callback is finished. The function will be executed at most once. It won't be executed if a previous stream task failed.

Parameters
stream[in] a stream handle
hostFunc[in] Pointer to the host function to be executed.
hostData[in] pointer that will be passed unchanged to the user function
Returns
an error code on failure else VPI_SUCCESS

◆ vpiSubmitHostFunctionEx()

VPIStatus vpiSubmitHostFunctionEx ( VPIStream  stream,
VPIHostFunctionEx  hostFunc,
void *  hostData 
)

#include <vpi/HostFunction.h>

Pushes a command that will invoke a custom host-side function after all prior commands have been processed.

The execution of commands submitted after this call is suspended until the callback is finished. The function is guaranteed to be executed exactly once. In case the stream is in error state, the corresponding error status will be passed to hostFunc. The error state can either be maintained by returning the same status, changed to another status, or, if returning VPI_SUCCESS, the error state will be reset.

Parameters
stream[in] a stream handle
hostFunc[in] Pointer to the host function to be executed.
hostData[in] pointer that will be passed unchanged to the user function
Returns
an error code on failure else VPI_SUCCESS