UCommon
Public Member Functions | Static Public Member Functions | Protected Member Functions
ucc::MultiMap Class Reference

A multipath linked list where membership is managed in multiple lists. More...

#include <linked.h>

Inheritance diagram for ucc::MultiMap:
Inheritance graph
[legend]
Collaboration diagram for ucc::MultiMap:
Collaboration graph
[legend]

Public Member Functions

void delist (unsigned path)
 De-list from a single map path.
void enlist (unsigned path, MultiMap **index, caddr_t key, unsigned size, size_t keysize=0)
 Enlist binary key on a single map path.
void enlist (unsigned path, MultiMap **root)
 Enlist on a single linked list.
MultiMapnext (unsigned path) const
 Get next node from single chain.

Static Public Member Functions

static MultiMapfind (unsigned path, MultiMap **index, caddr_t key, unsigned max, size_t size=0)
 Find a multikey node.
static unsigned keyindex (caddr_t key, unsigned max, size_t size=0)
 Compute binary key index.

Protected Member Functions

virtual bool compare (unsigned path, caddr_t key, size_t size) const
 Modifiable interface for key matching.
 MultiMap (unsigned count)
 Initialize a multilist object.
virtual ~MultiMap ()
 Destroy a multilist object.

Detailed Description

A multipath linked list where membership is managed in multiple lists.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 950 of file linked.h.


Constructor & Destructor Documentation

ucc::MultiMap::MultiMap ( unsigned  count) [protected]

Initialize a multilist object.

Parameters:
countof link paths.

Member Function Documentation

virtual bool ucc::MultiMap::compare ( unsigned  path,
caddr_t  key,
size_t  size 
) const [protected, virtual]

Modifiable interface for key matching.

Parameters:
pathto check.
keyto check.
sizeof key to check or 0 if NULL terminated string.
Returns:
true if matches key.
void ucc::MultiMap::delist ( unsigned  path)

De-list from a single map path.

Parameters:
pathto detach from.
void ucc::MultiMap::enlist ( unsigned  path,
MultiMap **  root 
)

Enlist on a single linked list.

Parameters:
pathto attach through.
rootof list to attach.
void ucc::MultiMap::enlist ( unsigned  path,
MultiMap **  index,
caddr_t  key,
unsigned  size,
size_t  keysize = 0 
)

Enlist binary key on a single map path.

Parameters:
pathto attach through.
indexto attach to.
keyvalue to use.
sizeof index.
keysizeof key or 0 if NULL terminated string.
static MultiMap* ucc::MultiMap::find ( unsigned  path,
MultiMap **  index,
caddr_t  key,
unsigned  max,
size_t  size = 0 
) [static]

Find a multikey node.

Returns:
node that is found or NULL if none.
Parameters:
pathof table.
indexof hash table.
keyto locate.
maxsize of index.
sizeof key or 0 if NULL terminated string.
static unsigned ucc::MultiMap::keyindex ( caddr_t  key,
unsigned  max,
size_t  size = 0 
) [static]

Compute binary key index.

Parameters:
keymemory to compute.
maxsize of index.
sizeof key or 0 if NULL terminated string.
Returns:
associated hash value.
MultiMap* ucc::MultiMap::next ( unsigned  path) const

Get next node from single chain.

Parameters:
pathto follow.

The documentation for this class was generated from the following file: