lluserrelations.cpp

Go to the documentation of this file.
00001 
00034 #include "linden_common.h"
00035 #include "lluserrelations.h"
00036 
00037 // static
00038 const U8 LLRelationship::GRANTED_VISIBLE_MASK = LLRelationship::GRANT_MODIFY_OBJECTS | LLRelationship::GRANT_MAP_LOCATION;
00039 const LLRelationship LLRelationship::DEFAULT_RELATIONSHIP = LLRelationship(GRANT_ONLINE_STATUS, GRANT_ONLINE_STATUS, false);
00040 
00041 LLRelationship::LLRelationship() :
00042         mGrantToAgent(0),
00043         mGrantFromAgent(0),
00044         mChangeSerialNum(0),
00045         mIsOnline(false)
00046 {
00047 }
00048 
00049 LLRelationship::LLRelationship(S32 grant_to, S32 grant_from, bool is_online) :
00050         mGrantToAgent(grant_to),
00051         mGrantFromAgent(grant_from),
00052         mChangeSerialNum(0),
00053         mIsOnline(is_online)
00054 {
00055 }
00056 
00057 bool LLRelationship::isOnline() const
00058 {
00059         return mIsOnline;
00060 }
00061 
00062 void LLRelationship::online(bool is_online)
00063 {
00064         mIsOnline = is_online;
00065         mChangeSerialNum++;
00066 }
00067 
00068 bool LLRelationship::isRightGrantedTo(S32 rights) const
00069 {
00070         return ((mGrantToAgent & rights) == rights);
00071 }
00072 
00073 bool LLRelationship::isRightGrantedFrom(S32 rights) const
00074 {
00075         return ((mGrantFromAgent & rights) == rights);
00076 }
00077 
00078 S32 LLRelationship::getRightsGrantedTo() const
00079 {
00080         return mGrantToAgent;
00081 }
00082 
00083 S32 LLRelationship::getRightsGrantedFrom() const
00084 {
00085         return mGrantFromAgent;
00086 }
00087 
00088 void LLRelationship::grantRights(S32 to_agent, S32 from_agent)
00089 {
00090         mGrantToAgent |= to_agent;
00091         mGrantFromAgent |= from_agent;
00092         mChangeSerialNum++;
00093 }
00094 
00095 void LLRelationship::revokeRights(S32 to_agent, S32 from_agent)
00096 {
00097         mGrantToAgent &= ~to_agent;
00098         mGrantFromAgent &= ~from_agent;
00099         mChangeSerialNum++;
00100 }
00101 
00102 
00103 
00104 /*
00105 bool LLGrantedRights::getNextRights(
00106         LLUUID& agent_id,
00107         S32& to_agent,
00108         S32& from_agent) const
00109 {
00110         rights_map_t::const_iterator iter = mRights.upper_bound(agent_id);
00111         if(iter == mRights.end()) return false;
00112         agent_id = (*iter).first;
00113         to_agent = (*iter).second.mToAgent;
00114         from_agent = (*iter).second.mFromAgent;
00115         return true;
00116 }
00117 */

Generated on Fri May 16 08:32:14 2008 for SecondLife by  doxygen 1.5.5