本文整理汇总了C++中myutil::IntSeq::front方法的典型用法代码示例。如果您正苦于以下问题:C++ IntSeq::front方法的具体用法?C++ IntSeq::front怎么用?C++ IntSeq::front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myutil::IntSeq
的用法示例。
在下文中一共展示了IntSeq::front方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}