本文整理汇总了C++中uuid_vec_t::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ uuid_vec_t::erase方法的具体用法?C++ uuid_vec_t::erase怎么用?C++ uuid_vec_t::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uuid_vec_t
的用法示例。
在下文中一共展示了uuid_vec_t::erase方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeDifference
void LLCommonUtils::computeDifference(
const uuid_vec_t& vnew,
const uuid_vec_t& vcur,
uuid_vec_t& vadded,
uuid_vec_t& vremoved)
{
uuid_vec_t vnew_copy(vnew);
uuid_vec_t vcur_copy(vcur);
std::sort(vnew_copy.begin(), vnew_copy.end());
std::sort(vcur_copy.begin(), vcur_copy.end());
size_t maxsize = llmax(vnew_copy.size(), vcur_copy.size());
vadded.resize(maxsize);
vremoved.resize(maxsize);
uuid_vec_t::iterator it;
// what was removed
it = set_difference(vcur_copy.begin(), vcur_copy.end(), vnew_copy.begin(), vnew_copy.end(), vremoved.begin());
vremoved.erase(it, vremoved.end());
// what was added
it = set_difference(vnew_copy.begin(), vnew_copy.end(), vcur_copy.begin(), vcur_copy.end(), vadded.begin());
vadded.erase(it, vadded.end());
}
示例2: addUsers
void LLPanelGroupBulk::addUsers(uuid_vec_t& agent_ids)
{
std::vector<std::string> names;
for (S32 i = 0; i < (S32)agent_ids.size(); i++)
{
std::string fullname;
LLUUID agent_id = agent_ids[i];
LLViewerObject* dest = gObjectList.findObject(agent_id);
if(dest && dest->isAvatar())
{
LLNameValue* nvfirst = dest->getNVPair("FirstName");
LLNameValue* nvlast = dest->getNVPair("LastName");
if(nvfirst && nvlast)
{
fullname = LLCacheName::buildFullName(
nvfirst->getString(), nvlast->getString());
}
if (!fullname.empty())
{
names.push_back(fullname);
}
else
{
llwarns << "llPanelGroupBulk: Selected avatar has no name: " << dest->getID() << llendl;
names.push_back("(Unknown)");
}
}
else
{
//looks like user try to invite offline friend
//for offline avatar_id gObjectList.findObject() will return null
//so we need to do this additional search in avatar tracker, see EXT-4732
//if (LLAvatarTracker::instance().isBuddy(agent_id)) // Singu Note: We may be using this from another avatar list like group profile, disregard friendship status.
{
LLAvatarName av_name;
if (!LLAvatarNameCache::get(agent_id, &av_name))
{
// actually it should happen, just in case
LLAvatarNameCache::get(LLUUID(agent_id), boost::bind(&LLPanelGroupBulk::addUserCallback, this, _1, _2));
// for this special case!
//when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence
// removed id will be added in callback
agent_ids.erase(agent_ids.begin() + i);
}
else
{
std::string name;
LLAvatarNameCache::getPNSName(av_name, name);
names.push_back(name);
}
}
}
}
mImplementation->mListFullNotificationSent = false;
mImplementation->addUsers(names, agent_ids);
}
示例3: addUsers
void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids)
{
std::vector<std::string> names;
for (S32 i = 0; i < (S32)agent_ids.size(); i++)
{
LLUUID agent_id = agent_ids[i];
LLViewerObject* dest = gObjectList.findObject(agent_id);
std::string fullname;
if(dest && dest->isAvatar())
{
LLNameValue* nvfirst = dest->getNVPair("FirstName");
LLNameValue* nvlast = dest->getNVPair("LastName");
if(nvfirst && nvlast)
{
fullname = std::string(nvfirst->getString()) + " " + std::string(nvlast->getString());
}
if (!fullname.empty())
{
names.push_back(fullname);
}
else
{
llwarns << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << llendl;
names.push_back("(Unknown)");
}
}
else
{
//looks like user try to invite offline friend
//for offline avatar_id gObjectList.findObject() will return null
//so we need to do this additional search in avatar tracker, see EXT-4732
if (LLAvatarTracker::instance().isBuddy(agent_id))
{
if (!gCacheName->getFullName(agent_id, fullname))
{
// actually it should happen, just in case
gCacheName->get(LLUUID(agent_id), false, boost::bind(
&LLPanelGroupInvite::addUserCallback, this, _1, _2,
_3));
// for this special case!
//when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence
// removed id will be added in callback
agent_ids.erase(agent_ids.begin() + i);
}
else
{
names.push_back(fullname);
}
}
}
}
mImplementation->addUsers(names, agent_ids);
}