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


C++ CMsvEntry::SetEntryNoCheckL方法代码示例

本文整理汇总了C++中CMsvEntry::SetEntryNoCheckL方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvEntry::SetEntryNoCheckL方法的具体用法?C++ CMsvEntry::SetEntryNoCheckL怎么用?C++ CMsvEntry::SetEntryNoCheckL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMsvEntry的用法示例。


在下文中一共展示了CMsvEntry::SetEntryNoCheckL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TestMoveMultipleEntry

void CTestPerformanceM::TestMoveMultipleEntry()
{
    _LIT(KFunction, "TestMoveMultipleEntry");
    INFO_PRINTF1(KFunction);

    TSecureId owner = 0x999;
    TUint32 start, stop;
    TMsvEntry entry;
    CMsvEntry* parent = NULL;
    TMsvLocalOperationProgress progress = TMsvLocalOperationProgress();
    CMsvEntrySelection* entries = new(ELeave) CMsvEntrySelection;
    TReal64 diff = 0;

    iServerSide = EFalse;

    INFO_PRINTF1(_L("<b>CLIENT SIDE</b>"));
    TInt frequency;
    HAL::Get(HALData::EFastCounterFrequency, frequency);
    INFO_PRINTF2(_L("<b>FastCounter frequency: %d</b>"), frequency);

    parent = iTestUtils->iMsvSession->GetEntryL(KMsvDraftEntryId);

    //[1]. Move entries from Drafts to Outbox, and back again, and so on.
    for(TInt index = 0; index < 10; ++index)
    {
        TMsvEntry entry;
        entry.SetId((TMsvId)20000+index);
        entry.SetParent(KMsvDraftEntryId);
        entry.iType = KUidMsvMessageEntry;
        entry.iMtm = KUidMsvMessageEntry;
        entry.iServiceId = KMsvLocalServiceIndexEntryId;
        parent->CreateL(entry);
        entries->AppendL(entry.iId);
    }
    parent->SetEntryNoCheckL(KMsvDraftEntryId); //bring to cache
    start = User::FastCounter();
    parent->MoveL(*entries, KMsvGlobalOutBoxIndexEntryId, progress); //iTestActive->iStatus);
    stop = User::FastCounter();
    diff = (TReal64)(stop-start)/frequency;
    INFO_PRINTF3(_L("---Time taken to MOVE %d entries from Drafts which has 10 entries: <b>%f sec</b>"), 10, diff);
    MY_ASSERT_EQUALS(entries->Count(), 10);

    parent->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
    for(TInt index = 0; index < 90; ++index)
    {
        TMsvEntry entry;
        entry.SetId((TMsvId)21000+index);
        entry.SetParent(KMsvGlobalOutBoxIndexEntryId);
        entry.iType = KUidMsvMessageEntry;
        entry.iMtm = KUidMsvMessageEntry;
        entry.iServiceId = KMsvLocalServiceIndexEntryId;
        parent->CreateL(entry);
        entries->AppendL(entry.iId);
    }
    parent->SetEntryNoCheckL(KMsvGlobalOutBoxIndexEntryId); //bring to cache
    start = User::FastCounter();
    parent->MoveL(*entries, KMsvDraftEntryId, progress);
    stop = User::FastCounter();
    diff = (TReal64)(stop-start)/frequency;
    INFO_PRINTF3(_L("---Time taken to MOVE %d entries from Outbox which has 100 entries: <b>%f sec</b>"), 100, diff);
    MY_ASSERT_EQUALS(entries->Count(), 100);

    parent->SetEntryL(KMsvDraftEntryId);
    for(TInt index = 0; index < 400; ++index)
    {
        TMsvEntry entry;
        entry.SetId((TMsvId)22000+index);
        entry.SetParent(KMsvDraftEntryId);
        entry.iType = KUidMsvMessageEntry;
        entry.iMtm = KUidMsvMessageEntry;
        entry.iServiceId = KMsvLocalServiceIndexEntryId;
        parent->CreateL(entry);
        entries->AppendL(entry.iId);
    }
    start = User::FastCounter();
    parent->MoveL(*entries, KMsvGlobalOutBoxIndexEntryId, progress);
    stop = User::FastCounter();
    diff = (TReal64)(stop-start)/frequency;
    INFO_PRINTF3(_L("---Time taken to MOVE %d entries from Drafts which has 500 entries: <b>%f sec</b>"), 500, diff);
    MY_ASSERT_EQUALS(entries->Count(), 500);

    parent->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
    for(TInt index = 0; index < 500; ++index)
    {
        TMsvEntry entry;
        entry.SetId((TMsvId)22000+index);
        entry.SetParent(KMsvGlobalOutBoxIndexEntryId);
        entry.iType = KUidMsvMessageEntry;
        entry.iMtm = KUidMsvMessageEntry;
        entry.iServiceId = KMsvLocalServiceIndexEntryId;
        parent->CreateL(entry);
        entries->AppendL(entry.iId);
    }
    start = User::FastCounter();
    parent->MoveL(*entries, KMsvDraftEntryId, progress);
    stop = User::FastCounter();
    diff = (TReal64)(stop-start)/frequency;
    INFO_PRINTF3(_L("---Time taken to MOVE %d entries from Outbox which has 1000 entries: <b>%f sec</b>"), 1000, diff);
    MY_ASSERT_EQUALS(entries->Count(), 1000);

//.........这里部分代码省略.........
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:101,代码来源:t_msv_performancem.cpp


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