ucc::keylist< T > Class Template Reference

A template for ordered index of typed name key mapped objects. More...

#include <linked.h>

Inheritance diagram for ucc::keylist< T >:

Inheritance graph
[legend]
Collaboration diagram for ucc::keylist< T >:

Collaboration graph
[legend]

Public Member Functions

NamedObject ** root (void)
 Return a root node pointer to use in NamedObject constructors.
T * begin (void)
 Return first item in ordered list.
T * end (void)
 Return last item in ordered list.
T * create (const char *name)
 Create a new typed named object with default constructor.
T * next (LinkedObject *current)
 Iterate next object in list.
T * find (const char *name)
 Find a specific object by name.
T * operator[] (unsigned offset)
 Retrieve a specific object by position in list.
T ** index (void)
 Convert our linked list into a linear object pointer array.
T ** sort (void)
 Convert our linked list into an alphabetically sorted linear object pointer array.

Detailed Description

template<class T>
class ucc::keylist< T >

A template for ordered index of typed name key mapped objects.

This is used to hold an iterable linked list of typed named objects where we can find objects by their name as well as through iteration.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 1498 of file linked.h.


Member Function Documentation

template<class T >
T* ucc::keylist< T >::begin ( void   )  [inline]

Return first item in ordered list.

This is commonly used to iterate the list.

Returns:
first item in list or NULL if empty.

Definition at line 1513 of file linked.h.

template<class T >
T* ucc::keylist< T >::create ( const char *  name  )  [inline]

Create a new typed named object with default constructor.

This creates a new object which can be deleted.

Parameters:
name of object to create.
Returns:
typed named object.

Definition at line 1530 of file linked.h.

template<class T >
T* ucc::keylist< T >::end ( void   )  [inline]

Return last item in ordered list.

This is commonly used to determine end of list iteration.

Returns:
last item in list or NULL if empty.

Definition at line 1521 of file linked.h.

template<class T >
T* ucc::keylist< T >::find ( const char *  name  )  [inline]

Find a specific object by name.

Parameters:
name to search for.
Returns:
type named object that matches or NULL if not found.

Definition at line 1546 of file linked.h.

template<class T >
T** ucc::keylist< T >::index ( void   )  [inline]

Convert our linked list into a linear object pointer array.

The object pointer array is created from the heap and must be deleted when no longer used.

Returns:
array of typed named object pointers.

Definition at line 1563 of file linked.h.

template<class T >
T* ucc::keylist< T >::next ( LinkedObject current  )  [inline]

Iterate next object in list.

Parameters:
current object we are referencing.
Returns:
next logical object in linked list or NULL if end.

Definition at line 1538 of file linked.h.

Here is the call graph for this function:

template<class T >
T* ucc::keylist< T >::operator[] ( unsigned  offset  )  [inline]

Retrieve a specific object by position in list.

Parameters:
offset in list for object we want.
Returns:
type named object or NULL if past end of list.

Definition at line 1554 of file linked.h.

template<class T >
NamedObject** ucc::keylist< T >::root ( void   )  [inline]

Return a root node pointer to use in NamedObject constructors.

Returns:
pointer to index root.

Definition at line 1505 of file linked.h.

template<class T >
T** ucc::keylist< T >::sort ( void   )  [inline]

Convert our linked list into an alphabetically sorted linear object pointer array.

The object pointer array is created from the heap and must be deleted when no longer used.

Returns:
array of typed named object pointers.

Definition at line 1572 of file linked.h.


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

Generated on Wed May 13 09:13:01 2009 for UCommon by  doxygen 1.5.8