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