UaServer_Vector


Data Structures

struct  _UaServer_Vector
 Vector structure. More...

Functions

OpcUa_Void UaServer_Vector_Initialize (UaServer_Vector *pV, OpcUa_UInt size, OpcUa_UInt grow)
 Initializes the vector structure.
OpcUa_Void UaServer_Vector_Clear (UaServer_Vector *pV)
 Clears the vector structure.
OpcUa_UInt UaServer_Vector_Add (UaServer_Vector *pV, OpcUa_Void *pData)
 Adds an element to the vector.
OpcUa_Void UaServer_Vector_Set (UaServer_Vector *pV, OpcUa_UInt index, OpcUa_Void *pData)
 Sets an element at the given index.
OpcUa_Void * UaServer_Vector_Get (UaServer_Vector *pV, OpcUa_UInt index)
 Returns the value at the given index.
OpcUa_UInt UaServer_Vector_GetSize (UaServer_Vector *pV)
 Returns the current size of the vector.
OpcUa_Void UaServer_Vector_Resize (UaServer_Vector *pV, OpcUa_UInt size)
 Resize the vector.

Function Documentation

OpcUa_UInt UaServer_Vector_Add ( UaServer_Vector pV,
OpcUa_Void *  pData 
)

Adds an element to the vector.

This method can let the vector grow.

Parameters:
pV Pointer to the vector object to work on.
pData [in] The data for the Vector generation.
Returns:
the vector with the new added element.

void UaServer_Vector_Clear ( UaServer_Vector pV  ) 

Clears the vector structure.

Parameters:
pV Pointer to the vector object to work on.

OpcUa_Void* UaServer_Vector_Get ( UaServer_Vector pV,
OpcUa_UInt  index 
)

Returns the value at the given index.

Parameters:
pV Pointer to the vector object to work on.
index index where the value is stored.

unsigned int UaServer_Vector_GetSize ( UaServer_Vector pV  ) 

Returns the current size of the vector.

Parameters:
pV Pointer to the vector object to work on.
Returns:
the current size of the vector.

OpcUa_Void UaServer_Vector_Initialize ( UaServer_Vector pV,
OpcUa_UInt  size,
OpcUa_UInt  grow 
)

Initializes the vector structure.

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

Parameters:
pV Pointer to the vector object to work on.
size Initial size of the vector in number of elements, not bytes.
grow The number of elements the vector should grow when it needs to be reallocated.

OpcUa_Void UaServer_Vector_Resize ( UaServer_Vector pV,
OpcUa_UInt  size 
)

Resize the vector.

Parameters:
pV Pointer to the vector object to work on.
size Initial size of the vector in number of elements, not bytes.

OpcUa_Void UaServer_Vector_Set ( UaServer_Vector pV,
OpcUa_UInt  index,
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:
pV Pointer to the vector object to work on.
index index where the value is stored.
pData [in] The data for the Vector generation.