LLAvatarTracker Class Reference

#include <llcallingcard.h>

Collaboration diagram for LLAvatarTracker:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::map< LLUUID,
LLRelationship * > 
buddy_map_t

Public Member Functions

void track (const LLUUID &avatar_id, const std::string &name)
void untrack (const LLUUID &avatar_id)
bool isTrackedAgentValid ()
void setTrackedAgentValid (bool valid)
void findAgent ()
void setTrackedCoarseLocation (const LLVector3d &global_pos)
bool haveTrackingInfo ()
void getDegreesAndDist (F32 &rot, F64 &horiz_dist, F64 &vert_dist)
LLVector3d getGlobalPos ()
const LLStringgetName ()
const LLUUIDgetAvatarID ()
S32 addBuddyList (const buddy_map_t &buddies)
void copyBuddyList (buddy_map_t &buddies) const
void terminateBuddy (const LLUUID &id)
const LLRelationshipgetBuddyInfo (const LLUUID &id) const
void setBuddyOnline (const LLUUID &id, bool is_online)
bool isBuddyOnline (const LLUUID &id) const
void setBuddyEmpowered (const LLUUID &id, bool is_empowered)
bool isBuddyEmpowered (const LLUUID &id) const
void empowerList (const buddy_map_t &list, bool grant)
void empower (const LLUUID &id, bool grant)
void registerCallbacks (LLMessageSystem *msg)
void addObserver (LLFriendObserver *observer)
void removeObserver (LLFriendObserver *observer)
void notifyObservers ()
void applyFunctor (LLRelationshipFunctor &f)
 LLAvatarTracker ()
 ~LLAvatarTracker ()

Static Public Member Functions

static LLAvatarTrackerinstance ()
static void formFriendship (const LLUUID &friend_id)

Protected Types

typedef std::vector< LLFriendObserver * > observer_list_t

Protected Member Functions

void deleteTrackingData ()
void agentFound (const LLUUID &prey, const LLVector3d &estimated_global_pos)
void processNotify (LLMessageSystem *msg, bool online)
void processChange (LLMessageSystem *msg)

Static Protected Member Functions

static void processAgentFound (LLMessageSystem *msg, void **)
static void processOnlineNotification (LLMessageSystem *msg, void **)
static void processOfflineNotification (LLMessageSystem *msg, void **)
static void processTerminateFriendship (LLMessageSystem *msg, void **)
static void processChangeUserRights (LLMessageSystem *msg, void **)

Protected Attributes

LLTrackingDatamTrackingData
bool mTrackedAgentValid
U32 mModifyMask
buddy_map_t mBuddyInfo
observer_list_t mObservers

Static Protected Attributes

static LLAvatarTracker sInstance

Private Member Functions

 LLAvatarTracker (const LLAvatarTracker &)
bool operator== (const LLAvatarTracker &)

Detailed Description

Definition at line 84 of file llcallingcard.h.


Member Typedef Documentation

typedef std::map<LLUUID, LLRelationship*> LLAvatarTracker::buddy_map_t

Definition at line 115 of file llcallingcard.h.

typedef std::vector<LLFriendObserver*> LLAvatarTracker::observer_list_t [protected]

Definition at line 181 of file llcallingcard.h.


Constructor & Destructor Documentation

LLAvatarTracker::LLAvatarTracker ( const LLAvatarTracker  )  [private]

LLAvatarTracker::LLAvatarTracker (  ) 

---------------------------------------------------------------------------- Class LLAvatarTracker ----------------------------------------------------------------------------

Definition at line 123 of file llcallingcard.cpp.

LLAvatarTracker::~LLAvatarTracker (  ) 

Definition at line 132 of file llcallingcard.cpp.

References deleteTrackingData(), mBuddyInfo, and mObservers.


Member Function Documentation

S32 LLAvatarTracker::addBuddyList ( const buddy_map_t buddies  ) 

