rtrie.h File Reference

#include "common.h"
#include "config.h"
#include <string.h>
#include <errno.h>
#include "vector.h"
#include "bstr.h"
#include "mempool.h"

Go to the source code of this file.

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)


Detailed Description

cp_rtrie is a character rtrie implementation. Tries allow for prefix matching with O(m) = O(1) time (m being the length of the key). Used to store key - value mappings, rtries have certain advantages over hashtables in that worse case behavior is still O(1) and no hash function is needed. cp_rtrie is technically a compact rtrie in that collapses unused character paths.

Definition in file rtrie.h.


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