X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=include%2Fhashtable.h;h=bfad8825be4922d2edb1ef5c49e25361096db87a;hp=57b08fa65b28a52f9bcfaa1e2c5308d11f48e01f;hb=1a050c98763fbbc0662731b0b76953acede6f5d7;hpb=c8b19dfaffba9f06d8b6c40cb1bb83a8964867f7 diff --git a/include/hashtable.h b/include/hashtable.h index 57b08fa..bfad882 100644 --- a/include/hashtable.h +++ b/include/hashtable.h @@ -1,9 +1,9 @@ /* FILE IDENTIFICATION ** -** File Name: hashtable.h -** Author: Kevin Rosenberg -** Purpose: Header file for hash table library -** Date Started: Dec. 2000 +** File Name: hashtable.h +** Author: Kevin Rosenberg +** Purpose: Header file for hash table library +** Date Started: Dec. 2000 ** ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg @@ -35,11 +35,11 @@ private: std::string m_strKeyword; int m_iCode; class KeywordCodeEntry *m_pNext; - + public: - + KeywordCodeEntry (const char* const pszKeyword, int iCode); - + const char* const getKeyword() const { return m_strKeyword.c_str(); } @@ -47,13 +47,13 @@ private: int getCode () const { return m_iCode; } - - void setCode (int iCode) + + void setCode (int iCode) { m_iCode = iCode; } - + void setNext (KeywordCodeEntry* pNext) { m_pNext = pNext; } - + KeywordCodeEntry* getNext () { return m_pNext; } }; @@ -64,19 +64,19 @@ public: enum { HASHSIZE = 100, }; - + KeywordCodeHashTable() { initTable(); } - + ~KeywordCodeHashTable() { freeTable(); } - + void installKeywordCode (const char* const pszKeyword, int iCode); KeywordCodeEntry* lookup (const char* const pszKeyword); - + private: KeywordCodeEntry* m_hashTable[HASHSIZE]; - + int hash (const char* s); void initTable (); void freeTable ();