本文整理汇总了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();
}