本文整理汇总了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;
}
示例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;
}