Definition at line 265 of file llcallingcard.cpp.

References LLFriendObserver::ADD, DB_FIRST_NAME_BUF_SIZE, DB_LAST_NAME_BUF_SIZE, first, gCacheName, LLCacheName::getName(), LLRelationship::getRightsGrantedTo(), LLRelationship::isOnline(), lldebugs, llendl, llwarns, mBuddyInfo, mModifyMask, and notifyObservers().

Referenced by idle_startup().

void LLAvatarTracker::addObserver ( LLFriendObserver observer  ) 

Definition at line 477 of file llcallingcard.cpp.

References mObservers.

Referenced by LLCallingCardBridge::LLCallingCardBridge(), LLIMMgr::LLIMMgr(), LLPanelFriends::LLPanelFriends(), LLFloaterWorldMap::observeFriends(), and LLAgent::observeFriends().

void LLAvatarTracker::agentFound ( const LLUUID prey,
const LLVector3d estimated_global_pos 
) [protected]

Definition at line 544 of file llcallingcard.cpp.

References LLTrackingData::agentFound(), instance(), mTrackingData, and setTrackedAgentValid().

Referenced by processAgentFound().

void LLAvatarTracker::applyFunctor ( LLRelationshipFunctor f  ) 

Definition at line 504 of file llcallingcard.cpp.

References end, f, and mBuddyInfo.

Referenced by LLFloaterWorldMap::buildAvatarIDList(), LLAgent::friendsChanged(), and LLPanelFriends::refreshNames().

void LLAvatarTracker::copyBuddyList ( buddy_map_t buddies  )  const

Definition at line 306 of file llcallingcard.cpp.

References end, and mBuddyInfo.

void LLAvatarTracker::deleteTrackingData (  )  [protected]

Definition at line 454 of file llcallingcard.cpp.

References mTrackingData, and NULL.

Referenced by processNotify(), track(), untrack(), and ~LLAvatarTracker().

void LLAvatarTracker::empower ( const LLUUID id,
bool  grant 
)

Definition at line 389 of file llcallingcard.cpp.

References list.

Referenced by LLPanelFriends::handleRemove().

void LLAvatarTracker::empowerList ( const buddy_map_t list,
bool  grant 
)

Definition at line 399 of file llcallingcard.cpp.

References llendl, and llwarns.

void LLAvatarTracker::findAgent (  ) 

Definition at line 460 of file llcallingcard.cpp.

References _PREHASH_AgentBlock, _PREHASH_FindAgent, _PREHASH_GlobalX, _PREHASH_GlobalY, _PREHASH_Hunter, _PREHASH_LocationBlock, _PREHASH_Prey, _PREHASH_SpaceIP, LLMessageSystem::addF64Fast(), LLMessageSystem::addU32Fast(), LLMessageSystem::addUUIDFast(), gAgent, gAgentID, gMessageSystem, LLUUID::isNull(), LLTrackingData::mAvatarID, mTrackingData, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), and LLAgent::sendReliableMessage().

Referenced by LLTrackingData::haveTrackingInfo(), and track().

void LLAvatarTracker::formFriendship ( const LLUUID friend_id  )  [static]

Definition at line 684 of file llcallingcard.cpp.

References LLFriendObserver::ADD, get_ptr_in_map(), LLRelationship::GRANT_ONLINE_STATUS, instance(), mBuddyInfo, mModifyMask, and notifyObservers().

Referenced by friendship_offer_callback(), and process_improved_im().

const LLUUID & LLAvatarTracker::getAvatarID (  ) 

Definition at line 253 of file llcallingcard.cpp.

References LLTrackingData::mAvatarID, mTrackingData, and LLUUID::null.

Referenced by LLFloaterWorldMap::onAvatarComboPrearrange(), LLTracker::render3D(), and LLTracker::stopTrackingAvatar().

const LLRelationship * LLAvatarTracker::getBuddyInfo ( const LLUUID id  )  const

