ANSI C UA Server SDK  1.6.0.341
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
UaBaseVector

Data Structures

struct  UaBase_Vector
 Vector structure. More...
 

Functions

OpcUa_StatusCode UaBase_Vector_Initialize (UaBase_Vector *pV, unsigned int size, unsigned int grow)
 Initializes the vector structure. More...
 
OpcUa_Void UaBase_Vector_Clear (UaBase_Vector *pV)
 Clears the vector structure. More...
 
unsigned int UaBase_Vector_Add (UaBase_Vector *pV, OpcUa_Void *pData)
 Adds an element to the vector. More...
 
OpcUa_StatusCode UaBase_Vector_RemoveAt (UaBase_Vector *pV, unsigned int iIndex)
 
OpcUa_StatusCode UaBase_Vector_RemoveAt_Ex (UaBase_Vector *pV, unsigned int iIndex)
 Removes an element from the vector at the given index. More...
 
OpcUa_StatusCode UaBase_Vector_Set (UaBase_Vector *pV, unsigned int iIndex, OpcUa_Void *pData)
 Sets an element at the given index. More...
 
OpcUa_Void * UaBase_Vector_Get (UaBase_Vector *pV, unsigned int iIndex)
 Returns the value at the given index. More...
 
unsigned int UaBase_Vector_GetSize (UaBase_Vector *pV)
 Returns the current size of the vector. More...
 
OpcUa_StatusCode UaBase_Vector_Resize (UaBase_Vector *pV, unsigned int size)
 Resize the vector. More...
 

Detailed Description

Function Documentation

unsigned int UaBase_Vector_Add ( UaBase_Vector 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_Vector_Clear ( UaBase_Vector pV)

Clears the vector structure.

Parameters
pVPointer to the vector object to work on.
OpcUa_Void * UaBase_Vector_Get ( UaBase_Vector 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.
unsigned int UaBase_Vector_GetSize ( UaBase_Vector 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_Vector_Initialize ( UaBase_Vector 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_StatusCode UaBase_Vector_RemoveAt ( UaBase_Vector pV,
unsigned int  iIndex 
)
Deprecated:
Removes an element from the vector at the given index.
Note
All items after the removed item will be moved to the left by one element, so all of their indices get changed! We recommend to use the more efficient UaBase_Vector_RemoveAt_Ex
Parameters
pVPointer to the vector object to work on.
iIndexindex where the value is stored.
OpcUa_StatusCode UaBase_Vector_RemoveAt_Ex ( UaBase_Vector pV,
unsigned int  iIndex 
)

Removes an element from the vector at the given index.

Note
The last item will be moved into the position of the removed item, so its index will be changed!
Parameters
pVPointer to the vector object to work on.
iIndexindex where the value is stored.
OpcUa_StatusCode UaBase_Vector_Resize ( UaBase_Vector pV,
unsigned int  size 
)

Resize the vector.

Parameters
pVPointer to the vector object to work on.
sizeNew maximum size of the vector in number of elements.
OpcUa_StatusCode UaBase_Vector_Set ( UaBase_Vector 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.