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


C++ CAmSocketHandler::addTimer方法代码示例

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


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

示例1: SetUp

void CAmEnvironment::SetUp()
{
    logInfo("RoutingSendInterface Test started ");

    std::vector<int> domainIDs;
    domainIDs.push_back(0);
    domainIDs.push_back(1);

    EXPECT_CALL(pReceiveInterface,getSocketHandler(_)).WillOnce(DoAll(SetArgReferee<0>(&pSocketHandler), Return(E_OK)));
    EXPECT_CALL(pReceiveInterface,registerDomain(_,_)).WillRepeatedly(Invoke(CAmEnvironment::handleDomainRegister));
    EXPECT_CALL(pReceiveInterface,registerSource(_,_)).WillRepeatedly(Invoke(CAmEnvironment::handleSourceRegister));
    EXPECT_CALL(pReceiveInterface,registerSink(_,_)).WillRepeatedly(Invoke(CAmEnvironment::handleSinkRegister));
    EXPECT_CALL(pReceiveInterface,confirmRoutingReady(_)).Times(1);

    IAmRoutingSend* (*createFunc)();
    void* tempLibHandle = NULL;
    std::string libname("../plugins/routing/libPluginRoutingInterfaceAsync.so");
    createFunc = getCreateFunction<IAmRoutingSend*()>(libname, tempLibHandle);

    if (!createFunc)
    {
        logError("RoutingSendInterface Test Entry point of RoutingPlugin not found");
        exit(1);
    }

    pRouter = createFunc();

    if (!pRouter)
    {
        logError("RoutingSendInterface Test RoutingPlugin initialization failed. Entry Function not callable");
        exit(1);
    }

    pRouter->startupInterface(&pReceiveInterface);
    pRouter->setRoutingReady(10);

    timespec t;
    t.tv_nsec = 500000000;
    t.tv_sec = 1;

    sh_timerHandle_t handle;

    //lets use a timeout so the test will finish
    pSocketHandler.addTimer(t, &ptimerCallback, handle, (void*) NULL);
    pSocketHandler.start_listenting();

}
开发者ID:Airtau,项目名称:genivi,代码行数:47,代码来源:CAmRoutingReceiverAsync.cpp


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