Mission Base

Program Base Library Functions

int pblSetEnsureCapacity

( PblSet* set, int minCapacity )

Increases the capacity of this set instance, if necessary.

Documentation

Increases the capacity of this set instance, if necessary.

For hash sets this method ensures that the set can hold at least the number of elements specified by the minimum capacity argument.

For tree sets this method does nothing, it justs returns the value of parameter minCapacity.

If the set is a hash set and if the capacity is actually increased, this method has a memory and time complexity of O(N), with N being the new capacity of the set.

In all other cases this method has a time complexity of O(1).

Parameters:
set - The set to use
minCapacity - The desired minimum capacity
Returns:
int rc >= 0: OK, the set capacity is returned.
int rc < 0: An error, see pbl_errno:
PBL_ERROR_OUT_OF_MEMORY - Out of memory.

Alphabetic index



This page was generated with the help of DOC++.