ANSI C Based OPC UA Client/Server SDK  1.9.0.430
UaBaseTurboVector

Data Structures

struct  UaBase_TurboVector
 TurboVector structure. More...
 

Functions

OpcUa_StatusCode UaBase_TurboVector_Initialize (UaBase_TurboVector *pV, unsigned int size, unsigned int grow)
 Initializes the vector structure. More...
 
OpcUa_Void UaBase_TurboVector_Clear (UaBase_TurboVector *pV)
 Clears the vector structure. More...
 
unsigned int UaBase_TurboVector_Add (UaBase_TurboVector *pV, OpcUa_Void *pData)
 Adds an element to the vector. More...
 
OpcUa_Void * UaBase_TurboVector_RemoveAt (UaBase_TurboVector *pV, unsigned int iIndex)
 Removes an element from the vector at the given index. More...
 
OpcUa_StatusCode UaBase_TurboVector_Set (UaBase_TurboVector *pV, unsigned int iIndex, OpcUa_Void *pData)
 Sets an element at the given index. More...
 
OpcUa_Void * UaBase_TurboVector_Get (UaBase_TurboVector *pV, unsigned int iIndex)
 Returns the value at the given index. More...
 
OpcUa_Void * UaBase_TurboVector_GetNext (UaBase_TurboVector *pV, unsigned int *pIndex)
 Returns the value at or next to the given index. More...
 
unsigned int UaBase_TurboVector_GetSize (UaBase_TurboVector *pV)
 Returns the current size of the vector. More...
 
unsigned int UaBase_TurboVector_GetNoOfItems (UaBase_TurboVector *pV)
 Returns the current size of the vector. More...
 

Detailed Description

Function Documentation

unsigned int UaBase_TurboVector_Add ( UaBase_TurboVector pV,
OpcUa_Void *  pData 
)

Adds an element to the vector.

This method can let the vector grow.

Parameters
pVPointer to the vector object to work on.
pData[in] The data for the Vector generation.
Returns
the index of the newly added element or UABASE_VECTOR_INVALID_HANDLE on error.
OpcUa_Void UaBase_TurboVector_Clear ( UaBase_TurboVector pV)

Clears the vector structure.

Parameters
pVPointer to the vector object to work on.
OpcUa_Void * UaBase_TurboVector_Get ( UaBase_TurboVector pV,
unsigned int  iIndex 
)

Returns the value at the given index.

Parameters
pVPointer to the vector object to work on.
iIndexindex where the value is stored.
OpcUa_Void * UaBase_TurboVector_GetNext ( UaBase_TurboVector pV,
unsigned int *  pIndex 
)

Returns the value at or next to the given index.

Parameters
pVPointer to the vector object to work on.
pIndexindex to start the search from, will be set to the index of the returned value or to 0 if no next value exists.
unsigned int UaBase_TurboVector_GetNoOfItems ( UaBase_TurboVector pV)

Returns the current size of the vector.

Parameters
pVPointer to the vector object to work on.
Returns
the current size of the vector.
unsigned int UaBase_TurboVector_GetSize ( UaBase_TurboVector pV)

Returns the current size of the vector.

Parameters
pVPointer to the vector object to work on.
Returns
the current size of the vector.
OpcUa_StatusCode UaBase_TurboVector_Initialize ( UaBase_TurboVector pV,
unsigned int  size,
unsigned int  grow 
)

Initializes the vector structure.

The vector is an array like container that can grow dynamically. It stores pointers to objects.

Parameters
pVPointer to the vector object to work on.
sizeInitial size of the vector in number of elements, not bytes.
growThe number of elements the vector should grow when it needs to be reallocated.
OpcUa_Void * UaBase_TurboVector_RemoveAt ( UaBase_TurboVector pV,
unsigned int  iIndex 
)

Removes an element from the vector at the given index.

Parameters
pVPointer to the vector object to work on.
iIndexindex where the value is stored.
OpcUa_StatusCode UaBase_TurboVector_Set ( UaBase_TurboVector pV,
unsigned int  iIndex,
OpcUa_Void *  pData 
)

Sets an element at the given index.

This method doesn't change the size of the vector. It's up to you to write to a valid index.

Parameters
pVPointer to the vector object to work on.
iIndexindex where the value is stored.
pData[in] The data for the Vector generation.