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         mIsOnline(false)
00045 {
00046 }
00047 
00048 LLRelationship::LLRelationship(S32 grant_to, S32 grant_from, bool is_online) :
00049         mGrantToAgent(grant_to),
00050         mGrantFromAgent(grant_from),
00051         mIsOnline(is_online)
00052 {
00053 }
00054 
00055 bool LLRelationship::isOnline() const
00056 {
00057         return mIsOnline;
00058 }
00059 
00060 void LLRelationship::online(bool is_online)
00061 {
00062         mIsOnline = is_online;
00063 }
00064 
00065 bool LLRelationship::isRightGrantedTo(S32 rights) const
00066 {
00067         return ((mGrantToAgent & rights) == rights);
00068 }
00069 
00070 bool LLRelationship::isRightGrantedFrom(S32 rights) const
00071 {
00072         return ((mGrantFromAgent & rights) == rights);
00073 }
00074 
00075 S32 LLRelationship::getRightsGrantedTo() const
00076 {
00077         return mGrantToAgent;
00078 }
00079 
00080 S32 LLRelationship::getRightsGrantedFrom() const
00081 {
00082         return mGrantFromAgent;
00083 }
00084 
00085 void LLRelationship::grantRights(S32 to_agent, S32 from_agent)
00086 {
00087         mGrantToAgent |= to_agent;
00088         mGrantFromAgent |= from_agent;
00089 }
00090 
00091 void LLRelationship::revokeRights(S32 to_agent, S32 from_agent)
00092 {
00093         mGrantToAgent &= ~to_agent;
00094         mGrantFromAgent &= ~from_agent;
00095 }
00096 
00097 
00098 
00099 /*
00100 bool LLGrantedRights::getNextRights(
00101         LLUUID& agent_id,
00102         S32& to_agent,
00103         S32& from_agent) const
00104 {
00105         rights_map_t::const_iterator iter = mRights.upper_bound(agent_id);
00106         if(iter == mRights.end()) return false;
00107         agent_id = (*iter).first;
00108         to_agent = (*iter).second.mToAgent;
00109         from_agent = (*iter).second.mFromAgent;
00110         return true;
00111 }
00112 */

Generated on Thu Jul 1 06:09:24 2010 for Second Life Viewer by  doxygen 1.4.7