本文整理汇总了C++中myutil::IntSeq::size方法的典型用法代码示例。如果您正苦于以下问题:C++ IntSeq::size方法的具体用法?C++ IntSeq::size怎么用?C++ IntSeq::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myutil::IntSeq
的用法示例。
在下文中一共展示了IntSeq::size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
// FriendRankLoaderFactory::create(const MyUtil::IntSeq& ids) {{{
ObjectResultPtr FriendRankLoaderFactory::create(const MyUtil::IntSeq& ids)
{
MCE_DEBUG("FriendRankLoaderI::create group -> id size: "<<ids.size());
MyUtil::ObjectResultPtr results = new MyUtil::ObjectResult;
if (ids.size()<=0)
return results;
Statement sql;
sql << "SELECT user_id,rank FROM friend_rank_new"
<< " WHERE user_id in (" << ids[0];
for (size_t i=1; i < ids.size(); ++i)
{
sql << "," << ids[i];
}
sql << ")";
try {
QueryRunner("friend_rank", CDbRServer).query(
sql, FriendRankBatchResultHandler(results));
} catch (Ice::Exception& e) {
MCE_WARN("[create] Ice::Exception " << e.what());
} catch (std::exception& e) {
MCE_WARN("[create] std::excetpion " << e.what());
} catch (...) {
MCE_WARN("[create] exception");
}
return results;
}// }}}
示例2: create
ObjectResultPtr BuddyApplyCacheNPreloaderFactory::create(const MyUtil::IntSeq& ids) {
MCE_INFO("BuddyApplyCacheNPreloaderFactory::create group -> id size: "<<ids.size());
int minId = ids.front();
int maxId = ids[ids.size()-1];
MCE_INFO("BuddyApplyCacheNPreloaderFactory::create group -> id from: "<<minId <<" to: "<<maxId);
ObjectResultPtr results = new ObjectResult;
for(std::vector<int>::const_iterator it = ids.begin(); it != ids.end() ; ++it)
{
int id = *it;
BuddyApplyCacheNPtr buddyApplyCacheResult = new BuddyApplyCacheN();
buddyApplyCacheResult->ownerId = id;
BuddyApplyCacheResultHandlerI handler(buddyApplyCacheResult);
Statement sql;
sql
<< "SELECT applicant,UNIX_TIMESTAMP(time) AS unix_time,why,stat_from,group_name"
<< " FROM buddyapply_accepter_" << abs(id % 100) << " WHERE accepter = '" << id << "'"
<< " ORDER BY time DESC"
<< " LIMIT 100";
ostringstream pattern;
pattern << "buddyapply_accepter_" << id % 100;
QueryRunner("buddyapplycache_accepter", CDbRServer,pattern.str()).query(sql, handler);
results->data.insert(make_pair(*it, buddyApplyCacheResult));
}
MCE_INFO("BuddyApplyCacheNPreloaderFactory::create group -> data.size: "<< results->data.size());
return results;
}
示例3:
void FeedMemcContentI::Test2(const MyUtil::IntSeq & ids, const Ice::Current&) {
if(ids.size() == 0){
return;
}
return;
if(ids.size()%10 < 10){
//TalkCacheClient::instance().GetUserBySeqWithLoad(0, ids);
}
}
示例4: GetMembers
Int2IntSeqMap FeedGroupManagerI::GetMembers(const ::MyUtil::IntSeq& gids,
const ::Ice::Current&) {
Int2IntSeqMap res;
for (unsigned i = 0; i != gids.size(); ++i) {
res[gids.at(i)] = UnreadInfoPool::instance().GetMembersInGroup(gids.at(i));
}
MCE_INFO("FeedGroupManagerI::GetMembers gids size:" << gids.size() << " res size:" << res.size() );
return res;
}
示例5: remove
void SocialFeedCacheI::remove(::Ice::Int hostId, const MyUtil::IntSeq& friendIds,
const MyUtil::IntSeq& newCommonIds, const Ice::Current& current) {
MCE_INFO("[SocialFeedCacheI] remove hostId(" << hostId << ") friendIds size(" <<
friendIds.size() << ") newCommonIds size(" << newCommonIds.size() << ")");
Feed feedItem;
feedItem.friendIds = friendIds;
feedItem.newCommonIds = newCommonIds;
TaskManager::instance().execute( new RemoveTask(hostId, feedItem) );
}
示例6: getPhotoIdsFrom
MyUtil::IntSeq OfferFriendsUtil::getPhotoIdsFrom(const MyUtil::IntSeq& ids){
try {
return PhotoStateFilterAdapter::instance().getPhotoIdsFrom( ids );
} catch( Ice::Exception e ){
MCE_WARN("[OfferFriendsUtil::getPhotoIdsFrom] ids.size()=" << ids.size() << " found Ice::Exception : " << e.what() );
return ids;
} catch( ... ){
MCE_WARN("[OfferFriendsUtil::getPhotoIdsFrom] ids.size()=" << ids.size() << " found unknown exception : " );
return ids;
}
return ids;
}
示例7: load
void UserAdsCacheLoaderI::load(const MyUtil::IntSeq& ids, const Ice::Current& current) {
MCE_DEBUG("UserAdsCacheLoaderI::load -> size: "<<ids.size()<<" " << current.con->toString().substr(current.con->toString().find("remote",25)));
MyUtil::IntSeq is;
for (MyUtil::IntSeq::const_iterator i = ids.begin(); i != ids.end(); ++i) {
if (*i > 0) {
is.push_back(*i);
}
}
if (is.size() <= 0) {
return ;
}
CacheLoader<UserAdsCacheManagerPrx>::instance().reload(is);
}
示例8:
map<string, string> UseImNotifyTask::parameters(){
map<string, string> paras;
paras["method"] = "notifications.send";
paras["session_key"] = boost::lexical_cast<string>(_userid);
//paras["api_key"] = "ffa4add0b30141aa9eb9a8f1af34a8c3";
//paras["call_id"] = boost::lexical_cast<string>(time(NULL));
//paras["v"] = "1.0";
//paras["format"] = "xml";
MyUtil::IntSeq ids;
try{
ids = BuddyByOnlineTimeCacheAdapter::instance().getFriendList(_userid, 20);
}
catch(Ice::Exception& e){
MCE_WARN("UseImNotifyTask::parameters-->BuddyByOnlineTimeCacheAdapter::getFriendList-->" << e);
}
if(ids.empty()) {
return map<string, string>();
}
MCE_INFO("UseImNotifyTask::parameters --> " << _userid << " " << ids.size());
ostringstream buddyids;
for(size_t i = 0; i < ids.size(); ++i) {
// int c = ids.size() < 10? ids.size(): 10;
// for(size_t i = 0; i < c; ++i) {
if(i) {
buddyids << ",";
}
buddyids << ids.at(i);
}
paras["to_ids"] = buddyids.str();
ostringstream msg[3];
msg[0] << "<xn:name uid=\""<<_userid<<"\" linked=\"true\"/>悄悄安装了<a href=\"http://im.renren.com/desktop.html?answer1\">人人桌面</a>,能定时启动游戏,采摘你的果实,升级更快了!| <a href=\"http://im.renren.com/desktop/ver19/rrsetup.exe?answer1\">赶紧安装不能落后!</a>";
msg[1] << "<xn:name uid=\""<<_userid<<"\" linked=\"true\"/>抢先体验了<a href=\"http://im.renren.com/desktop.html?settime2\">人人桌面</a>,留言提醒、快速回复、好友聊天更快更稳定! | <a href=\"http://im.renren.com/desktop/ver19/rrsetup.exe?settime2\">快来安装吧</a>";
msg[2] << "<xn:name uid=\""<<_userid<<"\" linked=\"true\"/>用<a href=\"http://im.renren.com/desktop.html?onemin3\">人人桌面</a>登录了人人网,TA不开网页,就能一键登录、隐身上线、定时玩游戏! | <a href=\"http://im.renren.com/desktop/ver19/rrsetup.exe?onemin3\">我也要安装</a>";
paras["notification"] = msg[abs(_userid)%3].str();
/* paras["sig"] = makeSig(paras);
string path = "http://api.xiaonei.com/server/restserver.do";
try{
RestMediatorAdapter::instance().restRequest(id(), _userid, path, paras);
}catch(Ice::Exception& e){
MCE_WARN("UseImNotifyTask::handle --> invoke RestMediatorAdapter error" << e);
}*/
return paras;
}
示例9: instance
map<int,bool> OfferFriendsUtil::getStateGuideBatch(const MyUtil::IntSeq& ids){
try {
return UserStateFilterAdapter::instance().getStateGuideBatch( ids );
} catch( Ice::Exception e ){
MCE_WARN("[OfferFriendsUtil::getStateGuideBatch] ids.size()=" << ids.size() << " found Ice::Exception : " << e.what() );
} catch( ... ){
MCE_WARN("[OfferFriendsUtil::getStateGuideBatch] ids.size()=" << ids.size() << " found unknown exception" );
}
map<int,bool> res;
for( MyUtil::IntSeq::const_iterator it = ids.begin(); it != ids.end(); ++it ){
res[*it] = false;
}
return res;
}
示例10: setStats
void OnlineManagerI::setStats(const ::MyUtil::IntSeq& userIds,
::Ice::Int onlineType, bool online, const Ice::Current& current) {
MCE_DEBUG("OnlineManagerI::setStats working...");
for (size_t i = 0; i< userIds.size() ; ++i) {
setStat(userIds.at(i) , onlineType, online);
}
}
示例11: reload
void HatDataWriterI::reload(const MyUtil::IntSeq& ids, const Ice::Current & current) {
ostringstream inMsg;
inMsg<<"id size = " << ids.size();
MyUtil::InvokeClient ic = MyUtil::InvokeClient::create(current, inMsg.str(), MyUtil::InvokeClient::INVOKE_LEVEL_INFO);
MyUtil::ObjectResultPtr result = new MyUtil::ObjectResult;
com::xiaonei::xce::Statement sql;
sql << "SELECT * FROM " << TABLE_HAT << " WHERE id IN ( ";
for(MyUtil::IntSeq::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
if(it != ids.begin())
{
sql << ",";
}
sql << *it;
}
sql << " )";
BatchHatDataResultHandlerI handler(result);
{
com::xiaonei::xce::QueryRunner(DB_MEMBERS, com::xiaonei::xce::CDbRServer).query(sql, handler);
xce::adapter::hatdata::HatDataReaderAdapter::instance().setData(result);
}
}
示例12: run
void MiniGroupWriterAdapter::run() {
while (true) {
MyUtil::IntSeq userIds;
MyUtil::LongSeq miniGroupIds;
{
IceUtil::Monitor<IceUtil::Mutex>::Lock lock(_mutex);
if (_userIdSet.empty() && _miniGroupIdSet.empty()) {
_mutex.wait();
}
userIds.insert(userIds.end(), _userIdSet.begin(), _userIdSet.end());
_userIdSet.clear();
miniGroupIds.insert(miniGroupIds.end(), _miniGroupIdSet.begin(), _miniGroupIdSet.end());
_miniGroupIdSet.clear();
}
if (!userIds.empty()) {
try {
getMiniGroupWriterPrx(0)->reloadUsers(userIds);
} catch(Ice::Exception& e) {
MCE_WARN("[MiniGroupWriterAdapter::run] reloadUsers size = " << userIds.size());
}
}
if (!miniGroupIds.empty()) {
try {
getMiniGroupWriterPrx(0)->reloadMiniGroups(miniGroupIds);
} catch(Ice::Exception& e) {
MCE_WARN("[MiniGroupWriterAdapter::run] reloadMiniGroups size = " << miniGroupIds.size());
}
}
}
}
示例13: reloadUsers
void MiniGroupWriterI::reloadUsers(const MyUtil::IntSeq& user_ids, const Ice::Current& current) {
map<int, vector<int> > seperatedIds = DBUtil<int>::seperateIdsByMod<int>(TABLE_MOD, user_ids);
MCE_INFO("[MiniGroupWriterI::reloadUsers] userIds.size = " << user_ids.size());
for (map<int, vector<int> >::const_iterator it = seperatedIds.begin(); it != seperatedIds.end(); ++it) {
reloadUser2MiniGroups(it->second, it->first);
}
}
示例14: getUnMutualFriends
//获取uid的好友用户中不是gid的粉丝的那些用户
MyUtil::IntSeq MutualFriendsCacheManagerI::getUnMutualFriends(int uid, const MyUtil::GlobalIdPtr& gid, int begin, int limit, const Ice::Current& current) {
ostringstream msg;
msg << "uid = " << uid << ", gid = " << GlobalIdTransfer::get(gid) << ", begin = " << begin << ", limit = " << limit;
InvokeClient ic = InvokeClient::create(current, msg.str(), InvokeClient::INVOKE_LEVEL_INFO);
MyUtil::IntSeq fids = getAllFansAsc(gid);
MyUtil::IntSeq uids = getFriendsAsc(uid);
MyUtil::IntSeq result;
if (limit < -1 || begin < 0 || uid < 0) {
return result;
} else {
int count = 0;
int countLimit = (limit == -1) ? uids.size() : limit;
MyUtil::IntSeq::iterator fit = fids.begin();
MyUtil::IntSeq::iterator uit = uids.begin();
while (fit != fids.end() && uit != uids.end() && count < countLimit + begin) {
if (*fit < *uit) {
fit++;
} else if (*uit < *fit) {
if(count >= begin){
result.push_back(*uit);
}
count++;
uit++;
} else {
fit++;
uit++;
}
}
return result;
}
}
示例15: notifySomebodyOnline
void RecentlyOnlineBuddyManagerI::notifySomebodyOnline(
const ::MyUtil::IntSeq& buddies, ::Ice::Int theOnlineOne,
const Ice::Current& current) {
MCE_INFO("RecentlyOnlineBuddyManagerI::notifySomebodyOnline buddies.size="
<< buddies.size() << " theOnlineOne:" << theOnlineOne);
TaskManager::instance().execute(new NotifySomebodyOnlineTask(buddies,
theOnlineOne));
}