cp_multimap

Section: libcprops - cp_multimap (3)
Updated: OCT 2007
Index Return to Main Contents
 

NAME

cp_multimap_create, cp_multimap_create_by_option, cp_multimap_destroy, cp_multimap_destroy_custom - create / destroy a multimap

 

SYNOPSIS

#include <cprops/multimap.h>

cp_multimap *cp_multimap_create(cp_key_fn key_fn, cp_compare_fn cmp);
cp_multimap*
      cp_multimap_create_by_option(int mode, cp_key_fn key_fn,
                                   cp_compare_fn cmp,
                                   cp_copy_fn copy,
                                   cp_destructor_fn dtr);

void cp_multimap_destroy(cp_multimap *tree);
void cp_multimap_destroy_custom(cp_multimap *tree,
                                 cp_destructor_fn dtr);
 

DESCRIPTION

cp_multimap_create creates a multimap with a unique primary index instantiated with the given key and comparison functions. The returned map is synchronized, and does not copy entries on insertion or delete them on removal.

cp_multimap_create_by_option allows specifying mode bits and an item copy and destructor function. If the mode parameter has the COLLECTION_MODE_MULTIPLE_VALUES bit set, the default index based on the given key and comparison functions is assumed to allow multiple values. In this case an additional unique index is created implicitly.

Additional indices may be added at any point after creation time by calling cp_multimap_create_index.

cp_multimap_destroy frees the memory associated with a multimap. cp_multimap_destroy_custom sets the item destructor function to the dtr parameter and deallocates the multimap. Note that the entry destructor function is called only if the map has the COLLECTION_MODE_DEEP mode bit set. Calling cp_multimap_destroy_custom does not set this bit.

 

SEE ALSO

cp_multimap_create_index(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 18:30:35 GMT, December 01, 2007