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


C++ TList::GetCount方法代码示例

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


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

示例1: OnButtonBack

 bool OnButtonBack()
 {
     if (m_listHistory.GetCount() > 1) {
         m_listHistory.PopFront();
         DoSetTopic();
     }
     return true;
 }
开发者ID:borgified,项目名称:Allegiance,代码行数:8,代码来源:help.cpp

示例2: strlen

void Win32App::DebugOutput(const char *psz)
{
    #ifdef MemoryOutput
        g_listOutput.PushFront(ZString(psz));

        if (g_listOutput.GetCount() > 100) {
            g_listOutput.PopEnd();
        }
    #else
		// mmf for now tie this to a registry key
		if (g_outputdebugstring)
			::OutputDebugStringA(psz);

        if (g_logfile) {
            DWORD nBytes;
            ::WriteFile(g_logfile, psz, strlen(psz), &nBytes, NULL);
        }
    #endif
}
开发者ID:FreeAllegiance,项目名称:Allegiance-R7-With-R4-Engine,代码行数:19,代码来源:Win32app.cpp

示例3: GetNumPlayingVirtualBuffers

    // Gets the number of virtual sound buffers that are playing at a given 
    // moment.  (no guarantees on how this number changes - it's just a perf.
    // number to use.)
    virtual HRESULT GetNumPlayingVirtualBuffers(int& nBuffers)
    {
        nBuffers = m_listPlayingSounds.GetCount();

        return S_OK;
    };
开发者ID:borgified,项目名称:Allegiance,代码行数:9,代码来源:dummysound.cpp

示例4: OnTryLogon

    bool OnTryLogon (void)
    {
        TList<TRef<LANServerInfo> > listResults;

        // try ten times
        int iTryCount = 10;
        while (iTryCount-- && (listResults.GetCount () == 0))
        {
            // initiate a query for the local server
            trekClient.FindStandaloneServersByName ("127.0.0.1", listResults); //Imago REVIEW this hardly works now-a-days 6/10

            // now, for 6 seconds, check to see if we found it every half second
            for (int i = 0; (i < 12) && (listResults.GetCount () == 0); i++)
            {
                Sleep (500);
                trekClient.FindStandaloneServersByName (NULL, listResults);
            }
        }

        // if we found a server...
        if (listResults.GetCount () == 1)
        {
            // there should be only one game on the server
            TList<TRef<LANServerInfo> >::Iterator iterNew(listResults);
            if (iterNew.Value ()->strGameName == TRAINING_MISSION_7_GAME_NAME)
            {
                // set ourselves to not be in the lobby or the zone
                trekClient.SetIsLobbied(false);
                trekClient.SetIsZoneClub(false);

                // set up the connection info
                BaseClient::ConnectInfo     ci;
                ci.guidSession = iterNew.Value ()->guidSession;
                strcpy (ci.szName, "Cadet");

                // we try five times
                iTryCount = 5;
                while (iTryCount-- && !trekClient.m_fm.IsConnected ())
                {
                    // close any popups
                    while (!GetWindow()->GetPopupContainer()->IsEmpty())
                        GetWindow()->GetPopupContainer()->ClosePopup(NULL);
                    GetWindow()->RestoreCursor();
                    
                    // connect to the server
                    trekClient.ConnectToServer (ci, NA, Time::Now(), "", true);
                }
            }
        }

        // if we didn't get connected
        if (!trekClient.m_fm.IsConnected ())
        {
            // close any popups
            while (!GetWindow()->GetPopupContainer()->IsEmpty())
                GetWindow()->GetPopupContainer()->ClosePopup(NULL);
            GetWindow()->RestoreCursor();

            // give some indication of what happened
            TRef<IMessageBox> pmsgBox = CreateMessageBox("Connection to standalone server failed.");
            GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false);

            // terminate the game so they can try again
            KillStandaloneGame ();

            // report the number of servers found as a diagnostic
            #ifdef _DEBUG
            char    szBuffer[256];
            sprintf (szBuffer, "Found %d servers.\n", listResults.GetCount ());
            debugf (szBuffer);
            #endif
        }
        else
        {
            // tell training that this is the live mission
            Training::StartMission (Training::c_TM_7_Live);
        }

        return false;
    }
开发者ID:borgified,项目名称:Allegiance,代码行数:80,代码来源:trainingscreen.cpp

示例5: BuildStaticCoreInfo

void CLobbyApp::BuildStaticCoreInfo()
{
	// build the master core list
	// then set coremask for each server
	// 1. get ride of the old list
	FreeStaticCoreInfo();
	// 2. loop thru unpaused servers and build a TList of StaticCoreInfo and the coremask
	ListConnections::Iterator iterCnxn(*GetFMServers().GetConnections());
	TList<StaticCoreInfo*,StaticCoreInfoEquals> CoreList;
	while (!iterCnxn.End())
	{
		CFLServer * pServerT = CFLServer::FromConnection(*iterCnxn.Value());
		if (pServerT) // skip lost/terminating server
		{
			pServerT->SetStaticCoreMask(0); // clear the core mask, not really needed here but it doesnt hurt
			int c = pServerT->GetcStaticCoreInfo();
			if (!pServerT->GetPaused()) // skip paused serveR
				for (int i=0; i<c; i++)
				{
					if (!CoreList.Find(&(pServerT->GetvStaticCoreInfo()[i])))
						CoreList.PushFront(&(pServerT->GetvStaticCoreInfo()[i]));
				}
		}
		iterCnxn.Next();
	}

	// 3. Allocate mem 
	m_cStaticCoreInfo = CoreList.GetCount();
	if (m_cStaticCoreInfo)
		m_vStaticCoreInfo =  new StaticCoreInfo[m_cStaticCoreInfo];
	else
		return; // no core, all done


    // 4. transform the TList into an array

	for (int i = 0; i < m_cStaticCoreInfo; i++)
		Strcpy(m_vStaticCoreInfo[i].cbIGCFile,CoreList[i]->cbIGCFile);
	CoreList.SetEmpty();

	// 5. loop thru unpaused servers and build the coremask
	ListConnections::Iterator iterCnxn2(*GetFMServers().GetConnections());
	while (!iterCnxn2.End())
	{
		CFLServer * pServerT = CFLServer::FromConnection(*iterCnxn2.Value());
		if (pServerT) // skip lost/terminating server
		{
			int c = pServerT->GetcStaticCoreInfo();
			pServerT->SetStaticCoreMask(0); // clear the core mask
			if (!pServerT->GetPaused()) // skip paused server
				for (int i=0; i<c; i++)
				{
					for (int j = 0; j < m_cStaticCoreInfo; j++)
						if (strcmp(pServerT->GetvStaticCoreInfo()[i].cbIGCFile,m_vStaticCoreInfo[j].cbIGCFile) == 0)
							pServerT->SetStaticCoreMask(pServerT->GetStaticCoreMask() | 1<<j);
						
				}
		}
		iterCnxn2.Next();
	}
}
开发者ID:BackTrak,项目名称:Allegiance-R4-Engine,代码行数:61,代码来源:lobbyapp.cpp

示例6: 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);
        }
    }
}
开发者ID:ExperimentationBox,项目名称:Edenite,代码行数:81,代码来源:baseclient.cpp


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