commonappservices/alarmserver/Client/Source/ASCliSession.cpp
branchRCL_3
changeset 30 fc3225a0ab43
parent 0 2e3d3ce01487
child 39 469fa8a78de7
equal deleted inserted replaced
24:a72ff4214918 30:fc3225a0ab43
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1999-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   740 @param aCategories On return, contains the list of available categories.
   740 @param aCategories On return, contains the list of available categories.
   741 
   741 
   742 */
   742 */
   743 EXPORT_C void RASCliSession::GetAvailableCategoryListL(RArray<TAlarmCategory>& aCategories) const
   743 EXPORT_C void RASCliSession::GetAvailableCategoryListL(RArray<TAlarmCategory>& aCategories) const
   744 	{
   744 	{
       
   745 	CleanupClosePushL(aCategories);
   745 	// First step is to build the transfer buffer in the server
   746 	// First step is to build the transfer buffer in the server
   746 	// and get the size (in bytes) so that we know
   747 	// and get the size (in bytes) so that we know
   747 	// how big to make the client-side (corresponding) temporary one.
   748 	// how big to make the client-side (corresponding) temporary one.
   748 	TPckgBuf<TInt> sizeOfTransferBuffer;
   749 	TPckgBuf<TInt> sizeOfTransferBuffer;
   749 	TIpcArgs args(&sizeOfTransferBuffer);
   750 	TIpcArgs args(&sizeOfTransferBuffer);
   766 		User::LeaveIfError(aCategories.Append(category));
   767 		User::LeaveIfError(aCategories.Append(category));
   767 		}
   768 		}
   768 	//
   769 	//
   769 	stream.Close();
   770 	stream.Close();
   770 	CleanupStack::PopAndDestroy(2, buffer);
   771 	CleanupStack::PopAndDestroy(2, buffer);
       
   772   // relieve the ownership of the array to the caller
       
   773   CleanupStack::Pop(&aCategories);
   771 	}
   774 	}
   772 
   775 
   773 
   776 
   774 /**
   777 /**
   775 
   778 
  1326 /** 
  1329 /** 
  1327 @capability None
  1330 @capability None
  1328 */
  1331 */
  1329 void RASCliSession::FetchAlarmIdsFromBufferL(RArray<TAlarmId>& aAlarmIds, TInt aBufferSize) const
  1332 void RASCliSession::FetchAlarmIdsFromBufferL(RArray<TAlarmId>& aAlarmIds, TInt aBufferSize) const
  1330 	{
  1333 	{
       
  1334 	CleanupClosePushL(aAlarmIds);
  1331 	CBufBase* buffer = FetchTransferBufferLC(aBufferSize);
  1335 	CBufBase* buffer = FetchTransferBufferLC(aBufferSize);
  1332 
  1336 
  1333 	// The buffer just contains serialized TAlarmId's so we need to
  1337 	// The buffer just contains serialized TAlarmId's so we need to
  1334 	// extract them and populate the array.
  1338 	// extract them and populate the array.
  1335 	aAlarmIds.Reset();
  1339 	aAlarmIds.Reset();
  1342 		const TAlarmId id = stream.ReadInt32L();
  1346 		const TAlarmId id = stream.ReadInt32L();
  1343 		aAlarmIds.AppendL(id);
  1347 		aAlarmIds.AppendL(id);
  1344 		}
  1348 		}
  1345 	//
  1349 	//
  1346 	CleanupStack::PopAndDestroy(2, buffer);
  1350 	CleanupStack::PopAndDestroy(2, buffer);
       
  1351 	// relieve the ownership of the array to the caller
       
  1352 	CleanupStack::Pop(&aAlarmIds); 
  1347 	}
  1353 	}
  1348 
  1354 
  1349 /** 
  1355 /** 
  1350 Create a buffer of sufficient size in order to fetch the buffer from the server
  1356 Create a buffer of sufficient size in order to fetch the buffer from the server
  1351 
  1357