Mission Base

Program Base Library Functions

int pblMapAdd

( PblMap* map, void* key, size_t keyLength,
  void* value, size_t valueLength )

Associates the specified value with the specified key in this map.

Documentation

Associates the specified value with the specified key in this map.

If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if pblMapContainsKey(k) would return true.)

For hash maps this method has a time complexity of O(1). For tree maps this method has a time complexity of O(Log N).

Parameters:
map - The map to add to
key - Key to add a mapping for
keyLength - Length of the key
value - Value of the new mapping
valueLength - Length of the value
Returns:
int rc > 0: The map did not already contain a mapping for the key.
int rc == 0: The map did already contain a mapping for the key.
int rc < 0: An error, see pbl_errno:
PBL_ERROR_OUT_OF_MEMORY - Out of memory.
PBL_ERROR_OUT_OF_BOUNDS - Maximum capacity of the hash set exceeded.

Alphabetic index



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