00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00035 #ifndef __HASHTABLEEXAMPLE_H__
00036 #define __HASHTABLEEXAMPLE_H__
00037
00038
00039 #include <e32cons.h>
00040
00041
00042 _LIT(KTitle, "Hash Table Example" );
00043 _LIT(KFailed, "\nFailed to complete");
00044 _LIT(KPressAKeyMsg, "\n\nPress any key to step through the example\n");
00045 _LIT(KExitMsg, "\nPress any key to exit the application ");
00046 _LIT(KPressAKey, "\nPress any key to continue\n");
00047 _LIT(KWelcome, "\n Welcome to the hash table example application");
00048 _LIT(KConstruct, " Construction: \n");
00049 _LIT(KOperation, " Operation: \n");
00050 _LIT(KAnd," And ");
00051
00052 _LIT(KHashSet, "\n HASH SET: \n");
00053 _LIT(KConstructDefaultHashSet, "\t Construction of hash set using default hash and identity function: successful\n");
00054 _LIT(KConstructOwnHashSet, "\t Construction of hash set using custom hash and identity function: successful\n");
00055 _LIT(KInsertItemsToHashSet, "\t Insertion of items to hash set: successful\n");
00056 _LIT(KItemPresentInHashSet, "\t Item is present in hash set\n");
00057 _LIT(KItemNotPresentInHashSet, "\t Item is not present in hash set\n");
00058 _LIT(KIterateItemsFromHashSet, "\t Iteration of items from hash set: successful\n");
00059 _LIT(KRemoveItemsFromHashSet, "\t Removal of items from hash set: successful\n");
00060
00061 _LIT(KPtrHashSet, "\n HASH SET OF POINTERS: \n");
00062 _LIT(KConstructDefaultPtrHashSet, "\t Construction of hash set of pointers using default hash and identity function: successful\n");
00063 _LIT(KConstructOwnPtrHashSet, "\t Construction of hash set of pointers using custom hash and identity function: successful\n");
00064 _LIT(KInsertItemsToPtrHashSet, "\t Insertion of items to hash set of pointers: successful\n");
00065 _LIT(KItemPresentInPtrHashSet, "\t Item is present in the hash set of pointers\n");
00066 _LIT(KItemNotPresentInPtrHashSet, "\t Item is not present in hash set of pointers\n");
00067 _LIT(KIterateItemsFromPtrHashSet, "\t Iteration of items from hash set of pointers: successful\n");
00068 _LIT(KRemoveItemsFromPtrHashSet, "\t Removal of items from hash set of pointers: successful\n");
00069 _LIT(KFindItem,"eleven");
00070 _LIT(KRemoveItem,"twenty");
00071
00072
00073 _LIT(KHashMap, "\n HASH MAP: \n");
00074 _LIT(KConstructDeafultHashMap, "\t Construction of hash map using default hash and identity function: successful\n");
00075 _LIT(KConstructOwnHashMap, "\t Construction of hash map using custom hash and identity function: successful\n");
00076 _LIT(KInsertItemsToHashMap, "\t Insertion of items to hash map: successful\n");
00077 _LIT(KItemPresentInHashMap, "\t Item is present in hash map\n");
00078 _LIT(KItemNotPresentInHashMap, "\t Item is not present in hash map\n");
00079 _LIT(KIterateItemsFromHashMap, "\t Iteration of items from hash map: successful\n");
00080 _LIT(KRemoveItemsFromHashMap, "\t Removal of items from hash map: successful\n");
00081
00082 _LIT(KPtrHashMap, "\n HASH MAP OF POINTERS: \n");
00083 _LIT(KConstructDeafultPtrHashMap, "\t Construction of hash map of pointers using default hash and identity function: successful\n");
00084 _LIT(KConstructOwnPtrHashMap, "\t Construction of hash map of pointers using custom hash and identity function: successful\n");
00085 _LIT(KInsertItemsToPtrHashMap, "\t Insertion of items to hash map of pointers: successful\n");
00086 _LIT(KItemPresentInPtrHashMap, "\t Item is present in hash map of pointers\n");
00087 _LIT(KItemNotPresentInPtrHashMap, "\t Item is not present in hash map of pointers\n");
00088 _LIT(KIterateItemsFromPtrHashMap, "\t Iteration of items from hash map of pointers: successful\n");
00089 _LIT(KRemoveItemsFromPtrHashMap, "\t Removal of items from hash map of pointers: successful\n");
00090
00105 class CHashTableExample: public CBase
00106 {
00107 public:
00108 static CHashTableExample* NewL();
00109 ~CHashTableExample();
00110
00111 void ConstructDefaultHashSet();
00112 void ConstructOwnHashSet();
00113 void OperationsToHashSetL();
00114 void ConstructDefaultPtrHashSet();
00115 void ConstructOwnPtrHashSet();
00116 void OperationsToPtrHashSetL();
00117 void ConstructDefaultHashMap();
00118 void ConstructOwnHashMap();
00119 void OperationsToHashMapL();
00120 void ConstructDefaultPtrHashMap();
00121 void ConstructOwnPtrHashMap();
00122 void OperationsToPtrHashMapL();
00123
00124 private:
00125 CHashTableExample();
00126 void ConstructL();
00127
00128 private:
00130 CConsoleBase* iConsole;
00131
00133 RPointerArray<TDesC16> iPointerArray;
00134 };
00135
00136 #endif //__HASHTABLEEXAMPLE_H__
00137
00138
00139