Defines the Scalar Object interface.
|
typedef struct _vx_scalar * | vx_scalar |
| An opaque reference to a scalar [R01409]. More...
|
|
◆ vx_scalar
An opaque reference to a scalar [R01409].
A scalar can be up to 64 bits wide [R01410].
- See also
- vxCreateScalar
Definition at line 183 of file vx_types.h.
◆ vxCreateScalar()
Creates a reference to a scalar object [R00828]. Also see Node Parameters.
- Parameters
-
[in] | context | The reference to the system context [R00829]. |
[in] | data_type | The type of the scalar. Must be greater than VX_TYPE_INVALID and less than VX_TYPE_SCALAR_MAX [R00830]. |
[in] | ptr | The pointer to the initial value of the scalar [R00831]. |
- Returns
- A scalar reference
vx_scalar
[R00832]. Any possible errors preventing a successful creation should be checked using vxGetStatus
.
◆ vxReleaseScalar()
Releases a reference to a scalar object [R00833]. The object may not be garbage collected until its total reference count is zero.
- Parameters
-
[in] | scalar | The pointer to the scalar to release [R00834]. |
- Postcondition
- After returning from this function the reference is zeroed [R00835].
- Returns
- A
The vx_status Constants
value.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure [R00836]. |
VX_ERROR_INVALID_REFERENCE | scalar is not a valid vx_scalar reference. |
◆ vxQueryScalar()
Queries attributes from a scalar [R00837].
- Parameters
-
[in] | scalar | The scalar object [R00838]. |
[in] | attribute | The attribute to query, use a The Scalar Attributes Constants value. [R00839]. |
[out] | ptr | The location at which to store the resulting value [R00840]. |
[in] | size | The size of the container to which ptr points [R00841]. |
- Returns
- A
The vx_status Constants
value.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure [R00842]. |
VX_ERROR_INVALID_REFERENCE | scalar is not a valid vx_scalar reference. |
◆ vxCopyScalar()
Allows the application to copy from/into a scalar object [R00843].
- Parameters
-
[in] | scalar | The reference to the scalar object that is the source or the destination of the copy [R00844]. |
[in] | user_ptr | The address of the memory location where to store the requested data if the copy was requested in read mode, or from where to get the data to store into the scalar object if the copy was requested in write mode [R00845]. In the user memory, the scalar is a variable of the type corresponding to VX_SCALAR_TYPE . The accessible memory must be large enough to contain this variable. |
[in] | usage | This declares the effect of the copy with regard to the scalar object [R00846]. using the The memory accessor hint flags. value. Only VX_READ_ONLY and VX_WRITE_ONLY are supported [R00847]:
VX_READ_ONLY means that data are copied from the scalar object into the user memory [R00848].
VX_WRITE_ONLY means that data are copied into the scalar object from the user memory [R00849].
|
[in] | user_mem_type | A Memory import type constants. value that specifies the memory type of the memory referenced by the user_addr [R00850]. |
- Returns
- A
The vx_status Constants
value.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure [R00851]. |
VX_ERROR_INVALID_REFERENCE | scalar is not a valid vx_scalar reference. |
VX_ERROR_INVALID_PARAMETERS | An other parameter is incorrect. |