ucc::OrderedIndex Class Reference

An index container for maintaining an ordered list of objects. More...

#include <linked.h>

Inheritance diagram for ucc::OrderedIndex:

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

Collaboration graph
[legend]

Public Member Functions

 OrderedIndex ()
 Create and initialize an empty index.
virtual ~OrderedIndex ()
 Destroy index.
LinkedObjectfind (unsigned offset) const
 Find a specific member in the ordered list.
unsigned count (void) const
 Count of objects this list manages.
void purge (void)
 Purge the linked list and then set the index to empty.
virtual void lock_index (void)
 Used to synchronize lists managed by multiple threads.
virtual void unlock_index (void)
 Used to synchronize lists managed by multiple threads.
LinkedObject ** index (void) const
 Return a pointer to the head of the list.
LinkedObjectget (void)
 Get (pull) object off the list.
LinkedObjectgetIndexed (unsigned index) const
 Get an indexed member from the ordered index.
LinkedObjectbegin (void) const
 Return first object in list for iterators.
LinkedObjectend (void) const
 Return last object in list for iterators.
LinkedObjectoperator* () const
 Return head object pointer.
void operator*= (OrderedObject *object)
 Add object to our list.

Protected Attributes

OrderedObjecthead
OrderedObjecttail

Friends

class OrderedObject
class LinkedList
class NamedObject

Detailed Description

An index container for maintaining an ordered list of objects.

This index holds a pointer to the head and tail of an ordered list of linked objects. Fundimental methods for supporting iterators are also provided.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 165 of file linked.h.


Member Function Documentation

LinkedObject* ucc::OrderedIndex::begin ( void   )  const [inline]

Return first object in list for iterators.

Returns:
first object in list.

Definition at line 241 of file linked.h.

unsigned ucc::OrderedIndex::count ( void   )  const

Count of objects this list manages.

Returns:
number of objects in the list.

LinkedObject* ucc::OrderedIndex::end ( void   )  const [inline]

Return last object in list for iterators.

Returns:
last object in list.

Definition at line 248 of file linked.h.

LinkedObject* ucc::OrderedIndex::find ( unsigned  offset  )  const

Find a specific member in the ordered list.

Parameters:
offset to member to find.

LinkedObject* ucc::OrderedIndex::get ( void   ) 

Get (pull) object off the list.

The start of the list is advanced to the next object.

Returns:
LinkedObject based object that was head of the list.

LinkedObject* ucc::OrderedIndex::getIndexed ( unsigned  index  )  const [inline]

Get an indexed member from the ordered index.

Parameters:
index of member to fetch.
Returns:
LinkedObject member of index.

Definition at line 234 of file linked.h.

LinkedObject** ucc::OrderedIndex::index ( void   )  const

Return a pointer to the head of the list.

This allows the head pointer to be used like a simple root list pointer for pure LinkedObject based objects.

Returns:
LinkedIndex style object.

virtual void ucc::OrderedIndex::lock_index ( void   )  [virtual]

Used to synchronize lists managed by multiple threads.

A derived locking method would be invoked.

LinkedObject* ucc::OrderedIndex::operator* (  )  const [inline]

Return head object pointer.

Returns:
head pointer.

Definition at line 255 of file linked.h.

void ucc::OrderedIndex::operator*= ( OrderedObject object  ) 

Add object to our list.

Parameters:
object to add.

virtual void ucc::OrderedIndex::unlock_index ( void   )  [virtual]

Used to synchronize lists managed by multiple threads.

A derived unlocking method would be invoked.


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

Generated on Tue Jul 28 21:43:27 2009 for UCommon by  doxygen 1.5.9