本文整理汇总了C++中HeeksObj::GetNextOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ HeeksObj::GetNextOwner方法的具体用法?C++ HeeksObj::GetNextOwner怎么用?C++ HeeksObj::GetNextOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HeeksObj
的用法示例。
在下文中一共展示了HeeksObj::GetNextOwner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DealWithTransients
void UndoEngine::DealWithTransients(std::map<HeeksObjId,HeeksObj*> &treemap)
{
std::map<HeeksObj*,std::list<HeeksObj*> >& map = wxGetApp().GetTransients();
std::map<HeeksObj*,std::list<HeeksObj*> >::iterator it;
std::list<HeeksObj*> needupdate;
for(it = map.begin(); it!= map.end(); it++)
{
TransientObject *tobj = (TransientObject*)(*it).first;
std::list<HeeksObj*>::iterator it2;
for(it2 = (*it).second.begin(); it2 != (*it).second.end(); it2++)
{
HeeksObj* obj = (HeeksObj*)(*it2);
std::map<HeeksObjId,HeeksObj*>::iterator it3 = treemap.find(GetHeeksObjId(obj));
if(it3 == treemap.end())
{
HeeksObj* nobj = obj->MakeACopyWithID();
#ifdef MULTIPLE_OWNERS
nobj->RemoveOwners();
#else
nobj->m_owner = NULL;
#endif
needupdate.push_back(nobj);
treemap[GetHeeksObjId(nobj)] = nobj;
#ifdef MULTIPLE_OWNERS
tobj->Owner()->Add(nobj,NULL);
#else
tobj->m_owner->Add(nobj,NULL);
#endif
}
else
{
needupdate.push_back((*it3).second);
#ifdef MULTIPLE_OWNERS
tobj->Owner()->Add((*it3).second, NULL);
#else
tobj->m_owner->Add((*it3).second, NULL);
#endif
}
}
#ifdef MULTIPLE_OWNERS
tobj->Owner()->Remove(tobj);
#else
tobj->m_owner->Remove(tobj);
#endif
//delete tobj;
}
//Deal with the quick pointer problem
std::list<HeeksObj*>::iterator it2;
for(it2 = needupdate.begin(); it2 != needupdate.end(); it2++)
{
HeeksObj *obj = *it2;
#ifdef MULTIPLE_OWNERS
HeeksObj *owner = obj->GetFirstOwner();
while(owner)
{
owner->ReloadPointers();
owner = obj->GetNextOwner();
}
#else
if(obj->m_owner)obj->m_owner->ReloadPointers();
#endif
obj->ReloadPointers();
}
wxGetApp().ClearTransients();
}