本文整理汇总了C++中EventQueue::pushTimerEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ EventQueue::pushTimerEvent方法的具体用法?C++ EventQueue::pushTimerEvent怎么用?C++ EventQueue::pushTimerEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventQueue
的用法示例。
在下文中一共展示了EventQueue::pushTimerEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testThread
void testThread(int n, ServiceLocator* aDifferentThreadsLocator) {
ServiceLocator* loc = ServiceLocator::getDefaultLocator();
ServiceLocator* loc2 = ServiceLocator::getDefaultLocator();
Timer* timer1 = loc->locateTimerService();
Timer* timer2 = loc2->locateTimerService();
MessageService* mes1 = loc->locateMessageService();
MessageService* mes2 = loc2->locateMessageService();
assert(mes1 == mes2);
mes1->publish("someMessage", StringMap());
MessageService* mes3 = aDifferentThreadsLocator->locateMessageService();
mes3->publish("aMessage", StringMap());
EventQueue* eq = loc->locateEventService();
eq->pushTimerEvent(loc->locateTimerService()->getTimeStamp());
assert(loc == loc2);
assert(loc != aDifferentThreadsLocator);
assert(loc != NULL);
assert(aDifferentThreadsLocator != NULL);
assert(timer1 == timer2);
assert(mes1 != NULL);
assert(mes3 != NULL);
assert(mes1 != mes3);
}