Definition at line 335 of file llcallingcard.cpp.

References get_ptr_in_map(), mBuddyInfo, and NULL.

Referenced by LLPanelFriends::addFriend(), LLPanelFriends::applyRightsToFriends(), deliver_message(), LLPanelFriends::handleRemove(), LLIMMgr::noteOfflineUsers(), LLPanelFriends::onClickIM(), processNotify(), LLPanelFriends::refreshRightsChangeList(), LLTracker::render3D(), and LLPanelAvatar::setAvatarID().

void LLAvatarTracker::getDegreesAndDist ( F32 rot,
F64 horiz_dist,
F64 vert_dist 
)

Definition at line 217 of file llcallingcard.cpp.

References LLViewerObjectList::findObject(), gAgent, LLAgent::getPositionGlobal(), LLViewerObject::getPositionGlobal(), gObjectList, LLViewerObject::isDead(), LLTrackingData::mAvatarID, LLVector3d::mdV, LLTrackingData::mGlobalPositionEstimate, mTrackingData, RAD_TO_DEG, VX, VY, and VZ.

LLVector3d LLAvatarTracker::getGlobalPos (  ) 

Definition at line 194 of file llcallingcard.cpp.

References LLViewerObjectList::findObject(), LLViewerObject::getPositionGlobal(), gObjectList, LLViewerObject::isDead(), LLTrackingData::mAvatarID, LLVector3d::mdV, LLTrackingData::mGlobalPositionEstimate, mTrackedAgentValid, mTrackingData, and VZ.

Referenced by LLTracker::getTrackedPositionGlobal(), LLTracker::render3D(), LLFloaterWorldMap::teleport(), and LLFloaterWorldMap::teleportToAvatar().

const LLString & LLAvatarTracker::getName (  ) 

Definition at line 241 of file llcallingcard.cpp.

References LLTrackingData::mName, mTrackingData, and LLStringBase< char >::null.

Referenced by LLTracker::render3D().

bool LLAvatarTracker::haveTrackingInfo (  ) 

Definition at line 185 of file llcallingcard.cpp.

References LLTrackingData::haveTrackingInfo(), and mTrackingData.

Referenced by LLTracker::getTrackedPositionGlobal(), LLTracker::render3D(), LLFloaterWorldMap::teleport(), and LLFloaterWorldMap::teleportToAvatar().

static LLAvatarTracker& LLAvatarTracker::instance (  )  [inline, static]

Definition at line 87 of file llcallingcard.h.

References sInstance.

Referenced by LLPanelFriends::addFriend(), agentFound(), LLPanelFriends::applyRightsToFriends(), LLFloaterWorldMap::buildAvatarIDList(), LLCallingCardBridge::buildContextMenu(), LLIMMgr::defaultIMTypeForAgent(), deliver_message(), LLWorldMapView::draw(), LLNetMap::draw(), LLTracker::drawHUDArrow(), LLFloaterWorldMap::flyToAvatar(), formFriendship(), LLFloaterWorldMap::friendsChanged(), LLAgent::friendsChanged(), LLCallingCardBridge::getIcon(), LLCallingCardBridge::getLabelSuffix(), LLTracker::getTrackedPositionGlobal(), handle_track_avatar(), LLBeginIMSession::handleEvent(), LLPanelFriends::handleRemove(), LLTrackingData::haveTrackingInfo(), idle_startup(), LLIMMgr::inviteToSession(), is_agent_friend(), is_agent_mappable(), LLCallingCardBridge::LLCallingCardBridge(), LLIMMgr::LLIMMgr(), LLPanelFriends::LLPanelFriends(), LLIMMgr::noteOfflineUsers(), LLFloaterWorldMap::observeFriends(), LLAgent::observeFriends(), LLFloaterWorldMap::onAvatarComboPrearrange(), LLPanelFriends::onClickIM(), LLPanelFriends::onClickProfile(), LLCallingCardBridge::openItem(), CoarseLocationUpdate::post(), processAgentFound(), processChangeUserRights(), processNotify(), processOfflineNotification(), processOnlineNotification(), processTerminateFriendship(), LLPanelFriends::refreshNames(), LLPanelFriends::refreshRightsChangeList(), LLTracker::render3D(), LLPanelAvatar::setAvatarID(), LLPanelAvatar::setOnlineStatus(), LLTracker::stopTrackingAvatar(), LLFloaterWorldMap::teleport(), LLFloaterWorldMap::teleportToAvatar(), LLTracker::trackAvatar(), LLViewerRegion::updateCoarseLocations(), LLCallingCardBridge::~LLCallingCardBridge(), LLIMMgr::~LLIMMgr(), and LLPanelFriends::~LLPanelFriends().

