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


C++ Controller::GetNext方法代码示例

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


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

示例1: DetachControl

//----------------------------------------------------------------------------
bool Object::DetachControl (Controller* pkControl)
{
    if ( pkControl && m_spkControl )
    {
        if ( pkControl == m_spkControl )
        {
            // controller at front of list, remove it
            pkControl->SetObject(NULL);
            ControllerPtr spkSave = pkControl;  // prevent delete
            m_spkControl = pkControl->GetNext();
            pkControl->SetNext(NULL);

            // TO DO. If the reference count for pkControl is 1, when the
            // function returns, spkSave's destructor will delete pkControl.
            // Warn the application about this?
            return true;
        }

        // search for controller
        Controller* pkPrevious = WmlSmartPointerCast(Controller,m_spkControl);
        Controller* pkCurrent = pkPrevious->GetNext();
        while ( pkCurrent && pkCurrent != pkControl )
        {
            pkPrevious = pkCurrent;
            pkCurrent = pkCurrent->GetNext();
        }
        if ( pkCurrent )
        {
            // found the controller, remove it
            pkControl->SetObject(NULL);
            ControllerPtr spkSave = pkControl;  // prevent delete
            pkPrevious->SetNext(pkControl->GetNext());
            pkControl->SetNext(NULL);

            // TO DO. If the reference count for pkControl is 1, when the
            // function returns, spkSave's destructor will delete pkControl.
            // Warn the application about this?
            return true;
        }
    }
    return false;
}
开发者ID:Hengplank,项目名称:kucgbowling,代码行数:43,代码来源:WmlObject.cpp

示例2: SaveStrings

//----------------------------------------------------------------------------
StringTree* Object::SaveStrings ()
{
    int iCQuantity = ( m_spkControl ? 1 : 0 );
    StringTree* pkTree = new StringTree(4,0,iCQuantity,0);

    // strings
    pkTree->SetString(0,MakeString(&ms_kRTTI,GetName()));
    pkTree->SetString(1,MakeString("this =",this));
    pkTree->SetString(2,MakeString("ID   =",m_uiID));
    pkTree->SetString(3,MakeString("refs =",m_uiReferences));

    // children
    if ( m_spkControl )
    {
        Controller* pkControl = WmlSmartPointerCast(Controller,m_spkControl);
        iCQuantity = 0;
        while ( pkControl )
        {
            iCQuantity++;
            pkControl = pkControl->GetNext();
        }

        StringTree* pkCTree = new StringTree(1,0,iCQuantity,0);
        pkTree->SetChild(0,pkCTree);
        pkCTree->SetString(0,MakeString("controllers"));
        int iSlot = 0;
        pkControl = WmlSmartPointerCast(Controller,m_spkControl);
        while ( pkControl )
        {
            pkCTree->SetChild(iSlot++,pkControl->SaveStrings());
            pkControl = pkControl->GetNext();
        }
    }

    return pkTree;
}
开发者ID:Hengplank,项目名称:kucgbowling,代码行数:37,代码来源:WmlObject.cpp


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