UA ANSI C Server Professional  1.4.2.297
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
UaServerVector

Data Structures

struct  _UaServer_Vector
 Vector structure. More...
 

Functions

void UaServer_Vector_Initialize (UaServer_Vector *pV, unsigned int size, unsigned int grow)
 Initializes the vector structure. More...
 
void UaServer_Vector_Clear (UaServer_Vector *pV)
 Clears the vector structure. More...
 
unsigned int UaServer_Vector_Add (UaServer_Vector *pV, void *pData)
 Adds an element to the vector. More...
 
void UaServer_Vector_RemoveAt (UaServer_Vector *pV, unsigned int index)
 Removes an element from the vector at the given index. More...
 
void UaServer_Vector_Set (UaServer_Vector *pV, unsigned int index, void *pData)
 Sets an element at the given index. More...
 
void * UaServer_Vector_Get (UaServer_Vector *pV, unsigned int index)
 Returns the value at the given index. More...
 
unsigned int UaServer_Vector_GetSize (UaServer_Vector *pV)
 Returns the current size of the vector. More...
 
void UaServer_Vector_Resize (UaServer_Vector *pV, unsigned int size)
 Resize the vector. More...
 

Detailed Description

Function Documentation

unsigned int UaServer_Vector_Add ( UaServer_Vector pV,
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 vector with the new added element.
void UaServer_Vector_Clear ( UaServer_Vector pV)

Clears the vector structure.

Parameters
pVPointer to the vector object to work on.
void * UaServer_Vector_Get ( UaServer_Vector pV,
unsigned int  index 
)

Returns the value at the given index.

Parameters
pVPointer to the vector object to work on.
indexindex where the value is stored.
unsigned int UaServer_Vector_GetSize ( UaServer_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.
void UaServer_Vector_Initialize ( UaServer_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.
void UaServer_Vector_RemoveAt ( UaServer_Vector pV,
unsigned int  index 
)

Removes an element from the vector at the given index.

Parameters
pVPointer to the vector object to work on.
indexindex where the value is stored.
void UaServer_Vector_Resize ( UaServer_Vector pV,
unsigned int  size 
)

Resize the vector.

Parameters
pVPointer to the vector object to work on.
sizeInitial size of the vector in number of elements, not bytes.
void UaServer_Vector_Set ( UaServer_Vector pV,
unsigned int  index,
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.
indexindex where the value is stored.
pData[in] The data for the Vector generation.