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

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

Reimplemented from ucc::OrderedIndex.

Definition at line 1841 of file linked.h.

template<class T >
T* ucc::keylist< T >::create ( 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 1858 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.

Reimplemented from ucc::OrderedIndex.

Definition at line 1849 of file linked.h.

template<class T >
T* ucc::keylist< T >::find ( 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 1874 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.

Reimplemented from ucc::OrderedIndex.

Definition at line 1891 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 1866 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 1882 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 1833 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 1900 of file linked.h.


The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.2-20100208