LibTiePie  0.9.16
Library for interfacing TiePie engineering instruments
Pointer array

Description

Functions for handling arrays of pointers.

The function ScpGetData() uses a pointer to a buffer with pointers to buffers for the channel data. Not all programming/scripting languages can handle pointers to pointers properly. These functions can then be used to work around that issue.

Example
In pseudocode:
buffers = empty list/array
pointerArray = HlpPointerArrayNew( channelCount )
for i = 0 to channelCount - 1
if ScpChGetEnabled( handle , i )
buffers[ i ] = allocate buffer/array
HlpPointerArraySet( pointerArray , i , pointer of buffers[ i ] )
end
end
ScpGetData( handle , pointerArray , channelCount , ... )
HlpPointerArrayDelete( pointerArray )
The data is now available in buffers.
See also
ScpGetData

Functions

LibTiePiePointerArray_t HlpPointerArrayNew (uint32_t dwLength)
 Create a new pointer array. More...
 
void HlpPointerArraySet (LibTiePiePointerArray_t pArray, uint32_t dwIndex, void *pPointer)
 Set a pointer at a specified index in a specified pointer array. More...
 
void HlpPointerArrayDelete (LibTiePiePointerArray_t pArray)
 Delete an existing pointer array. More...
 

Function Documentation

LibTiePiePointerArray_t HlpPointerArrayNew ( uint32_t  dwLength)

Create a new pointer array.

The pointer array is initialized with NULL pointers.

Parameters
[in]dwLengthThe requested length of the pointer array, 1 .. LIBTIEPIE_POINTER_ARRAY_MAX_LENGTH.
Returns
A pointer to the pointer array.
Status values
INVALID_VALUEThe requested length is invalid.
UNSUCCESSFUL An error occurred during execution of the last called function.
SUCCESS The function executed successfully.
Since
0.4.1
void HlpPointerArraySet ( LibTiePiePointerArray_t  pArray,
uint32_t  dwIndex,
void *  pPointer 
)

Set a pointer at a specified index in a specified pointer array.

Parameters
[in]pArrayA pointer identifying the pointer array.
[in]dwIndexThe requested array index.
[in]pPointerThe pointer value to set.
Status values
UNSUCCESSFULThe pointer to the array is invalid.
SUCCESS The function executed successfully.
Since
0.4.1
void HlpPointerArrayDelete ( LibTiePiePointerArray_t  pArray)

Delete an existing pointer array.

Parameters
[in]pArrayA pointer identifying the pointer array.
Status values
SUCCESSThe function executed successfully.
Since
0.4.1