The OpenVX Specification  a73e458
Object: Context

Detailed Description

Defines the Context Object Interface.

The OpenVX context is the object domain for all OpenVX objects. All data objects live in the context as well as all framework objects. The OpenVX context keeps reference counts on all objects and must do garbage collection during its deconstruction to free lost references. While multiple clients may connect to the OpenVX context, all data are private in that the references referring to data objects are given only to the creating party.

Modules

 Memory import type constants.
 An enumeration of memory import types.
 
 The termination criteria list.
 
 The memory accessor hint flags.
 The memory accessor hint flags. These enumeration values are used to indicate desired system behavior, not the User intent. For example: these can be interpretted as hints to the system about cache operations or marshalling operations.
 
 The Round Policy Enumeration.
 The Round Policy Enumeration.
 

Macros

#define VX_MAX_IMPLEMENTATION_NAME   (64)
 Defines the length of the implementation name string, including the trailing zero [R01651].
 

Typedefs

typedef struct _vx_context * vx_context
 An opaque reference to the implementation context. More...
 

Functions

vx_context VX_API_CALL vxCreateContext (void)
 Creates a vx_context. More...
 
vx_context VX_API_CALL vxGetContext (vx_reference reference)
 Retrieves the context from any reference from within a context. More...
 
vx_status VX_API_CALL vxQueryContext (vx_context context, vx_enum attribute, void *ptr, vx_size size)
 Queries the context for some specific information. More...
 
vx_status VX_API_CALL vxReleaseContext (vx_context *context)
 Releases the OpenVX object context. More...
 
vx_status VX_API_CALL vxSetContextAttribute (vx_context context, vx_enum attribute, const void *ptr, vx_size size)
 Sets an attribute on the context. More...
 

Typedef Documentation

◆ vx_context

typedef struct _vx_context* vx_context

An opaque reference to the implementation context.

See also
vxCreateContext

Definition at line 226 of file vx_types.h.

Function Documentation

◆ vxCreateContext()

vx_context VX_API_CALL vxCreateContext ( void  )

Creates a vx_context.

This creates a top-level object context for OpenVX [R00444].

Note
This is required to do anything else.
Returns
The reference to the implementation context vx_context [R00445]. Any possible errors preventing a successful creation should be checked using vxGetStatus [R00446].
Postcondition
vxReleaseContext

◆ vxReleaseContext()

vx_status VX_API_CALL vxReleaseContext ( vx_context context)

Releases the OpenVX object context.

All reference counted objects are garbage-collected by the return of this call. No calls are possible using the parameter context after the context has been released until a new reference from vxCreateContext is returned [R00447]. All outstanding references to OpenVX objects from this context are invalid after this call.

Parameters
[in]contextThe pointer to the reference to the context [R00448].
Postcondition
After returning from this function the reference is zeroed [R00449].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00450].
VX_ERROR_INVALID_REFERENCEcontext is not a valid vx_context reference.
Precondition
vxCreateContext

◆ vxGetContext()

vx_context VX_API_CALL vxGetContext ( vx_reference  reference)

Retrieves the context from any reference from within a context.

Parameters
[in]referenceThe reference from which to extract the context [R00451].
Returns
The overall context that created the particular reference [R00452]. Any possible errors preventing a successful completion of this function should be checked using vxGetStatus [R00453].

◆ vxQueryContext()

vx_status VX_API_CALL vxQueryContext ( vx_context  context,
vx_enum  attribute,
void *  ptr,
vx_size  size 
)

Queries the context for some specific information.

Parameters
[in]contextThe reference to the context [R00454].
[in]attributeThe attribute to query. Use a Context Attribute Constants [R00455].
[out]ptrThe location at which to store the resulting value [R00456].
[in]sizeThe size in bytes of the container to which ptr points [R00457].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00458].
VX_ERROR_INVALID_REFERENCEcontext is not a valid vx_context reference.
VX_ERROR_INVALID_PARAMETERSIf any of the other parameters are incorrect.
VX_ERROR_NOT_SUPPORTEDIf the attribute is not supported on this implementation.

◆ vxSetContextAttribute()

vx_status VX_API_CALL vxSetContextAttribute ( vx_context  context,
vx_enum  attribute,
const void *  ptr,
vx_size  size 
)

Sets an attribute on the context.

Parameters
[in]contextThe handle to the overall context [R00459].
[in]attributeThe attribute to set from Context Attribute Constants [R00460].
[in]ptrThe pointer to the data to which to set the attribute [R00461].
[in]sizeThe size in bytes of the data to which ptr points [R00462].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00463].
VX_ERROR_INVALID_REFERENCEcontext is not a valid vx_context reference.
VX_ERROR_INVALID_PARAMETERSIf any of the other parameters are incorrect.
VX_ERROR_NOT_SUPPORTEDIf the attribute is not settable.