Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

HashForBufferList.h

Go to the documentation of this file.
00001 #ifndef HASH_FOR_BUFFER_LIST_H 00002 #define HASH_FOR_BUFFER_LIST_H 00003 00004 // DEPRECATED!! INCLUDE as I did below ... 00005 //#include <hash_map.h> 00006 #include <algorithm> 00007 #include <ext/hash_map> 00008 using __gnu_cxx::hash; 00009 using __gnu_cxx::hash_map; 00010 00011 #include "BufferList.h" 00012 00013 /* 00014 struct buffer_hash 00015 { 00016 size_t operator()(key_type* s) const 00017 { 00018 unsigned long h = 0; 00019 for (int i = 0; i < s->key_size; i++) 00020 h = 5*h + s->key[i]; 00021 return size_t(h); 00022 } 00023 }; 00024 */ 00025 00026 struct equal_string 00027 { 00028 bool operator()(const char *s1, const char *s2) const 00029 { 00030 return strcmp(s1, s2) == 0; 00031 } 00032 }; 00033 00034 00035 class HashForBufferList 00036 { 00037 public: 00038 HashForBufferList(); 00039 ~HashForBufferList() {}; 00040 00041 BufferList* getBufferList(char *value); 00042 00043 void addBufferList(BufferList *list); 00044 int getHashSize(); 00045 int getBufferListSize(char *value); 00046 bool isEmpty(); 00047 00048 //*************************** 00049 //is this method even necessary? 00050 //what arguments?????????????????? 00051 void removeBufferList(); 00052 00053 00054 00055 private: 00056 00057 hash_map<char*, BufferList*, hash<const char*>, equal_string> _hash_map; 00058 hash_map<char*, BufferList*, hash<const char*>, equal_string>::iterator _hash_iter; 00059 00060 }; 00061 00062 #endif

Generated on Fri Nov 12 15:15:21 2004 for Borealis by doxygen 1.3.8