void CSsmCommandListResourceReaderImpl::CResourcePool::GetCommandListIdsL(RArray<TInt>& aArray) const
	{
	TInt count = iMappings.Count();
	__ASSERT_ALWAYS(count > 0, PanicNow(KPanicCmdResourceReader, ENotInitialized3));
	if (aArray.Count() != 0)
		{
		SSMLOGLEAVE(KErrArgument);
		}
	aArray.ReserveL(count);
#ifdef SYMBIAN_SSM_FLEXIBLE_MERGE
	TInt i = 0;
	for(i = 0; i < iMappings.Count() - 1 ; ++i)
		{
		if(iMappings[i].iCommandListId != iMappings[i+1].iCommandListId)
			{
			aArray.AppendL(iMappings[i].iCommandListId);
			}
		}
	//append the last element anyway as it is already compared
	aArray.AppendL(iMappings[i].iCommandListId);
	aArray.Compress();
		
	DEBUGPRINT2(_L("The number of substates in resource files : %d"),iMappings.Count() );
	DEBUGPRINT2(_L("The number of substates after filtering duplicates : %d"),aArray.Count());
#else
	for(TInt i = 0; i < count; ++i)
		{
		aArray.AppendL(iMappings[i].iCommandListId);
		}
#endif
	}
Beispiel #2
0
void CResponseHandler::RunL()
{
    // if any existing -> Send response
    if (iResponseArray.Count()) {
        CompleteAnyKey(iResponseArray[0]);
        // Remove already completed key
        iResponseArray.Remove(0);
        iResponseArray.Compress();
    }
}
Beispiel #3
0
inline void RemoveAndCompress(RArray<T>& aContainer, TInt aIndex)
/**
	Remove the indexed item from the supplied array and compress
	the array.
	
	Without compression, the memory at the end of the array will
	not be freed.  Unless the memory is freed, memory leak testing
	will fail.
	
	@param	aContainer		Array from which item must be removed.
	@param	aIndex			Item to remove from array.
 */
	{
	aContainer.Remove(aIndex);
	aContainer.Compress();
	}