hashtable.h

00001 /* 
00002    EyeDB Object Database Management System
00003    Copyright (C) 1994-2008 SYSRA
00004    
00005    EyeDB is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009    
00010    EyeDB is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014    
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with this library; if not, write to the Free Software
00017    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA 
00018 */
00019 
00020 /*
00021    Author: Eric Viara <viara@sysra.com>
00022 */
00023 
00024 
00025 #include <eyedbsm/eyedbsm.h>
00026 #include <transaction.h>
00027 
00028 namespace eyedbsm {
00029 struct HashTable {
00030 #ifdef TRS_SECURE
00031   eyedblib::uint32 magic;
00032 #endif
00033   unsigned int cnt;
00034   unsigned int mask;
00035 #ifdef KEEP_ORDER
00036   XMOffset xfirst, xlast;
00037 #endif
00038   XMOffset offs[1];
00039 };
00040 
00041 #define HashTableSize(COUNT) \
00042         (sizeof(HashTable) + ((COUNT)-1) * sizeof(XMOffset))
00043 
00044 #ifdef TRS_SECURE
00045   static const unsigned int HT_MAGIC = 0xf78e8ef3;
00046 #endif
00047 
00048 HashTable *
00049 HashTableMake(XMHandle *, int);
00050 
00051 extern void
00052 HashTableFree(XMHandle *, HashTable *);
00053 
00054 extern HashTable *
00055   HashTableCreate(XMHandle *, int);
00056 
00057 extern int
00058   HashTableTRObjectInsert(XMHandle *, HashTable *, TRObject *),
00059   HashTableTRObjectSuppress(XMHandle *, HashTable *, TRObject *),
00060   HashTablePObjectInsert(XMHandle *, HashTable *, PObject *),
00061   HashTablePObjectSuppress(XMHandle *, HashTable *, PObject *);
00062 
00063 extern XMOffset
00064   HashTableTRObjectLookup(XMHandle *, HashTable *, const Oid *),
00065   HashTablePObjectLookup(XMHandle *, HashTable *, const Oid *);
00066 
00067 }

Generated on Mon Dec 22 18:15:55 2008 for eyedb by  doxygen 1.5.3