当前位置: 首页>>代码示例>>C++>>正文


C++ CArrayPtrFlat::Reset方法代码示例

本文整理汇总了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;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:30,代码来源:DownloadMgrSrvSession.cpp

示例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
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:42,代码来源:DownloadMgrSrvSession.cpp


注:本文中的CArrayPtrFlat::Reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。