00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __HASHTAB_H__
00012 #define __HASHTAB_H__
00013
00014 class FASTDB_DLL_ENTRY dbHashTableItem {
00015 public:
00016 oid_t next;
00017 oid_t record;
00018 nat4 hash;
00019 };
00020
00021 const size_t dbInitHashTableSize = 16*1024-1;
00022
00023
00024 class FASTDB_DLL_ENTRY dbHashTable {
00025 nat4 size;
00026 nat4 used;
00027 oid_t page;
00028
00029 static unsigned strHashCode(byte* key, int keylen);
00030 static unsigned hashCode(byte* key, int keylen);
00031 static int const keySize[];
00032
00033 public:
00034 static oid_t allocate(dbDatabase* db, size_t nRows = 0);
00035
00036 static void insert(dbDatabase* db, oid_t hashId,
00037 oid_t rowId, int type, int sizeofType, int offs, size_t nRows);
00038
00039 static void remove(dbDatabase* db, oid_t hashId,
00040 oid_t rowId, int type, int sizeofType, int offs);
00041
00042 static void find(dbDatabase* db, oid_t hashId, dbSearchContext& sc);
00043
00044 static void drop(dbDatabase* db, oid_t hashId);
00045
00046 static void purge(dbDatabase* db, oid_t hashId);
00047 };
00048
00049 #endif