bool LLAvatarTracker::isBuddyEmpowered ( const LLUUID id  )  const

Definition at line 379 of file llcallingcard.cpp.

References get_ptr_in_map(), LLRelationship::GRANT_MODIFY_OBJECTS, LLRelationship::isRightGrantedTo(), and mBuddyInfo.

bool LLAvatarTracker::isBuddyOnline ( const LLUUID id  )  const

Definition at line 358 of file llcallingcard.cpp.

References get_ptr_in_map(), LLRelationship::isOnline(), and mBuddyInfo.

Referenced by LLCallingCardBridge::buildContextMenu(), LLCallingCardBridge::getIcon(), LLBeginIMSession::handleEvent(), LLPanelFriends::onClickProfile(), and LLCallingCardBridge::openItem().

bool LLAvatarTracker::isTrackedAgentValid (  )  [inline]

Definition at line 91 of file llcallingcard.h.

References mTrackedAgentValid.

void LLAvatarTracker::notifyObservers (  ) 

Definition at line 492 of file llcallingcard.cpp.

References end, mModifyMask, mObservers, and LLFriendObserver::NONE.

Referenced by addBuddyList(), formFriendship(), LLPanelFriends::handleRemove(), processChange(), processNotify(), and processTerminateFriendship().

bool LLAvatarTracker::operator== ( const LLAvatarTracker  )  [private]

void LLAvatarTracker::processAgentFound ( LLMessageSystem msg,
void **   
) [static, protected]

Definition at line 528 of file llcallingcard.cpp.

References _PREHASH_AgentBlock, _PREHASH_GlobalX, _PREHASH_GlobalY, _PREHASH_Hunter, _PREHASH_LocationBlock, _PREHASH_Prey, agentFound(), LLMessageSystem::getF64Fast(), LLMessageSystem::getUUIDFast(), instance(), LLVector3d::mdV, VX, and VY.

Referenced by registerCallbacks().

void LLAvatarTracker::processChange ( LLMessageSystem msg  )  [protected]

Definition at line 568 of file llcallingcard.cpp.

References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_AgentRelated, _PREHASH_RelatedRights, _PREHASH_Rights, LLViewerWindow::alertXml(), count, DB_FIRST_NAME_BUF_SIZE, DB_LAST_NAME_BUF_SIZE, first, gAgent, gCacheName, LLAgent::getID(), LLCacheName::getName(), LLMessageSystem::getNumberOfBlocksFast(), LLMessageSystem::getS32Fast(), LLMessageSystem::getUUIDFast(), LLRelationship::GRANT_MODIFY_OBJECTS, gViewerWindow, i, mBuddyInfo, mModifyMask, notifyObservers(), LLFriendObserver::POWERS, and S32.

Referenced by processChangeUserRights().

void LLAvatarTracker::processChangeUserRights ( LLMessageSystem msg,
void **   
) [static, protected]

Definition at line 617 of file llcallingcard.cpp.

References instance(), lldebugs, llendl, and processChange().

Referenced by registerCallbacks().

