int cp_avltree_get_mode(cp_avltree *tree);
void cp_avltree_set_mode(cp_avltree *tree, int mode);
void cp_avltree_unset_mode(cp_avltree *tree, int mode);
COLLECTION_MODE_DEEP COLLECTION_MODE_COPY COLLECTION_MODE_NOSYNC COLLECTION_MODE_MULTIPLE_VALUES
Setting COLLECTION_MODE_DEEP causes the tree to perform destructor calls on keys and items when mappings are removed. Note that a mapping may be removed before destruction time if inserting a new mapping for an existing key.
Setting COLLECTION_MODE_COPY causes the tree to insert copies of the given key and value when creating a new mapping.
Setting COLLECTION_MODE_NOSYNC disables locking on tree operations.
If COLLECTION_MODE_MULTIPLE_VALUES is set, inserting a mapping for an existing key adds the new value to the list for that key. The lookup function returns a cp_vector containing mappings. This may only be set at creation time with cp_avltree_create_by_option(3) and may not be altered with cp_avltree_set_mode or cp_avltree_unset_mode.
The mode is initially assigned at creation time. Creating the tree with cp_avltree_create_by_option(3) allows setting key and value constructor and destructor functions.
cp_avltree_get_mode returns the current mode indicator.
cp_avltree_set_mode makes a logical OR of the bits on the given mode parameter and the current mode setting and stores this as the new mode setting. No bits are unset. This function may fail if attempting to set COLLECTION_MODE_NOSYNC while the current thread owns the collection lock.
cp_avltree_unset mode unsets the bits given by the mode parameter.
This document was created by
man2html,
using the manual pages. Time: 10:00:49 GMT, May 30, 2006 |