Main Page   Class Hierarchy   Compound List   File List   Compound Members  

hashtab.h

00001 //-< HASHTAB.CPP >---------------------------------------------------*--------*
00002 // FastDB                    Version 1.0         (c) 1999  GARRET    *     ?  *
00003 // (Main Memory Database Management System)                          *   /\|  *
00004 //                                                                   *  /  \  *
00005 //                          Created:     20-Nov-98    K.A. Knizhnik  * / [] \ *
00006 //                          Last update: 10-Dec-98    K.A. Knizhnik  * GARRET *
00007 //-------------------------------------------------------------------*--------*
00008 // Extensible hash table interface
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

Generated on Fri Nov 15 21:06:29 2002 for FastDB by doxygen1.2.15