void LLAvatarTracker::processNotify ( LLMessageSystem msg,
bool  online 
) [protected]

Definition at line 623 of file llcallingcard.cpp.

References _PREHASH_AgentBlock, _PREHASH_AgentID, LLInventoryModel::addChangedMask(), LLInventoryObserver::CALLING_CARD, count, DB_FIRST_NAME_BUF_SIZE, DB_LAST_NAME_BUF_SIZE, deleteTrackingData(), FALSE, first, gCacheName, LLControlGroup::getBOOL(), getBuddyInfo(), LLCacheName::getName(), LLMessageSystem::getNumberOfBlocksFast(), LLMessageSystem::getUUIDFast(), gInventory, gSavedSettings, i, instance(), lldebugs, llendl, llwarns, LLTrackingData::mAvatarID, mModifyMask, mTrackingData, LLInventoryModel::notifyObservers(), notifyObservers(), LLUUID::null, NULL, LLFriendObserver::ONLINE, S32, setBuddyOnline(), LLNotifyBox::showXml(), and TRUE.

Referenced by processOfflineNotification(), and processOnlineNotification().

void LLAvatarTracker::processOfflineNotification ( LLMessageSystem msg,
void **   
) [static, protected]

Definition at line 562 of file llcallingcard.cpp.

References instance(), lldebugs, llendl, and processNotify().

Referenced by registerCallbacks().

void LLAvatarTracker::processOnlineNotification ( LLMessageSystem msg,
void **   
) [static, protected]

Definition at line 555 of file llcallingcard.cpp.

References instance(), lldebugs, llendl, and processNotify().

Referenced by registerCallbacks().

void LLAvatarTracker::processTerminateFriendship ( LLMessageSystem msg,
void **   
) [static, protected]

Definition at line 702 of file llcallingcard.cpp.

References get_ptr_in_map(), LLMessageSystem::getUUID(), instance(), mBuddyInfo, mModifyMask, notifyObservers(), and LLFriendObserver::REMOVE.

Referenced by registerCallbacks().

void LLAvatarTracker::registerCallbacks ( LLMessageSystem msg  ) 

Definition at line 514 of file llcallingcard.cpp.

References _PREHASH_ChangeUserRights, _PREHASH_FindAgent, _PREHASH_OfflineNotification, _PREHASH_OnlineNotification, processAgentFound(), processChangeUserRights(), processOfflineNotification(), processOnlineNotification(), processTerminateFriendship(), LLMessageSystem::setHandlerFunc(), and LLMessageSystem::setHandlerFuncFast().

Referenced by idle_startup().

void LLAvatarTracker::removeObserver ( LLFriendObserver observer  ) 

Definition at line 485 of file llcallingcard.cpp.

References mObservers.

Referenced by LLCallingCardBridge::~LLCallingCardBridge(), LLIMMgr::~LLIMMgr(), and LLPanelFriends::~LLPanelFriends().

void LLAvatarTracker::setBuddyEmpowered ( const LLUUID id,
bool  is_empowered 
)

Definition at line 369 of file llcallingcard.cpp.

References get_ptr_in_map(), LLRelationship::GRANT_MODIFY_OBJECTS, LLRelationship::grantRights(), mBuddyInfo, mModifyMask, and LLFriendObserver::POWERS.

void LLAvatarTracker::setBuddyOnline ( const LLUUID id,
bool  is_online 
)

Definition at line 342 of file llcallingcard.cpp.

References get_ptr_in_map(), lldebugs, llendl, llwarns, mBuddyInfo, mModifyMask, LLFriendObserver::ONLINE, and LLRelationship::online().

Referenced by processNotify().

void LLAvatarTracker::setTrackedAgentValid ( bool  valid  )  [inline]

Definition at line 92 of file llcallingcard.h.

References mTrackedAgentValid.

Referenced by agentFound().

void LLAvatarTracker::setTrackedCoarseLocation ( const LLVector3d global_pos  ) 

