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 BEGIN_FASTDB_NAMESPACE
00015 
00016 class FASTDB_DLL_ENTRY dbHashTableItem { 
00017   public:
00018     oid_t next;
00019     oid_t record;
00020     nat4  hash;
00021 };
00022 
00023 const size_t dbInitHashTableSize = 16*1024-1;
00024 
00025 
00026 class FASTDB_DLL_ENTRY dbHashTable { 
00027     nat4  size;
00028     nat4  used;
00029     oid_t page;
00030     
00031     static unsigned strHashCode(byte* key, int keylen);
00032     static unsigned hashCode(byte* key, int type, int keylen);
00033     static int const keySize[];
00034         
00035   public:
00036     static oid_t allocate(dbDatabase* db, size_t nRows = 0);
00037     
00038     static void  insert(dbDatabase* db, oid_t hashId, 
00039                         oid_t rowId, int type, int sizeofType, int offs, size_t nRows);
00040     
00041     static void  remove(dbDatabase* db, oid_t hashId, 
00042                         oid_t rowId, int type, int sizeofType, int offs);
00043     
00044     static void  find(dbDatabase* db, oid_t hashId, dbSearchContext& sc);
00045     
00046     static void  drop(dbDatabase* db, oid_t hashId);
00047 
00048     static void  purge(dbDatabase* db, oid_t hashId);
00049 };
00050 
00051 END_FASTDB_NAMESPACE
00052 
00053 #endif

Generated on Mon Oct 23 13:23:58 2006 for FastDB by doxygen1.2.18