#include <htable.h>

Public Member Functions | |
| htable (int n, int kl=0, HTYPE ht=STRPTR, size_t(*klf)(const char *)=NULL) | |
| Creates an hash table. | |
| ~htable () | |
| Destroys an and hash table. | |
| address | Hash (char *key) |
| Computes the hash function. | |
| address | HashInt (char *key) |
| address | HashStr (char *key) |
| int | Comp (char *Key1, char *Key2) |
| Compares the keys of two entries. | |
| int | CompInt (char *Key1, char *Key2) |
| int | CompStr (char *Key1, char *Key2) |
| char * | search (char *item, HT_ACTION action) |
| Searches for an item. | |
| char * | scan (HT_ACTION action) |
| Scans the content. | |
| void | stat () |
| Prints statistics. | |
| void | map (std::ostream &co=std::cout, int cols=80) |
| Print a map of memory use. | |
| int | used () |
| Returns amount of used memory. | |
Definition at line 58 of file htable.h.
| htable::~htable | ( | ) |
| int htable::Comp | ( | char * | Key1, | |
| char * | Key2 | |||
| ) | [inline] |
| int htable::CompInt | ( | char * | Key1, | |
| char * | Key2 | |||
| ) |
Definition at line 290 of file htable.cpp.
References INTPTR.
Referenced by Comp().

| int htable::CompStr | ( | char * | Key1, | |
| char * | Key2 | |||
| ) |
Definition at line 269 of file htable.cpp.
References STRPTR.
Referenced by Comp().

| address htable::Hash | ( | char * | key | ) | [inline] |
| address htable::HashInt | ( | char * | key | ) |
Definition at line 247 of file htable.cpp.
References INTPTR.
Referenced by Hash().

| address htable::HashStr | ( | char * | key | ) |
| void htable::map | ( | std::ostream & | co = std::cout, |
|
| int | cols = 80 | |||
| ) |
Print a map of memory use.
| char * htable::scan | ( | HT_ACTION | action | ) |
Scans the content.
Definition at line 128 of file htable.cpp.
References HT_INIT, k, ENTRY::key, ENTRY::next, and NULL.
Referenced by dictionary_iter::dictionary_iter(), and dictionary_iter::next().

| char * htable::search | ( | char * | item, | |
| HT_ACTION | action | |||
| ) |
Searches for an item.
Definition at line 62 of file htable.cpp.
References mempool::allocate(), Comp(), Hash(), HT_FIND, ENTRY::key, ENTRY::next, and NULL.
Referenced by ngramcache::add(), dictionary::dictionary(), dictionary::encode(), ngramcache::get(), dictionary::getcode(), dictionary::grow(), dictionary::load(), and dictionary::sort().


| void htable::stat | ( | ) |
Prints statistics.
Definition at line 188 of file htable.cpp.
References used().

| int htable::used | ( | ) | [inline] |
Returns amount of used memory.
Definition at line 122 of file htable.h.
References mempool::used().
Referenced by stat(), and dictionary::stat().


1.5.9