Definition at line 177 of file llcallingcard.cpp.

References mTrackingData, and LLTrackingData::setTrackedCoarseLocation().

Referenced by CoarseLocationUpdate::post(), and LLViewerRegion::updateCoarseLocations().

void LLAvatarTracker::terminateBuddy ( const LLUUID id  ) 

Definition at line 316 of file llcallingcard.cpp.

References LLMessageSystem::addUUID(), gAgent, get_ptr_in_map(), LLAgent::getID(), LLAgent::getSessionID(), gMessageSystem, lldebugs, llendl, mBuddyInfo, mModifyMask, LLMessageSystem::newMessage(), LLMessageSystem::nextBlock(), LLFriendObserver::REMOVE, and LLAgent::sendReliableMessage().

Referenced by LLPanelFriends::handleRemove().

void LLAvatarTracker::track ( const LLUUID avatar_id,
const std::string &  name 
)

Definition at line 139 of file llcallingcard.cpp.

References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_PreyID, _PREHASH_SessionID, _PREHASH_TargetData, _PREHASH_TrackAgent, deleteTrackingData(), findAgent(), gAgent, LLAgent::getID(), LLAgent::getSessionID(), gMessageSystem, mTrackedAgentValid, mTrackingData, LLMessageSystem::newMessageFast(), LLUUID::notNull(), and LLAgent::sendReliableMessage().

Referenced by handle_track_avatar(), and LLTracker::trackAvatar().

void LLAvatarTracker::untrack ( const LLUUID avatar_id  ) 

Definition at line 160 of file llcallingcard.cpp.

References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_PreyID, _PREHASH_SessionID, _PREHASH_TargetData, _PREHASH_TrackAgent, LLMessageSystem::addUUIDFast(), deleteTrackingData(), gAgent, LLAgent::getID(), LLAgent::getSessionID(), gMessageSystem, LLTrackingData::mAvatarID, mTrackedAgentValid, mTrackingData, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), LLUUID::null, and LLAgent::sendReliableMessage().

Referenced by LLTracker::stopTrackingAvatar().


Member Data Documentation

buddy_map_t LLAvatarTracker::mBuddyInfo [protected]

Definition at line 179 of file llcallingcard.h.

Referenced by addBuddyList(), applyFunctor(), copyBuddyList(), formFriendship(), getBuddyInfo(), isBuddyEmpowered(), isBuddyOnline(), processChange(), processTerminateFriendship(), setBuddyEmpowered(), setBuddyOnline(), terminateBuddy(), and ~LLAvatarTracker().

U32 LLAvatarTracker::mModifyMask [protected]

Definition at line 175 of file llcallingcard.h.

Referenced by addBuddyList(), formFriendship(), notifyObservers(), processChange(), processNotify(), processTerminateFriendship(), setBuddyEmpowered(), setBuddyOnline(), and terminateBuddy().

observer_list_t LLAvatarTracker::mObservers [protected]

Definition at line 182 of file llcallingcard.h.

Referenced by addObserver(), notifyObservers(), removeObserver(), and ~LLAvatarTracker().

bool LLAvatarTracker::mTrackedAgentValid [protected]

Definition at line 174 of file llcallingcard.h.

Referenced by getGlobalPos(), isTrackedAgentValid(), setTrackedAgentValid(), track(), and untrack().

LLTrackingData* LLAvatarTracker::mTrackingData [protected]

Definition at line 173 of file llcallingcard.h.

Referenced by agentFound(), deleteTrackingData(), findAgent(), getAvatarID(), getDegreesAndDist(), getGlobalPos(), getName(), haveTrackingInfo(), processNotify(), setTrackedCoarseLocation(), track(), and untrack().

LLAvatarTracker LLAvatarTracker::sInstance [static, protected]

Definition at line 172 of file llcallingcard.h.

Referenced by instance().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:11 2010 for Second Life Viewer by  doxygen 1.4.7