diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2026-08-24 11:16:07 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2026-08-24 11:16:07 +0200 |
| commit | c068f22329d5cc722622a2183bbb22eef2093df7 (patch) | |
| tree | 12d56c1aede67988a55e241364606bfbb4dba933 /tool_src/QvLib/QvDict.h | |
| download | openparsec-main.tar.xz openparsec-main.zip | |
Diffstat (limited to 'tool_src/QvLib/QvDict.h')
| -rw-r--r-- | tool_src/QvLib/QvDict.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tool_src/QvLib/QvDict.h b/tool_src/QvLib/QvDict.h new file mode 100644 index 0000000..3a3aebe --- /dev/null +++ b/tool_src/QvLib/QvDict.h @@ -0,0 +1,33 @@ +#ifndef _QV_DICT_ +#define _QV_DICT_ + +#include <QvBasic.h> +#include <QvString.h> +#include <QvPList.h> + +class QvDictEntry { + private: + u_long key; + void * value; + QvDictEntry * next; + QvDictEntry(u_long k, void *v) { key = k; value = v; }; + +friend class QvDict; +}; + +class QvDict { + public: + QvDict( int entries = 251 ); + ~QvDict(); + void clear(); + QvBool enter(u_long key, void *value); + QvBool find(u_long key, void *&value) const; + QvBool remove(u_long key); + + private: + int tableSize; + QvDictEntry * *buckets; + QvDictEntry *& findEntry(u_long key) const; +}; + +#endif /* _QV_DICT_ */ |
