当前位置: 首页>>代码示例>>C++>>正文


C++ IntSeq::begin方法代码示例

本文整理汇总了C++中myutil::IntSeq::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ IntSeq::begin方法的具体用法?C++ IntSeq::begin怎么用?C++ IntSeq::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在myutil::IntSeq的用法示例。


在下文中一共展示了IntSeq::begin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: create

ObjectResultPtr UserNetworkPreloaderFactory::create(const MyUtil::IntSeq& ids)
{
	
	ObjectResultPtr results = new ObjectResult;

	ostringstream idsSql;

	idsSql<<" WHERE userid IN (";
	
	for(MyUtil::IntSeq::const_iterator it = ids.begin(); it != ids.end(); ++it)
	{
		mop::hi::svc::model::NetworkDataIPtr tempData = new mop::hi::svc::model::NetworkDataI;
		tempData->userId = *it;
		results->data.insert(make_pair(*it, tempData)); 
		
		if (it != ids.begin()) 
		{
			idsSql<< ", ";
		}
		idsSql << *it;
	}
	
	idsSql << ")";
	
	MCE_INFO("UserNetworkPreloaderFactory::create group -> id from: "<<idsSql.str());
	
	{
		BatchUserNetworkResultHandler handler(results );
		Statement sql;
		sql << "SELECT id, userid, stage, network_id, network_name," 
			<< 	" info_id, join_time, status" 
			<<  " FROM " << TABLE_NETWORK << idsSql.str();
		QueryRunner(DB_NETWORK , CDbRServer ).query(sql, handler);
	}
	{
		BatchUserHighSchoolResultHandler handler(results );
		Statement sql;
		sql << "SELECT id, userid, high_school_id, high_school_name," 
			<< 	" enroll_year, h_class1, h_class2, h_class3" 
			<<  " FROM " << TABLE_HIGH_SCHOOL_INFO << idsSql.str();
		QueryRunner(DB_NETWORK , CDbRServer ).query(sql, handler);
	}
	{
		BatchUserUniversityResultHandler handler(results );
		Statement sql;
		sql << "SELECT id, userid, university_id, university_name, dorm," 
			<< 	" department, type_of_course, enroll_year" 
			<<  " FROM " << TABLE_UNIVERSITY_INFO << idsSql.str();
		QueryRunner(DB_NETWORK , CDbRServer ).query(sql, handler);
	}
	{
		BatchUserWorkplaceResultHandler handler(results );
		Statement sql;
		sql << "SELECT id, userid, workplace_id, workplace_name, address," 
			<< 	" province, city_id, city_name, " 
			<< 	" description, join_year, join_month, " 
			<< 	" quit_year, quit_month, type, " 
			<< 	" job_title_id, position_id" 
			<<  " FROM " << TABLE_WORKPLACE_INFO << idsSql.str();
		QueryRunner(DB_NETWORK , CDbRServer ).query(sql, handler);
	}
	{
		BatchUserCollegeResultHandler handler(results );
		Statement sql;
		sql << "SELECT id, userid, college_id, college_name, department," 
			<< 	" enroll_year" 
			<<  " FROM " << TABLE_COLLEGE_INFO << idsSql.str();
		QueryRunner(DB_NETWORK , CDbRServer ).query(sql, handler);
	}
	{
		BatchUserElementarySchoolResultHandler handler(results );
		Statement sql;
		sql << "SELECT id, userid, elementary_school_id, elementary_school_name, elementary_school_year" 
			<<  " FROM " << TABLE_ELEMENTARY_SCHOOL_INFO << idsSql.str();
		QueryRunner(DB_NETWORK , CDbRServer ).query(sql, handler);
	}
	{
		BatchUserJuniorHighSchoolResultHandler handler(results );
		Statement sql;
		sql << "SELECT id, userid, junior_high_school_id, junior_high_school_name, junior_high_school_year" 
			<<  " FROM " << TABLE_JUNIOR_HIGH_SCHOOL_INFO << idsSql.str();
		QueryRunner(DB_NETWORK , CDbRServer ).query(sql, handler);
	}
	{
		BatchUserRegionResultHandler handler(results );
		Statement sql;
		sql << "SELECT id, userid, region_id, province_name, city_name" 
			<<  " FROM " << TABLE_REGION_INFO << idsSql.str();
		QueryRunner(DB_NETWORK , CDbRServer ).query(sql, handler);
	}
	
	return results;
}
开发者ID:bradenwu,项目名称:oce,代码行数:93,代码来源:UserNetworkPreloader.cpp

示例2: reloadUsers

void MiniGroupWriterAdapter::reloadUsers(const MyUtil::IntSeq& userIds) {
  IceUtil::Monitor<IceUtil::Mutex>::Lock lock(_mutex);
  _userIdSet.insert(userIds.begin(), userIds.end());
  _mutex.notify();
}
开发者ID:bradenwu,项目名称:oce,代码行数:5,代码来源:MiniGroupWriterAdapter.cpp

