Made to Order Software Corporation Logo

LLChatLib: LLRelationship Class Reference

LLRelationship Class Reference

#include <lluserrelations.h>

Collaboration diagram for LLRelationship:

List of all members.

Public Member Functions

 LLRelationship ()
 Constructors.

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.





enum  
 

Anonymous enumeration for specifying rights.



static const U8 GRANTED_VISIBLE_MASK = LLRelationship::GRANT_MODIFY_OBJECTS | LLRelationship::GRANT_MAP_LOCATION
S32 getChangeSerialNum () const
 Get the change count for this agent.

S32 getRightsGrantedFrom () const
 Get the rights granted from the other agent.

S32 getRightsGrantedTo () const
 Get the rights granted to the other agent.

void grantRights (S32 to_agent, S32 from_agent)
 Grant a set of rights.

bool isRightGrantedFrom (S32 rights) const
 Check for a set of rights granted from an agent.

bool isRightGrantedTo (S32 rights) const
 Check for a set of rights granted to agent.

void revokeRights (S32 to_agent, S32 from_agent)
 Revoke a set of rights.


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;


Member Function Documentation

S32 LLRelationship::getChangeSerialNum (  )  const [inline]

Get the change count for this agent.

Every change to rights will increment the serial number allowing listeners to determine when a relationship value is actually new

Returns:
change serial number for relationship
S32 LLRelationship::getRightsGrantedFrom (  )  const

Get the rights granted from the other agent.

Returns:
Returns the bitmask of granted rights.
S32 LLRelationship::getRightsGrantedTo (  )  const

Get the rights granted to the other agent.

Returns:
Returns the bitmask of granted rights.
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.
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.
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.
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.
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
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.

Member Data Documentation

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

???


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 17:18:43 2010 for LLChatLib by  doxygen 1.6.3