Cp_wtrie


Files

file  wtrie.h

Data Structures

struct  _cp_wtrie_node
struct  _cp_wtrie

Defines

#define WNODE_MATCH(n, i)   ((n)->others ? wtab_get((n)->others, *i) : NULL)
#define BRANCH_COUNT(node)   wtab_count((node)->others)
#define cp_wtrie_rdlock(grp)   (cp_wtrie_lock(grp, COLLECTION_LOCK_READ))
#define cp_wtrie_wrlock(grp)   (cp_wtrie_lock(grp, COLLECTION_LOCK_WRITE))

Typedefs

typedef int(*) cp_wtrie_match_fn (void *leaf)
typedef CPROPS_DLL struct
_cp_wtrie_node 
cp_wtrie_node
typedef CPROPS_DLL struct
_cp_wtrie 
cp_wtrie

Functions

CPROPS_DLL cp_wtrie_node * cp_wtrie_node_new (void *leaf, cp_mempool *pool)
CPROPS_DLL void * cp_wtrie_node_delete (struct _cp_wtrie *grp, cp_wtrie_node *node)
CPROPS_DLL void cp_wtrie_delete_mapping (struct _cp_wtrie *grp, wtab_node *map_node)
CPROPS_DLL void cp_wtrie_node_unmap (struct _cp_wtrie *grp, cp_wtrie_node **node)
CPROPS_DLL cp_wtrie * cp_wtrie_create_wtrie (int mode, cp_copy_fn copy_leaf, cp_destructor_fn delete_leaf)
CPROPS_DLL cp_wtrie * cp_wtrie_create (int mode)
CPROPS_DLL int cp_wtrie_destroy (cp_wtrie *grp)
CPROPS_DLL int cp_wtrie_add (cp_wtrie *grp, wchar_t *key, void *leaf)
CPROPS_DLL int cp_wtrie_remove (cp_wtrie *grp, wchar_t *key, void **leaf)
CPROPS_DLL int cp_wtrie_prefix_match (cp_wtrie *grp, wchar_t *key, void **leaf)
CPROPS_DLL void * cp_wtrie_exact_match (cp_wtrie *grp, wchar_t *key)
CPROPS_DLL cp_vector * cp_wtrie_fetch_matches (cp_wtrie *grp, wchar_t *key)
CPROPS_DLL cp_vector * cp_wtrie_submatch (cp_wtrie *grp, wchar_t *key)
CPROPS_DLL int cp_wtrie_count (cp_wtrie *grp)
CPROPS_DLL void cp_wtrie_set_root (cp_wtrie *grp, void *leaf)
CPROPS_DLL int cp_wtrie_lock (cp_wtrie *grp, int type)
CPROPS_DLL int cp_wtrie_unlock (cp_wtrie *grp)
CPROPS_DLL int cp_wtrie_get_mode (cp_wtrie *grp)
CPROPS_DLL int cp_wtrie_set_mode (cp_wtrie *grp, int mode)
CPROPS_DLL int cp_wtrie_unset_mode (cp_wtrie *grp, int mode)
CPROPS_DLL void cp_wtrie_dump (cp_wtrie *grp)
CPROPS_DLL int cp_wtrie_use_mempool (cp_wtrie *tree, cp_mempool *pool)
CPROPS_DLL int cp_wtrie_share_mempool (cp_wtrie *tree, cp_shared_mempool *pool)

Function Documentation

CPROPS_DLL int cp_wtrie_add ( cp_wtrie *  grp,
wchar_t *  key,
void *  leaf 
)

add a mapping to a wtrie

Definition at line 356 of file wtrie.c.

References COLLECTION_LOCK_WRITE, COLLECTION_MODE_COPY, and COLLECTION_MODE_DEEP.

CPROPS_DLL int cp_wtrie_count ( cp_wtrie *  grp  ) 

return the number of stored items

Definition at line 691 of file wtrie.c.

CPROPS_DLL cp_wtrie* cp_wtrie_create ( int  mode  ) 

create a new cp_wtrie object with the specified collection mode

Definition at line 242 of file wtrie.c.

References cp_wtrie_create_wtrie().

CPROPS_DLL cp_wtrie* cp_wtrie_create_wtrie ( int  mode,
cp_copy_fn  copy_leaf,
cp_destructor_fn  delete_leaf 
)

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

Definition at line 203 of file wtrie.c.

References COLLECTION_MODE_NOSYNC, and cp_wtrie_node_new().

Referenced by cp_wtrie_create().

CPROPS_DLL int cp_wtrie_destroy ( cp_wtrie *  grp  ) 

delete a cp_wtrie object

Definition at line 250 of file wtrie.c.

CPROPS_DLL void* cp_wtrie_exact_match ( cp_wtrie *  grp,
wchar_t *  key 
)

return the mapping for the given key if any

Definition at line 527 of file wtrie.c.

References _wtab_node::attr, COLLECTION_LOCK_READ, and WNODE_MATCH.

CPROPS_DLL cp_vector* cp_wtrie_fetch_matches ( cp_wtrie *  grp,
wchar_t *  key 
)

return a vector containing exact match and any prefix matches

Definition at line 560 of file wtrie.c.

References _wtab_node::attr, COLLECTION_LOCK_READ, and WNODE_MATCH.

CPROPS_DLL int cp_wtrie_prefix_match ( cp_wtrie *  grp,
wchar_t *  key,
void **  leaf 
)

return the mapping for the longest prefix of the given key

Definition at line 655 of file wtrie.c.

References _wtab_node::attr, COLLECTION_LOCK_READ, and WNODE_MATCH.

CPROPS_DLL int cp_wtrie_remove ( cp_wtrie *  grp,
wchar_t *  key,
void **  leaf 
)

remove a mapping from a wtrie

Definition at line 425 of file wtrie.c.

References _wtab_node::attr, COLLECTION_LOCK_READ, COLLECTION_MODE_DEEP, _cp_wtrie_node::leaf, and WNODE_MATCH.

CPROPS_DLL cp_vector* cp_wtrie_submatch ( cp_wtrie *  grp,
wchar_t *  key 
)

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

Definition at line 618 of file wtrie.c.

References _wtab_node::attr, COLLECTION_LOCK_READ, and WNODE_MATCH.


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