Mission Base

Program Base Library Functions

PblSet* pblCollectionConvertToHashSet

( PblCollection* collection,
  int (* hashValue ) ( const void* element ))

Returns a pblHashSet with a shallow copy of this collection instance.

Documentation

Returns a pblHashSet with a shallow copy of this collection instance. An application specific hash value function can be set.

The elements themselves are not copied.

NULL elements contained in the collection are silently ignored.

This method has a memory and time complexity of O(N), with N being the number of elements in the collection.

Parameters:
collection - The collection to convert
hashValue - The hash value function for the new set, may be NULL
element - The element to get the hash value for
Returns:
PblSet * retPtr != NULL: A pointer to the new set.
PblSet * retPtr == NULL: An error, see pbl_errno:
PBL_ERROR_OUT_OF_MEMORY - Out of memory.
PBL_ERROR_PARAM_COLLECTION - The collection cannot be iterated.
PBL_ERROR_CONCURRENT_MODIFICATION - The collection was modified concurrently.
PBL_ERROR_OUT_OF_BOUNDS - Maximum capacity of the hash set exceeded.

Alphabetic index



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