sl@0: // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32\include\e32base_private.h sl@0: // sl@0: // WARNING: This file contains some APIs which are internal and are subject sl@0: // to change without notice. Such APIs should therefore not be used sl@0: // outside the Kernel and Hardware Services package. sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: sl@0: #ifndef __E32BASE_PRIVATE_H__ sl@0: #define __E32BASE_PRIVATE_H__ sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: struct TObjectDataStr //In use if this slot contains pointer to object. sl@0: { sl@0: TInt16 instance; sl@0: TUint16 uniqueID; sl@0: }; sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: struct SObjectIxRec sl@0: { sl@0: union sl@0: { sl@0: TObjectDataStr str; //This is in use if the slot contains pointer to CObject. sl@0: TInt nextEmpty; //This is in use if the slot is empty. Points to the next empty slot ... sl@0: //... in the list. 16 bits would be enough but ARM prefers 32 bytes. sl@0: }; sl@0: CObject* obj; sl@0: }; sl@0: sl@0: /** sl@0: @internalTechnology sl@0: @deprecated sl@0: */ sl@0: class CBitMapAllocator : public CBase sl@0: { sl@0: public: sl@0: IMPORT_C static CBitMapAllocator* New(TInt aSize); sl@0: IMPORT_C static CBitMapAllocator* NewL(TInt aSize); sl@0: IMPORT_C ~CBitMapAllocator(); sl@0: IMPORT_C TInt Alloc(); sl@0: IMPORT_C TInt AllocFrom(TInt aPos); sl@0: IMPORT_C TInt Alloc(TInt aCount, TInt& aConsecutive); sl@0: IMPORT_C TInt AllocAligned(TInt anAlignment); sl@0: IMPORT_C TInt AllocAlignedBlock(TInt anAlignment); sl@0: IMPORT_C TInt AllocFromTop(); sl@0: IMPORT_C TInt AllocFromTopFrom(TInt aPos); sl@0: IMPORT_C void AllocAt(TInt aPos); sl@0: IMPORT_C void AllocAt(TInt aPos, TInt aCount); sl@0: IMPORT_C TBool IsFree(TInt aPos); sl@0: IMPORT_C TBool IsFree(TInt aPos, TInt aCount); sl@0: IMPORT_C void Free(TInt aPos); sl@0: IMPORT_C void Free(TInt aPos, TInt aCount); sl@0: IMPORT_C TInt Avail(); sl@0: IMPORT_C TInt Size(); sl@0: IMPORT_C TInt ExtractRamPages(TInt aConsecutive,TInt& aPageNo); sl@0: protected: sl@0: IMPORT_C CBitMapAllocator(TInt aSize,TInt aLength); sl@0: protected: sl@0: TInt iAvail; sl@0: TInt iSize; sl@0: TInt iLength; sl@0: TUint iMap[1]; sl@0: }; sl@0: sl@0: sl@0: #endif //__E32BASE_H__