本文整理汇总了C++中CArrayPtrFlat::Reset方法的典型用法代码示例。如果您正苦于以下问题:C++ CArrayPtrFlat::Reset方法的具体用法?C++ CArrayPtrFlat::Reset怎么用?C++ CArrayPtrFlat::Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CArrayPtrFlat
的用法示例。
在下文中一共展示了CArrayPtrFlat::Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitializeL
// ---------------------------------------------------------
// CDownloadMgrSession::InitializeL
// ---------------------------------------------------------
//
void CDownloadMgrSession::InitializeL()
{
CLOG_ENTERFN( "CDownloadMgrSession::DownloadMgrAttachCountL" )
iIsMaster = (TBool)CurrentMessage().Int2();
TUid uid;
TPckg<TUid> uidPckg( uid );
Read( 0, uidPckg );
CreateClientAppInstanceL( uidPckg().iUid );
// Check how many download we have and return it to the client
CLOG_WRITE_FORMAT( "CDownloadMgrSession::InitializeL iClientAppInstance %d", iClientAppInstance );
CArrayPtrFlat<CHttpDownload>* currentDownloads = iClientAppInstance->DownloadsL();
TPckg<TInt> countPckg( currentDownloads->Count() );
TPckg<TInt> sessionId( iSessionId );
Write( 1, CurrentMessage(), countPckg );
Write( 3, CurrentMessage(), sessionId );
CLOG_NAME_2( _L("Session_%x_%x"), uidPckg().iUid, iSessionId );
currentDownloads->Reset();
delete currentDownloads;
}
示例2: DownloadMgrAttachL
// ---------------------------------------------------------
// CDownloadMgrSession::DownloadMgrAttachL
// ---------------------------------------------------------
//
void CDownloadMgrSession::DownloadMgrAttachL()
{
CLOG_ENTERFN( "CDownloadMgrSession::DownloadMgrAttachL" )
// The client would like to attach the dowmloads were created previously.
// Here, we create a buffer with the unique handles of download subsessions
// and copy it to the client's address space.
CLOG_WRITE_FORMAT( "CDownloadMgrSession::DownloadMgrAttachL iClientAppInstance %d", iClientAppInstance );
CArrayPtrFlat<CHttpDownload>* currentDownloads = iClientAppInstance->DownloadsL();
CleanupStack::PushL( currentDownloads );
TPckgBuf<TInt> arrayPckg;
HBufC8* buf = HBufC8::NewLC( currentDownloads->Count() * arrayPckg.Size() );
// Cerate subsessions one by one and write the unique handles to the client.
// Later the handles is used by the client subsession to attach to the server.
for( TInt i = 0; i < currentDownloads->Count(); i++ )
{
CHttpDownload* httpDownload = (*currentDownloads)[i];
// make a new download object
CDownloadSubSession* download = CDownloadSubSession::NewL( this, httpDownload );
CleanupStack::PushL( download );
// add object to object container to gererate unique id
iObjectContainer->AddL( download );
// add object to object index; this returns a unique handle so we can get it again
CLOG_WRITE_FORMAT( "CDownloadMgrSession::DownloadMgrAttachL, download %d", download );
arrayPckg() = iObjectIx->AddL( download );
CLOG_WRITE_FORMAT( "CDownloadMgrSession::DownloadMgrAttachL, iObjectIx->ActiveCount() %d", iObjectIx->ActiveCount() );
// Store handle to the subsession. It is used when the URL is checked.
download->SetHandle( arrayPckg() );
CleanupStack::Pop( download ); //download
buf->Des().Append( arrayPckg );
}
TPtr8 ptr = buf->Des();
Write( 0, CurrentMessage(), ptr );
CleanupStack::PopAndDestroy( buf ); // buf
currentDownloads->Reset();
CleanupStack::PopAndDestroy( currentDownloads ); // currentDownloads
}