本文整理汇总了C++中ZONE_CONTAINER::IsSame方法的典型用法代码示例。如果您正苦于以下问题:C++ ZONE_CONTAINER::IsSame方法的具体用法?C++ ZONE_CONTAINER::IsSame怎么用?C++ ZONE_CONTAINER::IsSame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZONE_CONTAINER
的用法示例。
在下文中一共展示了ZONE_CONTAINER::IsSame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateCopyOfZonesList
//.........这里部分代码省略.........
for( unsigned kk = 0; kk < aPickList.GetCount(); kk++ )
{
UNDO_REDO_T status = aPickList.GetPickedItemStatus( kk );
ZONE_CONTAINER* ref = (ZONE_CONTAINER*) aPickList.GetPickedItem( kk );
for( unsigned ii = 0; ; ii++ ) // analyse the main picked list
{
ZONE_CONTAINER* zone = aPcb->GetArea( ii );
if( zone == NULL )
{
/* End of list: the stored item is not found:
* it must be in aDeletedList:
* search it and restore initial values
* or
* if flagged UR_NEW: remove it definitively
*/
if( status == UR_NEW )
{
delete ref;
ref = NULL;
aPickList.RemovePicker( kk );
kk--;
}
else
{
ZONE_CONTAINER* zcopy = (ZONE_CONTAINER*) aPickList.GetPickedItemLink( kk );
aPickList.SetPickedItemStatus( UR_DELETED, kk );
wxASSERT_MSG( zcopy != NULL,
wxT( "UpdateCopyOfZonesList() error: link = NULL" ) );
ref->Copy( zcopy );
// the copy was deleted; the link does not exists now.
aPickList.SetPickedItemLink( NULL, kk );
delete zcopy;
}
// Remove this item from aAuxiliaryList, mainly for tests purpose
bool notfound = true;
for( unsigned nn = 0; nn < aAuxiliaryList.GetCount(); nn++ )
{
if( ref != NULL && aAuxiliaryList.GetPickedItem( nn ) == ref )
{
aAuxiliaryList.RemovePicker( nn );
notfound = false;
break;
}
}
wxASSERT_MSG( notfound != true,
wxT( "UpdateCopyOfZonesList() error: item not found in "
"aAuxiliaryList" ) );
break;
}
if( zone == ref ) // picked zone found
{
if( aPickList.GetPickedItemStatus( kk ) != UR_NEW )
{
ZONE_CONTAINER* zcopy = (ZONE_CONTAINER*) aPickList.GetPickedItemLink( kk );
if( zone->IsSame( *zcopy ) ) // Remove picked, because no changes
{
delete zcopy; // Delete copy
aPickList.RemovePicker( kk );
kk--;
}
}
break;
}
}
}
// Add new zones in main pick list, and remove pickers from Auxiliary List
for( unsigned ii = 0; ii < aAuxiliaryList.GetCount(); )
{
if( aAuxiliaryList.GetPickedItemStatus( ii ) == UR_NEW )
{
ITEM_PICKER picker = aAuxiliaryList.GetItemWrapper( ii );
aPickList.PushItem( picker );
aAuxiliaryList.RemovePicker( ii );
}
else if( aAuxiliaryList.GetPickedItemStatus( ii ) == UR_DELETED )
{
delete aAuxiliaryList.GetPickedItemLink( ii );
aAuxiliaryList.RemovePicker( ii );
}
else
ii++;
}
// Should not occur:
wxASSERT_MSG( aAuxiliaryList.GetCount() == 0,
wxT( "UpdateCopyOfZonesList() error: aAuxiliaryList not empty." ) );
}