Defines the Reference Object interface.
All objects in OpenVX are derived (in the object-oriented sense) from vx_reference
. All objects shall be able to be cast back to this type safely [R00122].
|
typedef struct _vx_reference * | vx_reference |
| A generic opaque reference to any object within OpenVX. More...
|
|
|
vx_status VX_API_CALL | vxQueryReference (vx_reference ref, vx_enum attribute, void *ptr, vx_size size) |
| Queries any reference type for some basic information like count or type [R00852]. More...
|
|
vx_status VX_API_CALL | vxReleaseReference (vx_reference *ref_ptr) |
| Releases a reference [R00858]. The reference may potentially refer to multiple OpenVX objects of different types. This function can be used instead of calling a specific release function for each individual object type (e.g. vxRelease<object>). The object will not be destroyed until its total reference count is zero. More...
|
|
vx_status VX_API_CALL | vxRetainReference (vx_reference ref) |
| Increments the reference counter of an object [R00862]. This function is used to express the fact that the OpenVX object is referenced multiple times by an application. Each time this function is called for an object, the application will need to release the object one additional time before it can be destructed. More...
|
|
vx_status VX_API_CALL | vxSetReferenceName (vx_reference ref, const vx_char *name) |
| Name a reference. This function is used to associate a name to a referenced object [R00865]. This name can be used by the OpenVX implementation in log messages and any other reporting mechanisms. More...
|
|
◆ VX_MAX_REFERENCE_NAME
#define VX_MAX_REFERENCE_NAME (64) |
Defines the length of the reference name string, including the trailing zero [R01654].
- See also
- vxSetReferenceName
Definition at line 56 of file vx.h.
◆ vx_reference
A generic opaque reference to any object within OpenVX.
A user of OpenVX should not assume that this can be cast directly to anything; however, any object in OpenVX can be cast back to this for the purposes of querying attributes of the object or for passing the object as a parameter to functions that take a vx_reference
type. If the API does not take that specific type but may take others, an error may be returned from the API.
Definition at line 153 of file vx_types.h.
◆ vxQueryReference()
Queries any reference type for some basic information like count or type [R00852].
- Parameters
-
[in] | ref | The reference to query [R00853]. |
[in] | attribute | The value for which to query. Use Reference Attribute Constants [R00854]. |
[out] | ptr | The location at which to store the resulting value [R00855]. |
[in] | size | The size in bytes of the container to which ptr points [R00856]. |
- Returns
- A
The vx_status Constants
value.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure [R00857]. |
VX_ERROR_INVALID_REFERENCE | ref is not a valid vx_reference reference. |
◆ vxReleaseReference()
Releases a reference [R00858]. The reference may potentially refer to multiple OpenVX objects of different types. This function can be used instead of calling a specific release function for each individual object type (e.g. vxRelease<object>). The object will not be destroyed until its total reference count is zero.
- Note
- After returning from this function the reference is zeroed [R00859].
- Parameters
-
[in] | ref_ptr | The pointer to the reference of the object to release [R00860]. |
- Returns
- A
The vx_status Constants
value.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure [R00861]. |
VX_ERROR_INVALID_REFERENCE | ref_ptr is not a valid vx_reference reference. |
◆ vxRetainReference()
Increments the reference counter of an object [R00862]. This function is used to express the fact that the OpenVX object is referenced multiple times by an application. Each time this function is called for an object, the application will need to release the object one additional time before it can be destructed.
- Parameters
-
[in] | ref | The reference to retain [R00863]. |
- Returns
- A
The vx_status Constants
value.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure [R00864]. |
VX_ERROR_INVALID_REFERENCE | ref is not a valid vx_reference reference. |
◆ vxSetReferenceName()
Name a reference. This function is used to associate a name to a referenced object [R00865]. This name can be used by the OpenVX implementation in log messages and any other reporting mechanisms.
The OpenVX implementation will not check if the name is unique in the reference scope (context or graph). Several references can then have the same name.
- Parameters
-
[in] | ref | The reference to the object to be named [R00866]. |
[in] | name | Pointer to the '\0' terminated string that identifies the referenced object [R00867]. The string is copied by the function so that it stays the property of the caller [R00868]. NULL means that the reference is not named [R00869]. The length of the string shall be lower than VX_MAX_REFERENCE_NAME bytes [R00870]. |
- Returns
- A
The vx_status Constants
value.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure [R00871]. |
VX_ERROR_INVALID_REFERENCE | ref is not a valid vx_reference reference. |