本文整理汇总了C++中LLDynamicArray::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ LLDynamicArray::empty方法的具体用法?C++ LLDynamicArray::empty怎么用?C++ LLDynamicArray::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLDynamicArray
的用法示例。
在下文中一共展示了LLDynamicArray::empty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RevokeSelected
void JCFloaterAnimList::RevokeSelected(void *userdata )
{
JCFloaterAnimList *self = (JCFloaterAnimList*)userdata;
LLDynamicArray<LLUUID> ids;
std::vector< LLScrollListItem * > items = self->mAnimList->getAllSelected();
for( std::vector< LLScrollListItem * >::iterator itr = items.begin(); itr != items.end(); itr++ )
{
LLScrollListItem *item = *itr;
const LLUUID &id = item->getColumn(LIST_OBJECT_UUID)->getValue().asUUID();
if( ids.find(id) == LLDynamicArray<LLUUID>::FAIL )
{
ids.put(id);
}
}
if( !ids.empty() )
{
for(LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
{
LLUUID id = *itr;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RevokePermissions);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_Data);
msg->addUUIDFast(_PREHASH_ObjectID, id);
msg->addU32Fast(_PREHASH_ObjectPermissions, U32_MAX);
gAgent.sendReliableMessage();
}
}
}
示例2: onCopyPasteAction
void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
{
std::string command_name = command.asString();
// since we select this comman inventory item had already arrived .
if("copy_gesture" == command_name)
{
uuid_vec_t ids;
getSelectedIds(ids);
// make sure that clopboard is empty
LLInventoryClipboard::instance().reset();
for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
LLInventoryClipboard::instance().add(item->getUUID());
}
}
}
else if ("paste" == command_name)
{
LLInventoryClipboard& clipbord = LLInventoryClipboard::instance();
LLDynamicArray<LLUUID> ids;
clipbord.retrieve(ids);
if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID))
return;
LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID);
llassert(gesture_dir);
LLPointer<GestureCopiedCallback> cb = new GestureCopiedCallback(this);
for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(gesture_dir && item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
LLStringUtil::format_map_t string_args;
string_args["[COPY_NAME]"] = item->getName();
LL_DEBUGS("Gesture")<< "Copying gesture " << item->getName() << " "<< item->getUUID() << " into "
<< gesture_dir->getName() << " "<< gesture_dir->getUUID() << LL_ENDL;
copy_inventory_item(gAgent.getID(), item->getPermissions().getOwner(), item->getUUID(),
gesture_dir->getUUID(), getString("copy_name", string_args), cb);
}
}
clipbord.reset();
}
else if ("copy_uuid" == command_name)
{
gClipboard.copyFromString(utf8str_to_wstring(mGestureList->getCurrentID().asString()), mGestureList->getCurrentID());
}
}
示例3: onCopyPasteAction
void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
{
std::string command_name = command.asString();
// Since we select this command, the inventory items must have already arrived
if("copy_gesture" == command_name)
{
uuid_vec_t ids;
getSelectedIds(ids);
// Make sure the clipboard is empty
LLClipboard::instance().reset();
for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
LLClipboard::instance().addToClipboard(item->getUUID(),LLAssetType::AT_GESTURE);
}
}
}
else if ("paste" == command_name)
{
LLDynamicArray<LLUUID> ids;
LLClipboard::instance().pasteFromClipboard(ids);
if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID))
return;
LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID);
llassert(gesture_dir);
LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(gesture_copied_cb, _1, this));
for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(gesture_dir && item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
LLStringUtil::format_map_t string_args;
string_args["[COPY_NAME]"] = item->getName();
LL_DEBUGS("Gesture")<< "Copying gesture " << item->getName() << " "<< item->getUUID() << " into "
<< gesture_dir->getName() << " "<< gesture_dir->getUUID() << LL_ENDL;
copy_inventory_item(gAgent.getID(), item->getPermissions().getOwner(), item->getUUID(),
gesture_dir->getUUID(), getString("copy_name", string_args), cb);
}
}
LLClipboard::instance().reset();
}
else if ("copy_uuid" == command_name)
{
LLClipboard::instance().copyToClipboard(mGestureList->getCurrentID(),LLAssetType::AT_GESTURE);
}
}
示例4: send_start_session_messages
// Returns true if any messages were sent, false otherwise.
// Is sort of equivalent to "does the server need to do anything?"
bool send_start_session_messages(
const LLUUID& temp_session_id,
const LLUUID& other_participant_id,
const LLDynamicArray<LLUUID>& ids,
EInstantMessage dialog)
{
if ( dialog == IM_SESSION_GROUP_START )
{
session_starter_helper(
temp_session_id,
other_participant_id,
dialog);
gMessageSystem->addBinaryDataFast(
_PREHASH_BinaryBucket,
EMPTY_BINARY_BUCKET,
EMPTY_BINARY_BUCKET_SIZE);
gAgent.sendReliableMessage();
return true;
}
else if ( dialog == IM_SESSION_CONFERENCE_START )
{
if (ids.empty()) return true;
LLSD agents;
for (int i = 0; i < (S32) ids.size(); i++)
{
agents.append(ids.get(i));
}
//we have a new way of starting conference calls now
LLViewerRegion* region = gAgent.getRegion();
std::string url(region ? region->getCapability("ChatSessionRequest") : "");
if (!url.empty())
{
LLSD data;
data["method"] = "start conference";
data["session-id"] = temp_session_id;
data["params"] = agents;
LLHTTPClient::post(
url,
data,
new LLStartConferenceChatResponder(
temp_session_id,
gAgent.getID(),
other_participant_id,
data["params"]));
}
else
{
start_deprecated_conference_chat(
temp_session_id,
gAgent.getID(),
other_participant_id,
agents);
}
}
return false;
}