ucc::keypager< T, M > Class Template Reference

A templated class for a hash pager. More...

#include <memory.h>

Inheritance diagram for ucc::keypager< T, M >:
Inheritance graph
[legend]
Collaboration diagram for ucc::keypager< T, M >:
Collaboration graph
[legend]

Public Member Functions

T * begin (void)
 Find first typed object in hash map to iterate.
unsigned count (void)
 Count the number of typed objects in our hash map.
T * get (char *name)
 Find a typed object derived from NamedObject in the hash map by name.
T ** index (void)
 Convert our hash map into a linear object pointer array.
 keypager (size_t size)
 Create the object cache.
T * next (T *current)
 Find next typed object in hash map for iteration.
T * operator[] (char *name)
 Find a typed object derived from NamedObject in the hash map by name.
T ** sort (void)
 Convert our hash map into an alphabetically sorted linear object pointer array.
bool test (char *name)
 Test if a name exists in the pool.
 ~keypager ()
 Destroy the hash pager by purging the index chains and memory pools.

Detailed Description

template<class T, unsigned M = 177>
class ucc::keypager< T, M >

A templated class for a hash pager.

This creates objects from a pager pool when they do not already exist in the hash map.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 608 of file memory.h.


Constructor & Destructor Documentation

template<class T , unsigned M = 177>
ucc::keypager< T, M >::keypager ( size_t  size  )  [inline]

Create the object cache.

Parameters:
size of allocation units.

Definition at line 618 of file memory.h.


Member Function Documentation

template<class T , unsigned M = 177>
T* ucc::keypager< T, M >::begin ( void   )  [inline]

Find first typed object in hash map to iterate.

Returns:
first typed object or NULL if nothing in list.

Definition at line 662 of file memory.h.

template<class T , unsigned M = 177>
unsigned ucc::keypager< T, M >::count ( void   )  [inline]

Count the number of typed objects in our hash map.

Returns:
count of typed objects.

Definition at line 677 of file memory.h.

template<class T , unsigned M = 177>
T* ucc::keypager< T, M >::get ( char *  name  )  [inline]

Find a typed object derived from NamedObject in the hash map by name.

If the object is not found, it is created from the memory pool.

Parameters:
name to search for.
Returns:
typed object if found through map or NULL.

Definition at line 632 of file memory.h.

template<class T , unsigned M = 177>
T** ucc::keypager< T, M >::index ( void   )  [inline]

Convert our hash map 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 686 of file memory.h.

template<class T , unsigned M = 177>
T* ucc::keypager< T, M >::next ( T *  current  )  [inline]

Find next typed object in hash map for iteration.

Parameters:
current typed object we are referencing.
Returns:
next iterative object or NULL if past end of map.

Definition at line 670 of file memory.h.

template<class T , unsigned M = 177>
T* ucc::keypager< T, M >::operator[] ( char *  name  )  [inline]

Find a typed object derived from NamedObject in the hash map by name.

If the object is not found, it is created from the pager pool.

Parameters:
name to search for.
Returns:
typed object if found through map or NULL.

Definition at line 655 of file memory.h.

template<class T , unsigned M = 177>
T** ucc::keypager< T, M >::sort ( void   )  [inline]

Convert our hash map 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:
sorted array of typed named object pointers.

Definition at line 695 of file memory.h.

template<class T , unsigned M = 177>
bool ucc::keypager< T, M >::test ( char *  name  )  [inline]

Test if a name exists in the pool.

Parameters:
name to test.
Returns:
true if found.

Definition at line 646 of file memory.h.


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