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

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

#include <linked.h>

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

Public Member Functions

void delist (unsigned path)
 De-list from a single map path. More...
 
void enlist (unsigned path, MultiMap **root)
 Enlist on a single linked list. More...
 
void enlist (unsigned path, MultiMap **index, caddr_t key, unsigned size, size_t keysize=0)
 Enlist binary key on a single map path. More...
 
MultiMapnext (unsigned path) const
 Get next node from single chain. More...
 
- Public Member Functions inherited from ucommon::ReusableObject
ReusableObjectgetNext (void)
 Get next effective reusable object when iterating. More...
 
- Public Member Functions inherited from ucommon::LinkedObject
void delist (LinkedObject **root)
 Locate and remove ourselves from a list of objects. More...
 
void enlist (LinkedObject **root)
 Add our object to an existing linked list through a pointer. More...
 
LinkedObjectgetNext (void) const
 Get next effective object when iterating. More...
 
bool is_member (LinkedObject *list) const
 Search to see if we are a member of a specific list. More...
 
virtual void retain (void)
 Retain by marking as self referenced list. More...
 
- Public Member Functions inherited from ucommon::ObjectProtocol
ObjectProtocolcopy (void)
 Retain (increase retention of) object when copying.
 
void operator++ (void)
 Increase retention operator.
 
void operator-- (void)
 Decrease retention operator.
 
virtual ~ObjectProtocol ()
 Required virtual destructor.
 

Static Public Member Functions

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

Protected Member Functions

virtual bool equal (unsigned path, caddr_t key, size_t size) const
 Modifiable interface for key matching. More...
 
 MultiMap (unsigned count)
 Initialize a multilist object. More...
 
virtual ~MultiMap ()
 Destroy a multilist object.
 
- Protected Member Functions inherited from ucommon::ReusableObject
virtual void release (void)
 Release list, mark as no longer linked. More...
 
- Protected Member Functions inherited from ucommon::LinkedObject
 LinkedObject (LinkedObject **root)
 Construct base class attached to a chain of objects. More...
 
 LinkedObject ()
 Construct base class unattached to anyone. More...
 

Additional Inherited Members

- Static Public Attributes inherited from ucommon::LinkedObject
static const LinkedObjectinv
 Marker for invalid list pointer.
 
static const LinkedObjectnil
 Marker for end of linked list. More...
 
- Protected Attributes inherited from ucommon::LinkedObject
LinkedObjectNext
 

Detailed Description

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

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 970 of file linked.h.

Constructor & Destructor Documentation

ucommon::MultiMap::MultiMap ( unsigned  count)
protected

Initialize a multilist object.

Parameters
countof link paths.

Member Function Documentation

void ucommon::MultiMap::delist ( unsigned  path)

De-list from a single map path.

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

Enlist on a single linked list.

Parameters
pathto attach through.
rootof list to attach.
void ucommon::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.
virtual bool ucommon::MultiMap::equal ( unsigned  path,
caddr_t  key,
size_t  size 
) const
protectedvirtual

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.
static MultiMap* ucommon::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 ucommon::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* ucommon::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: