當前位置: 首頁>>代碼示例>>C++>>正文


C++ TList::Next方法代碼示例

本文整理匯總了C++中TList::Next方法的典型用法代碼示例。如果您正苦於以下問題:C++ TList::Next方法的具體用法?C++ TList::Next怎麽用?C++ TList::Next使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TList的用法示例。


在下文中一共展示了TList::Next方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: RemoveController

//----------------------------------------------------------------------------
void Object::RemoveController (Controller* pkController)
{
    // check if controller is in list
    TList<ControllerPtr>* pkList = m_pkControllerList;
    TList<ControllerPtr>* pkPrev = 0;
    for (/**/; pkList; pkPrev = pkList, pkList = pkList->Next())
    {
        if (pkList->Item() == pkController)
        {
            // unbind controller from object
            pkController->SetObject(0);

            // remove the controller
            if (pkPrev)
            {
                // controller not at front of list
                pkPrev->Next() = pkList->Next();
            }
            else
            {
                // controller at front of list
                assert(pkList == m_pkControllerList);
                m_pkControllerList = pkList->Next();
            }
            pkList->Next() = 0;
            WG_DELETE pkList;
            return;
        }
    }
}
開發者ID:juhgiyo,項目名稱:Soft3DEngine,代碼行數:31,代碼來源:WgObject.cpp

示例2: main

int main() {
	TList *list = new TList();
	printf_s("list.First() = %s\n", list->First());
	printf_s("list.Pop() = %s\n", list->Pop());

	list->Push("Hola");
	printf_s("Pushed \"Hola\"!\n");
	list->Push("Holita");
	printf_s("Pushed \"Holita\"!\n");
	list->Push("Que tal?");
	printf_s("Pushed \"Que tal?\"!\n");

	printf_s("list.Next() = %s\n", list->Next());
	printf_s("list.Next() = %s\n", list->Next());
	printf_s("list.Next() = %s\n", list->Next());
	printf_s("list.Next() = %s\n", list->Next());

	printf_s("list.First() = %s\n", list->First());
	printf_s("list.Pop() = %s\n", list->Pop());
	printf_s("list.First() = %s\n", list->First());

	list->Push("Hola");

	list->Reset();
	printf_s("list reset!\n");

	printf_s("list.First() = %s\n", list->First());
	printf_s("list.Next() = %s\n", list->Next());

	delete list;

	getchar();
}
開發者ID:jjimenezg93,項目名稱:CPP_programming,代碼行數:33,代碼來源:main.cpp

示例3: GetReverseList

TList GetReverseList(TList lstSrc) {
	TList copy;
	const char * ptr;

	if (lstSrc.Size() > 0) {
		for (unsigned int l = 0; l < lstSrc.Size(); l++) {
			for (unsigned int i = 0; i < lstSrc.Size() - 2; i++) {
				lstSrc.Next();

			}
			ptr = lstSrc.Next();
			copy.Push(ptr);
		}
	}
	return copy;
}
開發者ID:jjimenezg93,項目名稱:CPP_programming,代碼行數:16,代碼來源:main.cpp

示例4: GetControllerQuantity

//----------------------------------------------------------------------------
int Object::GetControllerQuantity () const
{
    int iControllerQuantity = 0;

    TList<ControllerPtr>* pkList;
    for (pkList = m_pkControllerList; pkList; pkList = pkList->Next())
    {
        iControllerQuantity++;
    }

    return iControllerQuantity;
}
開發者ID:juhgiyo,項目名稱:Soft3DEngine,代碼行數:13,代碼來源:WgObject.cpp

示例5: SetController

//----------------------------------------------------------------------------
// controllers
//----------------------------------------------------------------------------
void Object::SetController (Controller* pkController)
{
    // Controllers may not be controlled.  This avoids arbitrarily complex
    // graphs of Objects.  It is possible to allowed controlled controllers,
    // but modify and proceed at your own risk...
    if (IsDerived(Controller::TYPE))
    {
        assert(false);
        return;
    }

    // controller must exist
    if (!pkController)
    {
        assert(pkController);
        return;
    }

    // check if controller is already in the list
    TList<ControllerPtr>* pkList;
    for (pkList = m_pkControllerList; pkList; pkList = pkList->Next())
    {
        if (pkList->Item() == pkController)
        {
            // controller already exists, nothing to do
            return;
        }
    }

    // bind controller to object
    pkController->SetObject(this);

    // controller not in current list, add it
    pkList = WG_NEW TList<ControllerPtr>;
    pkList->Item() = pkController;
    pkList->Next() = m_pkControllerList;
    m_pkControllerList = pkList;
}
開發者ID:juhgiyo,項目名稱:Soft3DEngine,代碼行數:41,代碼來源:WgObject.cpp

示例6: UpdateControllers

//----------------------------------------------------------------------------
bool Object::UpdateControllers (double dAppTime)
{
    bool bSomeoneUpdated = false;
    TList<ControllerPtr>* pkList;
    for (pkList = m_pkControllerList; pkList!=NULL; pkList = pkList->Next())
    {
        Controller* pkController = pkList->Item();
        assert(pkController);
        if (pkController->Update(dAppTime))
        {
            bSomeoneUpdated = true;
        }
    }
    return bSomeoneUpdated;
}
開發者ID:juhgiyo,項目名稱:Soft3DEngine,代碼行數:16,代碼來源:WgObject.cpp

示例7: GetController

//----------------------------------------------------------------------------
Controller* Object::GetController (int i) const
{
    assert(i >= 0);

    TList<ControllerPtr>* pkList = m_pkControllerList;
    for (int j = 0; j < i; j++, pkList = pkList->Next())
    {
        if (!pkList)
        {
            // i >= iControllerQuantity
            return 0;
        }
    }
    return (pkList ? pkList->Item() : 0);
}
開發者ID:juhgiyo,項目名稱:Soft3DEngine,代碼行數:16,代碼來源:WgObject.cpp

示例8: GetAllObjectsByName

//----------------------------------------------------------------------------
void Object::GetAllObjectsByName (const String& rkName,
    TArray<Object*>& rkObjects)
{
    if (rkName == m_kName)
    {
        rkObjects.Append(this);
    }

    TList<ControllerPtr>* pkList;
    for (pkList = m_pkControllerList; pkList!=NULL; pkList = pkList->Next())
    {
        Controller* pkController = pkList->Item();
        if (pkController)
        {
            pkController->GetAllObjectsByName(rkName,rkObjects);
        }
    }
}
開發者ID:juhgiyo,項目名稱:Soft3DEngine,代碼行數:19,代碼來源:WgObject.cpp

示例9: GetObjectByID

//----------------------------------------------------------------------------
Object* Object::GetObjectByID (unsigned int uiID)
{
    if (uiID == m_uiID)
    {
        return this;
    }

    TList<ControllerPtr>* pkList;
    for (pkList = m_pkControllerList; pkList!=NULL; pkList = pkList->Next())
    {
        Controller* pkController = pkList->Item();
        if (pkController)
        {
            Object* pkFound = pkController->GetObjectByID(uiID);
            if (pkFound)
            {
                return pkFound;
            }
        }
    }

    return 0;
}
開發者ID:juhgiyo,項目名稱:Soft3DEngine,代碼行數:24,代碼來源:WgObject.cpp

示例10: GetObjectByName

//----------------------------------------------------------------------------
// name and unique id
//----------------------------------------------------------------------------
Object* Object::GetObjectByName (const String& rkName)
{
    if (rkName == m_kName)
    {
        return this;
    }

    TList<ControllerPtr>* pkList;
    for (pkList = m_pkControllerList; pkList!=NULL; pkList = pkList->Next())
    {
        Controller* pkController = pkList->Item();
        if (pkController)
        {
            Object* pkFound = pkController->GetObjectByName(rkName);
            if (pkFound)
            {
                return pkFound;
            }
        }
    }

    return 0;
}
開發者ID:juhgiyo,項目名稱:Soft3DEngine,代碼行數:26,代碼來源:WgObject.cpp


注:本文中的TList::Next方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。