本文整理汇总了C++中TList::GetFirst方法的典型用法代码示例。如果您正苦于以下问题:C++ TList::GetFirst方法的具体用法?C++ TList::GetFirst怎么用?C++ TList::GetFirst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TList
的用法示例。
在下文中一共展示了TList::GetFirst方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void
Client::OnWorkerEvent(WorkerEvent& pEvent) {
switch (pEvent.m_eventType) {
case WorkerEvent::CONNECTING:
if (pEvent.isFailed())
{
m_statConnecting--;
m_statFailed++;
}
break;
case WorkerEvent::SENDING:
if (pEvent.isFailed())
{
m_statFailed++;
m_statSending--;
}
else
{
m_statConnecting--;
m_statSending++;
}
break;
case WorkerEvent::RECEIVING:
if (pEvent.isFailed())
{
m_statReceiving--;
m_statFailed++;
}
else
{
m_statSending--;
m_statReceiving++;
}
break;
case WorkerEvent::DISCONNECTING:
if (pEvent.isFailed())
{
m_statDisconnecting--;
m_statFailed++;
}
else
{
m_statReceiving--;
m_statDisconnecting++;
}
break;
case WorkerEvent::DONE:
m_statDone++;
m_statDisconnecting--;
break;
};
if (pEvent.isFailed() || pEvent.m_eventType == WorkerEvent::DONE)
{
for(TList::compatibility_iterator it = m_threadWorkers.GetFirst(); it ; it = it->GetNext()) {
if (it->GetData() == pEvent.m_sender) {
m_threadWorkers.DeleteNode(it);
break;
}
}
for(EList::compatibility_iterator it2 = m_eventWorkers.GetFirst(); it2 ; it2 = it2->GetNext())
{
if (it2->GetData() == pEvent.m_sender) {
delete it2->GetData();
m_eventWorkers.DeleteNode(it2);
break;
}
}
if ((m_threadWorkers.GetCount() == 0) && (m_eventWorkers.GetCount() == 0))
{
mTimer.Stop();
dumpStatistics();
wxSleep(2);
ExitMainLoop();
}
else
{
mTimer.Start(timeout_val,true);
}
}
}