oms_buffer_access()
Abstract
Returns the object that is in position index in the specified buffer, if such an element exists. In this case, the time at which the element was inserted is also returned to the invoker.
Syntax
oms_buffer_access (buffer_handle, index, insertion_time_ptr)
| Argument | Type | Description |
|---|---|---|
buffer_handle |
OmsT_Buffer_Handle |
buffer object |
index |
int |
0-based index of element to access in the buffer |
insertion_time_ptr |
double * |
insertion time of accessed element, filled in by function |
Return Type
void *
Object that is in position index, or OPC_NIL if invalid index.
Details
This function returns the element stored in the buffer at the index position. The head of the buffer is index 0. The next element is index 1, and so on.
If the index is greater than or equal to the number of elements, or if the index is a negative value, a null pointer is returned and the insertion_time_ptr argument is not filled in.
The number of elements in the buffer is obtained using the oms_buffer_num_elements_get() function.