コード例 #1
0
ファイル: FeedItemI.cpp プロジェクト: gunner14/old_rr_code
void FeedItemManagerI::AddFeed(const FeedItem& fitem,
    const FeedConfigPtr& config, const MyUtil::Int2IntMap& id2weight,
    const Ice::Current&) {
	int stype = fitem.type & 0xFFFF;
	if(MergeConfig::instance().IsComment(stype)){
		MCE_INFO("FeedItemManager::AddFeed. is comment .not add. fid:" << fitem.feed
					<< " stype:" << stype
					<< " actor:" << fitem.actor
					<< " time:" << fitem.time
					<< " id2weight:" << id2weight.size() 	);
		return;

	}
	SharedFeedPtr hdl = SharedFeedCache::instance().Add(fitem);

	vector<int> uids, uids_mem;

	BOOST_FOREACH(const MyUtil::Int2IntMap::value_type & vt, id2weight){
		int uid = vt.first;
		UserInfoPtr uinfo = FindUserInfo(uid);
		if(uinfo){
			HeavyFeed hfeed(fitem,hdl);
			hfeed.SetUpdateTime(config->updateTime);
			hfeed.SetWeight(vt.second);
			uinfo->AddHeavyItem(uid,hfeed);
			uids_mem.push_back(uid);
			Trace t("FeedItemManagerI::AddFeed");
		}
		uids.push_back(uid);
	}
コード例 #2
0
void FriendFinderByActiveUserI::setBitMap(const MyUtil::Int2IntMap& loginMap, const Ice::Current& current) {
	MCE_INFO("[FriendFinderByActiveUserI] setBitMap loginMap size = " << loginMap.size());

	if (g_userLoginData_ptr == NULL) {
		MCE_WARN("[FriendFinderByActiveUserI] setBitMap g_userLoginData_ptr is null");
		g_userLoginData_ptr = new UserLoginData();
	}

	g_userLoginData_ptr->setLoginMap( loginMap );
}
コード例 #3
0
ファイル: Util.cpp プロジェクト: xiaoyu-real/Test
void
MyUtil::__writeInt2IntMap(::IceInternal::BasicStream* __os, const ::MyUtil::Int2IntMap& v)
{
    __os->writeSize(::Ice::Int(v.size()));
    ::MyUtil::Int2IntMap::const_iterator p;
    for(p = v.begin(); p != v.end(); ++p)
    {
        __os->write(p->first);
        __os->write(p->second);
    }
}
コード例 #4
0
ファイル: BuddyRelationCacheI.cpp プロジェクト: bradenwu/oce
RelationshipEntryList BuddyRelationCacheManagerI::getRelationBatch(const MyUtil::Int2IntMap & ids,	const Ice::Current& current){
	ostringstream msg;
  msg << ids.size() ;
  InvokeClient client = InvokeClient::create(current, msg.str(), InvokeClient::INVOKE_LEVEL_INFO);
	
  RelationshipEntryList list;
	for(MyUtil::Int2IntMap::const_iterator it=ids.begin(); it!=ids.end(); ++it)
	{
		Relationship relation ;
		relation.from = it->first;
		relation.to = it->second;

	    BuddyDesc desc=BuddyRelationCacheLogic::instance().getRelation(relation);

		RelationshipEntry entry ;
		entry.relation = relation;
		entry.desc = desc;
		list.push_back(entry);
	}

	return list;
}