Cp_rtrie


Files

file  rtrie.h

Data Structures

struct  _cp_rtrie_node
struct  _cp_rtrie

Defines

#define cp_rtrie_rdlock(grp)   (cp_rtrie_lock(grp, COLLECTION_LOCK_READ))
#define cp_rtrie_wrlock(grp)   (cp_rtrie_lock(grp, COLLECTION_LOCK_WRITE))

Typedefs

typedef CPROPS_DLL struct
_cp_rtrie_node 
cp_rtrie_node
typedef CPROPS_DLL struct
_cp_rtrie 
cp_rtrie

Functions

CPROPS_DLL cp_rtrie_node * cp_rtrie_node_new (void *leaf, cp_mempool *pool)
CPROPS_DLL void * cp_rtrie_node_delete (struct _cp_rtrie *grp, cp_rtrie_node *node)
CPROPS_DLL void cp_rtrie_node_unmap (struct _cp_rtrie *grp, cp_rtrie_node **node)
CPROPS_DLL cp_rtrie * cp_rtrie_create_rtrie (int mode, cp_copy_fn copy_leaf, cp_destructor_fn delete_leaf)
CPROPS_DLL cp_rtrie * cp_rtrie_create (int mode)
CPROPS_DLL int cp_rtrie_destroy (cp_rtrie *grp)
CPROPS_DLL int cp_rtrie_add (cp_rtrie *grp, cp_bstr *key, void *leaf)
CPROPS_DLL int cp_rtrie_remove (cp_rtrie *grp, cp_bstr *key, void **leaf)
CPROPS_DLL int cp_rtrie_prefix_match (cp_rtrie *grp, cp_bstr *key, void **leaf)
CPROPS_DLL void * cp_rtrie_exact_match (cp_rtrie *grp, cp_bstr *key)
CPROPS_DLL cp_vector * cp_rtrie_fetch_matches (cp_rtrie *grp, cp_bstr *key)
CPROPS_DLL cp_vector * cp_rtrie_submatch (cp_rtrie *grp, cp_bstr *key)
CPROPS_DLL int cp_rtrie_count (cp_rtrie *grp)
CPROPS_DLL void cp_rtrie_set_root (cp_rtrie *grp, void *leaf)
CPROPS_DLL int cp_rtrie_lock (cp_rtrie *grp, int type)
CPROPS_DLL int cp_rtrie_unlock (cp_rtrie *grp)
CPROPS_DLL int cp_rtrie_get_mode (cp_rtrie *grp)
CPROPS_DLL int cp_rtrie_set_mode (cp_rtrie *grp, int mode)
CPROPS_DLL int cp_rtrie_unset_mode (cp_rtrie *grp, int mode)
CPROPS_DLL void cp_rtrie_dump (cp_rtrie *grp)
CPROPS_DLL int cp_rtrie_use_mempool (cp_rtrie *tree, cp_mempool *pool)
CPROPS_DLL int cp_rtrie_share_mempool (cp_rtrie *tree, cp_shared_mempool *pool)

Variables

__BEGIN_DECLS typedef int(*) cp_rtrie_match_fn (void *leaf)

Function Documentation

CPROPS_DLL int cp_rtrie_add ( cp_rtrie *  grp,
cp_bstr key,
void *  leaf 
)

add a mapping to a rtrie

Definition at line 453 of file rtrie.c.

References COLLECTION_LOCK_WRITE, COLLECTION_MODE_COPY, and COLLECTION_MODE_DEEP.

CPROPS_DLL int cp_rtrie_count ( cp_rtrie *  grp  ) 

return the number of stored items

Definition at line 901 of file rtrie.c.

CPROPS_DLL cp_rtrie* cp_rtrie_create ( int  mode  ) 

create a new cp_rtrie object with the specified collection mode

Definition at line 263 of file rtrie.c.

References cp_rtrie_create_rtrie().

CPROPS_DLL cp_rtrie* cp_rtrie_create_rtrie ( int  mode,
cp_copy_fn  copy_leaf,
cp_destructor_fn  delete_leaf 
)

create a new cp_rtrie object with the specified collection mode and leaf management functions

Definition at line 224 of file rtrie.c.

References COLLECTION_MODE_NOSYNC, and cp_rtrie_node_new().

Referenced by cp_rtrie_create().

CPROPS_DLL int cp_rtrie_destroy ( cp_rtrie *  grp  ) 

delete a cp_rtrie object

Definition at line 271 of file rtrie.c.

CPROPS_DLL void* cp_rtrie_exact_match ( cp_rtrie *  grp,
cp_bstr key 
)

return the mapping for the given key if any

Definition at line 646 of file rtrie.c.

References COLLECTION_LOCK_READ, and _cp_bstr::length.

CPROPS_DLL cp_vector* cp_rtrie_fetch_matches ( cp_rtrie *  grp,
cp_bstr key 
)

return a vector containing exact match and any prefix matches

Definition at line 691 of file rtrie.c.

References COLLECTION_LOCK_READ, and _cp_bstr::length.

CPROPS_DLL int cp_rtrie_prefix_match ( cp_rtrie *  grp,
cp_bstr key,
void **  leaf 
)

return the mapping for the longest prefix of the given key

Definition at line 839 of file rtrie.c.

References COLLECTION_LOCK_READ, and _cp_bstr::length.

CPROPS_DLL int cp_rtrie_remove ( cp_rtrie *  grp,
cp_bstr key,
void **  leaf 
)

remove a mapping from a rtrie

Definition at line 533 of file rtrie.c.

References COLLECTION_LOCK_READ, COLLECTION_MODE_DEEP, and _cp_bstr::length.

CPROPS_DLL cp_vector* cp_rtrie_submatch ( cp_rtrie *  grp,
cp_bstr key 
)

return a vector containing all enrtries in subtree under path given by key

Definition at line 786 of file rtrie.c.

References COLLECTION_LOCK_READ, and _cp_bstr::length.


Generated on Mon Dec 5 23:00:23 2011 for cprops by  doxygen 1.4.7