本文整理汇总了C++中LLAvatarPropertiesProcessor::addObserver方法的典型用法代码示例。如果您正苦于以下问题:C++ LLAvatarPropertiesProcessor::addObserver方法的具体用法?C++ LLAvatarPropertiesProcessor::addObserver怎么用?C++ LLAvatarPropertiesProcessor::addObserver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLAvatarPropertiesProcessor
的用法示例。
在下文中一共展示了LLAvatarPropertiesProcessor::addObserver方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateAvatarProperties
void LLAvatarListItem::updateAvatarProperties()
{
// NOTE: typically we request these once on creation to avoid excess traffic/processing.
//This means updates to these properties won't typically be seen while target is in nearby range.
LLAvatarPropertiesProcessor* processor = LLAvatarPropertiesProcessor::getInstance();
processor->addObserver(mAvatarId, this);
processor->sendAvatarPropertiesRequest(mAvatarId);
}
示例2:
// If the inspector closes it will delete the pending request object, so the
// inspector pointer will be valid for the lifetime of this object
LLFetchAvatarData(const LLUUID& avatar_id, LLInspectAvatar* inspector)
: mAvatarID(avatar_id),
mInspector(inspector)
{
LLAvatarPropertiesProcessor* processor =
LLAvatarPropertiesProcessor::getInstance();
// register ourselves as an observer
processor->addObserver(mAvatarID, this);
// send a request (duplicates will be suppressed inside the avatar
// properties processor)
processor->sendAvatarPropertiesRequest(mAvatarID);
}
示例3: setValue
//virtual
void LLAvatarIconCtrl::setValue(const LLSD& value)
{
if (value.isUUID())
{
LLAvatarPropertiesProcessor* app =
LLAvatarPropertiesProcessor::getInstance();
if (mAvatarId.notNull())
{
app->removeObserver(mAvatarId, this);
}
if (mAvatarId != value.asUUID())
{
mAvatarId = value.asUUID();
// *BUG: This will return stale icons if a user changes their
// profile picture. However, otherwise we send too many upstream
// AvatarPropertiesRequest messages.
// to get fresh avatar icon use
// LLAvatarIconIDCache::getInstance()->remove(avatar_id);
// Check if cache already contains image_id for that avatar
if (!updateFromCache())
{
// *TODO: Consider getting avatar icon/badge directly from
// People API, rather than sending AvatarPropertyRequest
// messages. People API already hits the user table.
LLIconCtrl::setValue(mDefaultIconName);
app->addObserver(mAvatarId, this);
app->sendAvatarPropertiesRequest(mAvatarId);
}
}
}
else
{
LLIconCtrl::setValue(value);
}
LLAvatarNameCache::get(mAvatarId,
boost::bind(&LLAvatarIconCtrl::onAvatarNameCache,
this, _1, _2));
}
示例4: setValue
//virtual
void LLAvatarIconCtrl::setValue(const LLSD& value)
{
if (value.isUUID())
{
LLAvatarPropertiesProcessor* app =
LLAvatarPropertiesProcessor::getInstance();
if (mAvatarId.notNull())
{
app->removeObserver(mAvatarId, this);
}
if (mAvatarId != value.asUUID())
{
mAvatarId = value.asUUID();
// *BUG: This will return stale icons if a user changes their
// profile picture. However, otherwise we send too many upstream
// AvatarPropertiesRequest messages.
// to get fresh avatar icon use
// LLAvatarIconIDCache::getInstance()->remove(avatar_id);
// Check if cache already contains image_id for that avatar
if (!updateFromCache())
{
LLIconCtrl::setValue(mDefaultIconName);
app->addObserver(mAvatarId, this);
app->sendAvatarPropertiesRequest(mAvatarId);
}
}
}
else
{
LLIconCtrl::setValue(value);
}
if (gCacheName)
{
gCacheName->get(mAvatarId, FALSE, boost::bind(&LLAvatarIconCtrl::nameUpdatedCallback, this, _1, _2, _3, _4));
}
}