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


C++ LLPointer::fetchMedia方法代码示例

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


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

示例1: LLMediaDataClientObjectTest

void mediadataclient_object_t::test<8>()
{
    // Test queue handling of objects that are marked dead.
    LOG_TEST(8);

    LLMediaDataClientObject::ptr_t o1 = new LLMediaDataClientObjectTest(_DATA(VALID_OBJECT_ID_1,"4.0","true"));
    LLMediaDataClientObject::ptr_t o2 = new LLMediaDataClientObjectTest(_DATA(VALID_OBJECT_ID_2,"3.0","true"));
    LLMediaDataClientObject::ptr_t o3 = new LLMediaDataClientObjectTest(_DATA(VALID_OBJECT_ID_3,"2.0","true"));
    LLMediaDataClientObject::ptr_t o4 = new LLMediaDataClientObjectTest(_DATA(VALID_OBJECT_ID_4,"1.0","true"));
    {
        LLPointer<LLObjectMediaDataClient> mdc = new LLObjectMediaDataClient(NO_PERIOD,NO_PERIOD);

        // queue up all 4 objects
        mdc->fetchMedia(o1);
        mdc->fetchMedia(o2);
        mdc->fetchMedia(o3);
        mdc->fetchMedia(o4);

        ensure("is in queue 1", mdc->isInQueue(o1));
        ensure("is in queue 2", mdc->isInQueue(o2));
        ensure("is in queue 3", mdc->isInQueue(o3));
        ensure("is in queue 4", mdc->isInQueue(o4));
        ensure("post records", gPostRecords->size(), 0);

        // and mark the second and fourth ones dead.  Call removeFromQueue when marking dead, since this is what LLVOVolume will do.
        dynamic_cast<LLMediaDataClientObjectTest*>(static_cast<LLMediaDataClientObject*>(o2))->markDead();
        mdc->removeFromQueue(o2);
        dynamic_cast<LLMediaDataClientObjectTest*>(static_cast<LLMediaDataClientObject*>(o4))->markDead();
        mdc->removeFromQueue(o4);

        // The removeFromQueue calls should remove the second and fourth ones
        ensure("is in queue 1", mdc->isInQueue(o1));
        ensure("is not in queue 2", !mdc->isInQueue(o2));
        ensure("is in queue 3", mdc->isInQueue(o3));
        ensure("is not in queue 4", !mdc->isInQueue(o4));
        ensure("post records", gPostRecords->size(), 0);

        ::pump_timers();

        // The first tick should process the first item
        ensure("is not in queue 1", !mdc->isInQueue(o1));
        ensure("is not in queue 2", !mdc->isInQueue(o2));
        ensure("is in queue 3", mdc->isInQueue(o3));
        ensure("is not in queue 4", !mdc->isInQueue(o4));
        ensure("post records", gPostRecords->size(), 1);

        ::pump_timers();

        // The second tick should process the third, emptying the queue
        ensure("is not in queue 3", !mdc->isInQueue(o3));
        ensure("post records", gPostRecords->size(), 2);

        ensure("queue empty", mdc->isEmpty());
    }
    ensure("refcount of o1", o1->getNumRefs(), 1);
    ensure("refcount of o2", o2->getNumRefs(), 1);
    ensure("refcount of o3", o3->getNumRefs(), 1);
    ensure("refcount of o4", o4->getNumRefs(), 1);

}
开发者ID:Belxjander,项目名称:Kirito,代码行数:60,代码来源:llmediadataclient_test.cpp


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