hashtable< K, T > Class Template Reference

GHashtable wrapper for C++. More...

#include <hashtable.h>

List of all members.

Public Member Functions

 hashtable (int size)
 Function for a new hash table including targeted size.
 ~hashtable ()
 Free data of the hashtable again.
void insert (K *key, T *value)
 Insert a record into the hashtable.
void remove (K *key)
 Remove a record again.
T * operator[] (K *key)
 Read a record from the hashtable.
bool lookup_extended (K *key, K **orig_key_ret, T **value_ret)
 Return the pointer to the orginal key and the data record to free it again if needed.
void foreach (void(*func)(K *, T *, void *closure), void *closure)
 Call the handler for each record.
void foreach_remove (gboolean(*func)(K *, T *, void *closure), void *closure)
 Call the handler and remove the record when the handler returns 1.
int size () const
 Number of elements in the hashtable.


Detailed Description

template<class K, class T>
class hashtable< K, T >

GHashtable wrapper for C++.

Constructor & Destructor Documentation

template<class K, class T>
hashtable< K, T >::hashtable ( int  size  )  [inline]

Function for a new hash table including targeted size.

template<class K, class T>
hashtable< K, T >::~hashtable (  )  [inline]

Free data of the hashtable again.


Member Function Documentation

template<class K, class T>
void hashtable< K, T >::insert ( K *  key,
T *  value 
) [inline]

Insert a record into the hashtable.

The caller should handle the memory allocation of this data

template<class K, class T>
void hashtable< K, T >::remove ( K *  key  )  [inline]

Remove a record again.

template<class K, class T>
T* hashtable< K, T >::operator[] ( K *  key  )  [inline]

Read a record from the hashtable.

template<class K, class T>
bool hashtable< K, T >::lookup_extended ( K *  key,
K **  orig_key_ret,
T **  value_ret 
) [inline]

Return the pointer to the orginal key and the data record to free it again if needed.

template<class K, class T>
void hashtable< K, T >::foreach ( void(*)(K *, T *, void *closure)  func,
void *  closure 
) [inline]

Call the handler for each record.

template<class K, class T>
void hashtable< K, T >::foreach_remove ( gboolean(*)(K *, T *, void *closure)  func,
void *  closure 
) [inline]

Call the handler and remove the record when the handler returns 1.

template<class K, class T>
int hashtable< K, T >::size (  )  const [inline]

Number of elements in the hashtable.


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

Generated on Tue Jan 1 17:30:01 2008 for hashtable< K, T > Class Template Reference by  doxygen   Visit the project page on SourceForge.net Logo