First public contribution.
1 // Copyright (c) 2009 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 the License "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 // e32\include\kernel\smap.h
28 SMap uses a binary search to perform quick lookups (finds) whilst Add and
29 Remove and Iterating is happening concurrently. This container is optimised
32 Add, Remove and Iterator check that the caller has the heavy wait Mutex lock
35 Find methods use the fast lock whilst performing look ups.
41 SMap(NFastMutex* aFastLock, DMutex* aSlowLock);
44 TInt Add(TUint aKey, TAny* aObject);
45 TAny* Remove(TUint aKey);
46 TAny* Find(TUint aKey);
48 FORCE_INLINE TUint Count()
67 FORCE_INLINE TIterator(SMap& aMap) : iMap(aMap), iPos(0)
81 FORCE_INLINE void FastLock()
83 NKern::FMWait(iFastLock);
86 FORCE_INLINE void FastUnlock()
88 NKern::FMSignal(iFastLock);
91 TUint FindIndex(TUint aKey);
96 NFastMutex* iFastLock;
100 friend class TIterator;