Update contrib.
1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Hexadecimal trees - inline functions
21 Constructor. It constructs an associative array with no key-value pairs.
23 @param aHeap A pointer to the heap to be used by the associative array
24 implementation to allocate memory for internal data structures. This
25 heap can be shared between several processes.
28 inline RHexTree<T>::RHexTree(RHeap* aHeap)
34 Adds a key-value pair to this associative array.
36 @param aKey The 32-bit key to add to this associative array.
37 @param aValue A pointer to the value to associate with aKey. It must have been
38 allocated on the same heap as the one used by the associative array
39 implementation to allocate memory for internal data structures. Ownership
40 is transferred to this associative array.
41 @return KErrNone if the key-value pair was added successfully. KErrNoMemory if
42 there was not enough memory in the heap for internal data structures.
43 KErrAlreadyExists if an attempt was made to add a duplicate key.
46 inline TInt RHexTree<T>::SetAt(TUint aKey, T* aValue)
48 return RHexTreeBase::SetAt(aKey, aValue);
52 Looks up a given key in this associative array and returns a pointer to the
55 @param aKey The 32-bit key to look up.
56 @return A pointer to the corresponding value in this associative array, if the
57 given key was found. The value may not be modified via this pointer.
58 NULL if the given key was not found.
61 inline const T* RHexTree<T>::At(TUint aKey) const
63 return static_cast<T*>(RHexTreeBase::At(aKey));
67 Looks up a given key in this associative array and returns a pointer to the
68 corresponding value. Note that if values are modified after being added to an
69 associative array, then the user is responsible for synchronisation when
70 concurrent access is needed.
72 @param aKey The 32-bit key to look up.
73 @return A pointer to the corresponding value in this associative array, if the
74 given key was found. The value may be modified via this pointer.
75 NULL if the given key was not found.
78 inline T* RHexTree<T>::At(TUint aKey)
80 return static_cast<T*>(RHexTreeBase::At(aKey));