examples/Base/HashTableExample/hashtableexample.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
00003 
00004 Redistribution and use in source and binary forms, with or without
00005 modification, are permitted provided that the following conditions are met:
00006 
00007 * Redistributions of source code must retain the above copyright notice, this
00008   list of conditions and the following disclaimer.
00009 * Redistributions in binary form must reproduce the above copyright notice,
00010   this list of conditions and the following disclaimer in the documentation
00011   and/or other materials provided with the distribution.
00012 * Neither the name of Nokia Corporation nor the names of its contributors
00013   may be used to endorse or promote products derived from this software
00014   without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00017 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00020 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00021 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00022 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00023 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00024 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00025 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 
00027 Description: Contains CHashTableExample class.  
00028 */
00029 
00030 
00031 
00035 #ifndef __HASHTABLEEXAMPLE_H__
00036 #define __HASHTABLEEXAMPLE_H__
00037 
00038 // Symbian platform includes
00039 #include <e32cons.h>
00040 
00041 // Literals
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 

Generated by  doxygen 1.6.2