LLRelationship Class Reference

#include <lluserrelations.h>

Collaboration diagram for LLRelationship:

Collaboration graph
[legend]
List of all members.
enum  { GRANT_NONE = 0x0, GRANT_ONLINE_STATUS = 0x1, GRANT_MAP_LOCATION = 0x2, GRANT_MODIFY_OBJECTS = 0x4 }
 Anonymous enumeration for specifying rights. More...
bool isRightGrantedTo (S32 rights) const
 Check for a set of rights granted to agent.
bool isRightGrantedFrom (S32 rights) const
 Check for a set of rights granted from an agent.
S32 getRightsGrantedTo () const
 Get the rights granted to the other agent.
S32 getRightsGrantedFrom () const
 Get the rights granted from the other agent.
void setRightsTo (S32 to_agent)
void setRightsFrom (S32 from_agent)
void grantRights (S32 to_agent, S32 from_agent)
 Grant a set of rights.
void revokeRights (S32 to_agent, S32 from_agent)
 Revoke a set of rights.
static const U8 GRANTED_VISIBLE_MASK = LLRelationship::GRANT_MODIFY_OBJECTS | LLRelationship::GRANT_MAP_LOCATION

Public Member Functions

 LLRelationship ()
 Constructors.
 LLRelationship (S32 grant_to, S32 grant_from, bool is_online)
Status functionality
I thought it would be keen to have a generic status interface, but the only thing we currently cache is online status. As this assumption changes, this API may evolve.

bool isOnline () const
 Does this instance believe the related agent is currently online or available.
void online (bool is_online)
 Set the online status.

Static Public Attributes

static const LLRelationship DEFAULT_RELATIONSHIP = LLRelationship(GRANT_ONLINE_STATUS, GRANT_ONLINE_STATUS, false)

Protected Attributes

S32 mGrantToAgent
S32 mGrantFromAgent
bool mIsOnline

Detailed Description

This class represents a relationship between two agents, where the related agent is stored and the other agent is the relationship is implicit by container ownership. This is merely a cache of this information used by the sim and viewer.

You are expected to use this in a map or similar structure, eg: typedef std::map<LLUUID, LLRelationship> agent_relationship_map;

Definition at line 52 of file lluserrelations.h.


Member Enumeration Documentation

anonymous enum

Anonymous enumeration for specifying rights.

Enumerator:
GRANT_NONE 
GRANT_ONLINE_STATUS 
GRANT_MAP_LOCATION 
GRANT_MODIFY_OBJECTS 

Definition at line 102 of file lluserrelations.h.


Constructor & Destructor Documentation

LLRelationship::LLRelationship (  ) 

Constructors.

Definition at line 41 of file lluserrelations.cpp.

LLRelationship::LLRelationship ( S32  grant_to,
S32  grant_from,
bool  is_online 
)

Definition at line 48 of file lluserrelations.cpp.


Member Function Documentation

S32 LLRelationship::getRightsGrantedFrom (  )  const

Get the rights granted from the other agent.

Returns:
Returns the bitmask of granted rights.

Definition at line 80 of file lluserrelations.cpp.

References mGrantFromAgent.

S32 LLRelationship::getRightsGrantedTo (  )  const

Get the rights granted to the other agent.

Returns:
Returns the bitmask of granted rights.

Definition at line 75 of file lluserrelations.cpp.

References mGrantToAgent.

Referenced by LLAvatarTracker::addBuddyList(), and LLPanelFriends::applyRightsToFriends().

void LLRelationship::grantRights ( S32  to_agent,
S32  from_agent 
)

Grant a set of rights.

Any bit which is set will grant that right if it is set in the instance. You can pass in LLGrantedRights::NONE to not change that field.

Parameters:
to_agent The rights to grant to agent_id.
from_agent The rights granted from agent_id.

Definition at line 85 of file lluserrelations.cpp.

References mGrantFromAgent, and mGrantToAgent.

Referenced by LLAvatarTracker::setBuddyEmpowered().