示例3: create

ObjectResultPtr UserApiCachePreloaderFactory::create(const MyUtil::IntSeq& ids) {
	MCE_DEBUG("UserApiCachePreloaderLoaderI::create group -> id size: "<<ids.size());
        ObjectResultPtr result = new ObjectResult;
        {
                Statement sql;
				sql<<	"SELECT	id,status  FROM "<<	TABLE_USER_PASSPORT <<"	WHERE	id	IN (	";
                for (MyUtil::IntSeq::const_iterator it = ids.begin(); it != ids.end(); ++it) {
                        if (it != ids.begin()) {
                                sql << ",";
                        }
                        sql << *it;
                }
                sql << ")";
                QueryRunner(DB_USER_PASSPORT,CDbRServer).query(sql, BatchUserPassportResultHandler(result));
        }
        {
                Statement sql;
	      sql<< "SELECT id,gender,birth_year,birth_month,birth_day,home_province, home_city FROM " << TABLE_USER_BORN << " WHERE id IN ( " ;
                for (MyUtil::IntSeq::const_iterator it = ids.begin(); it != ids.end(); ++it) {
                        if (it != ids.begin()) {
                                sql << ", ";
                        }
                        sql << *it;
                }
                sql << ")";
                QueryRunner(DB_USER_BORN,CDbRServer).query(sql, BatchUserBornResultHandler(result));
        }
        {
                Statement sql;
				sql<< "SELECT id,stage,univ FROM " << TABLE_USER_STAGE << " WHERE id IN ( " ;
                for (MyUtil::IntSeq::const_iterator it = ids.begin(); it != ids.end(); ++it) {
                        if (it != ids.begin()) {
                                sql << ", ";
                        }
                        sql << *it;
                }
                sql << ")";
                QueryRunner(DB_USER_STAGE,CDbRServer).query(sql, BatchUserStageResultHandler(result));
        }
        {
                Statement sql;
				sql<< "SELECT id,basic_config,status_config,profile_privacy FROM "<< TABLE_USER_CONFIG <<" WHERE id IN ( " ;
                for (MyUtil::IntSeq::const_iterator it = ids.begin(); it != ids.end(); ++it) {
                        if (it != ids.begin()) {
                                sql << ",";
                        }
                        sql << *it;
                }
                sql << ")";
                QueryRunner(DB_USER_CONFIG,CDbRServer).query(sql, BatchUserConfigResultHandler(result));
        }
        {
                Statement sql;
				sql<<	"SELECT	id,mainurl,headurl,tinyurl FROM "<<	TABLE_USER_URL	<<"	WHERE	id	IN ( ";
                for (MyUtil::IntSeq::const_iterator it = ids.begin(); it != ids.end(); ++it) {
                        if (it != ids.begin()) {
                                sql << ",";
                        }
                        sql << *it;
                }
                sql << ")";
                QueryRunner(DB_USER_URL,CDbRServer).query(sql, BatchUserUrlResultHandler(result));
        }
        {
                Statement sql;
				sql<<	"SELECT	id,name FROM "<<	TABLE_USER_NAME	<<"	WHERE	id	IN ( ";
                for (MyUtil::IntSeq::const_iterator it = ids.begin(); it != ids.end(); ++it) {
                        if (it != ids.begin()) {
                                sql << ",";
                        }
                        sql << *it;
                }
                sql << ")";
                QueryRunner(DB_USER_NAME,CDbRServer).query(sql, BatchUserNameResultHandler(result));
        }
        {
                Statement sql;
				sql<<	"SELECT	id,auth FROM "<<	TABLE_USER_RIGHT	<<"	WHERE	id	IN (	";
                for (MyUtil::IntSeq::const_iterator it = ids.begin(); it != ids.end(); ++it) {
                        if (it != ids.begin()) {
                                sql << ",";
                        }
                        sql << *it;
                }
                sql << ")";
                QueryRunner(DB_USER_RIGHT,CDbRServer).query(sql, BatchUserRightResultHandler(result));
        }
        {
                Statement sql;
				sql<<	"SELECT	id,state,level FROM "<<	TABLE_USER_STATE	<<"	WHERE	id	IN (	";
                for (MyUtil::IntSeq::const_iterator it = ids.begin(); it != ids.end(); ++it) {
                        if (it != ids.begin()) {
                                sql << ",";
                        }
                        sql << *it;
                }
                sql << ")";
                QueryRunner(DB_USER_STATE,CDbRServer).query(sql, BatchUserStateResultHandler(result));
        }
        return result;
//.........这里部分代码省略.........
开发者ID:bradenwu,项目名称:oce,代码行数:101,代码来源:UserApiCachePreloader.cpp

示例4: GetRoomActiveUserSeq

MucActiveUserSeq RoomPool::GetRoomActiveUserSeq(const MucRoomIdPtr& roomid){
  MCE_DEBUG("RoomPool::GetRoomActiveUserSeq --> ROOMNAME = " << roomid->roomname);
  RoomMemberListPtr rmlptr;
  MucActiveUserSeq ans;

  MyUtil::IntSeq userids;
  rmlptr = GetMemberList(roomid);
  if(rmlptr){
    IceUtil::RWRecMutex::RLock lock(_rwmutex);
		userids = rmlptr->GetAllMembersSeq();
  }
  if(userids.empty()){
		MCE_DEBUG("RoomPool::GetRoomActiveUserSeq --> userids is empty so return");
    return ans;
  }
	JidSeqMap jseqmap;
	try{
	  MCE_DEBUG("RoomPool::GetRoomActiveUserSeq --> call OnlineCenterAdapter.getUsersJids userids.size = " << userids.size());
  	jseqmap = OnlineCenterAdapter::instance().getUsersJids(userids);
	}
	catch(Ice::Exception& e){
		MCE_WARN("RoomPool::GetRoomActiveUserSeq-->OnlineCenter::getUserJids-->line:"<<__LINE__<<" err:"<<e);
	}
	catch(std::exception& e){
		MCE_WARN("RoomPool::GetRoomActiveUserSeq--> call OnlineCenter.getUserJids ERR  line:"<<__LINE__<<" err:"<<e.what());
	}
  if(jseqmap.empty()){
    return ans;
  }
	TalkUserMap uinfoPtr;
	try{
		uinfoPtr = TalkCacheClient::instance().GetUserBySeqWithLoad(0, userids);
	}catch(Ice::Exception& e){
		MCE_WARN("RoomPool::GetRoomActiveUserSeq-->TalkCacheClient::GetUserBySeqWithLoad-->error:" << e);
	}
  MyUtil::IntSeq::iterator uidit = userids.begin();
  for(; uidit != userids.end(); ++uidit){
    int userid = (*uidit);
    JidSeqMap::const_iterator jit = jseqmap.find(userid);
    if(jit == jseqmap.end()){
      continue;
    }

    Permisions permision = PMember;
		try{
		  MCE_DEBUG("RoomPool::GetRoomActiveUserSeq --> CALL MucUserRoomAdapter.GetMemberPermision(" << userid << ", " << roomid->roomname << ")");
			MucMemberPtr m = MucUserRoomAdapter::instance().GetMemberPermision(userid, roomid);
			if(m){
				permision = m->permision;
			}
			else{
				MCE_DEBUG("RoomPool::GetRoomActiveUserSeq --> CALL MucUserRoomAdapter.GetMemberPermision's return is NULL, it means the user is not in the room so continue!");
				continue;
			}
		}
		catch(Ice::Exception& e){
			MCE_WARN("RoomPool::GetRoomActiveUserSeq-->MucUserRoom::GetMemberPermision-->line:"<<__LINE__<<" err:"<<e);
		}
		catch(std::exception& e){
			MCE_WARN("RoomPool::GetRoomActiveUserSeq--> call MucUserRoom.GetMemberPermision ERR  line:"<<__LINE__<<" err:"<<e.what());
		}

    string nickname = "";
    TalkUserMap::iterator infoit = uinfoPtr.find(userid);
    if(infoit == uinfoPtr.end()){
      //取不到用户的名称,默认用id 
      try{
        nickname = boost::lexical_cast<string>(userid);
      }
      catch (exception& e){
        MCE_WARN("RoomPool::GetRoomActiveUserSeq-->boost::lexical_cast to string exception  val = " << userid);
      }
    }
    else{
      TalkUserPtr u = infoit->second;
      nickname = u->name;
    }


    for (size_t index = 0; index < jit->second.size(); ++index) {
      char endpoint = jit->second.at(index)->endpoint[0];
      if(endpoint != 'T' && endpoint != 'W'){
        continue;
      }
      MucRoomIdPtr roomid = new MucRoomId();
      roomid->roomname = rmlptr->_roomname;
      roomid->domain = MUCDOMAIN;
      MucUserIdentityPtr identity = new MucUserIdentity();
      identity->roomid = roomid;
      identity->nickname = makeMucNickname(jit->second.at(index), nickname);
      identity->userid = userid;
      MucActiveUserPtr activeuserptr = new MucActiveUser();
      activeuserptr->jid = jit->second.at(index);
      activeuserptr->identity = identity;
      activeuserptr->permision = permision;
      ans.push_back(activeuserptr);
    }
  }
  MCE_DEBUG("RoomPool::GetRoomActiveUserSeq --> roomname = " << roomid->roomname << " ans.size = " << ans.size());
  return ans;
//.........这里部分代码省略.........
开发者ID:gunner14,项目名称:old_rr_code,代码行数:101,代码来源:RoomPool.cpp


注:本文中的myutil::IntSeq::begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。