bool LLRelationship::isOnline (  )  const

Does this instance believe the related agent is currently online or available.

NOTE: This API may be deprecated if there is any transient status other than online status, for example, away/busy/etc.

This call does not check any kind of central store or make any deep information calls - it simply checks a cache of online status.

Returns:
Returns true if this relationship believes the agent is online.

Definition at line 55 of file lluserrelations.cpp.

References mIsOnline.

Referenced by LLAvatarTracker::addBuddyList(), LLPanelFriends::addFriend(), deliver_message(), LLAvatarTracker::isBuddyOnline(), LLIMMgr::noteOfflineUsers(), LLCollectAllBuddies::operator()(), LLCollectOnlineBuddies::operator()(), LLCollectMappableBuddies::operator()(), LLPanelFriends::refreshRightsChangeList(), and LLTracker::render3D().

bool LLRelationship::isRightGrantedFrom ( S32  rights  )  const

Check for a set of rights granted from an agent.

Parameters:
rights A bitfield to check for rights.
Returns:
Returns true if all rights have been granted.

Definition at line 70 of file lluserrelations.cpp.

References mGrantFromAgent.

Referenced by LLPanelFriends::addFriend(), LLCollectMappableBuddies::operator()(), and LLCollectProxyBuddies::operator()().

bool LLRelationship::isRightGrantedTo ( S32  rights  )  const

Check for a set of rights granted to agent.

Parameters:
rights A bitfield to check for rights.
Returns:
Returns true if all rights have been granted.

Definition at line 65 of file lluserrelations.cpp.

References mGrantToAgent.

Referenced by LLPanelFriends::addFriend(), LLPanelFriends::handleRemove(), LLAvatarTracker::isBuddyEmpowered(), and LLPanelFriends::refreshRightsChangeList().

void LLRelationship::online ( bool  is_online  ) 

Set the online status.

NOTE: This API may be deprecated if there is any transient status other than online status.

Parameters:
is_online Se the online status

Definition at line 60 of file lluserrelations.cpp.

References mIsOnline.

Referenced by LLAvatarTracker::setBuddyOnline().

void LLRelationship::revokeRights ( S32  to_agent,
S32  from_agent 
)

Revoke a set of rights.

Any bit which is set will revoke that right if it is set in the instance. You can pass in LLGrantedRights::NONE to not change that field.

Parameters:
to_agent The rights to grant to agent_id.
from_agent The rights granted from agent_id.

Definition at line 91 of file lluserrelations.cpp.

References mGrantFromAgent, and mGrantToAgent.

void LLRelationship::setRightsFrom ( S32  from_agent  )  [inline]

Definition at line 146 of file lluserrelations.h.

References mGrantFromAgent.

void LLRelationship::setRightsTo ( S32  to_agent  )  [inline]

Definition at line 145 of file lluserrelations.h.

References mGrantToAgent.


Member Data Documentation

const LLRelationship LLRelationship::DEFAULT_RELATIONSHIP = LLRelationship(GRANT_ONLINE_STATUS, GRANT_ONLINE_STATUS, false) [static]

Definition at line 61 of file lluserrelations.h.

const U8 LLRelationship::GRANTED_VISIBLE_MASK = LLRelationship::GRANT_MODIFY_OBJECTS | LLRelationship::GRANT_MAP_LOCATION [static]

???

Definition at line 113 of file lluserrelations.h.

S32 LLRelationship::mGrantFromAgent [protected]

Definition at line 173 of file lluserrelations.h.

Referenced by getRightsGrantedFrom(), grantRights(), isRightGrantedFrom(), revokeRights(), and setRightsFrom().

S32 LLRelationship::mGrantToAgent [protected]

Definition at line 172 of file lluserrelations.h.

Referenced by getRightsGrantedTo(), grantRights(), isRightGrantedTo(), revokeRights(), and setRightsTo().

bool LLRelationship::mIsOnline [protected]

Definition at line 174 of file lluserrelations.h.

Referenced by isOnline(), and online().


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