本文整理汇总了C++中myutil::IntSeq::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ IntSeq::push_back方法的具体用法?C++ IntSeq::push_back怎么用?C++ IntSeq::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myutil::IntSeq
的用法示例。
在下文中一共展示了IntSeq::push_back方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: click
void BatchUpdaterBulletinClickReplicaAdapter::click(int userId, int bulletinId) {
MyUtil::IntSeq keyvalue;
keyvalue.push_back(userId);
keyvalue.push_back(bulletinId);
_clientCS.getProxy(INDEX)->inc(keyvalue, 1, BulletinClickName);
}
示例2: getIds
MyUtil::IntSeq OfferCacheDataI::getIds(){
MyUtil::IntSeq res;
IceUtil::Mutex::Lock lock(_mutex);
for(OfferDataNSeq::iterator iter=bestOffers.begin(); iter!=bestOffers.end(); ++iter){
res.push_back(iter->userId);
}
for(OfferDataNSeq::iterator iter=offers.begin(); iter!=offers.end(); ++iter){
res.push_back(iter->userId);
}
return res;
}
示例3: handle
void ReloadTask::handle(){
MyUtil::IntSeq buddies;
try {
buddies = BuddyByIdCacheAdapter::instance().getFriendListAsc( _id, -1 );
} catch( Ice::Exception e ){
MCE_WARN("[ReloadTask] id=" << _id << " found Ice::Exception : " << e.what() );
return;
} catch( ... ){
MCE_WARN("[ReloadTask] id=" << _id << " found Ice::Exception" );
return;
}
multimap<int, int> orderFriend;
try{
Statement sql;
sql << "SELECT guest, UNIX_TIMESTAMP(time) AS time FROM relation_"
<< (_id % 100)
<< " WHERE host="
<< _id;
ostringstream pattern;
pattern << "relation_" << (_id % 100);
QueryRunner("relation_buddycache", CDbRServer, pattern.str()).query(
sql, OrderedListHandler( buddies, orderFriend, "time", "guest" ) );
}catch(std::exception& e){
MCE_WARN( "[ReloadTask] handle " << _id << " std::exception " << e.what() );
return;
}catch(...){
MCE_WARN( "[ReloadTask] handle " << _id << " unknown exception." );
return;
}
int time_now = (int)time(NULL);
MyUtil::IntSeq times;
ostringstream timestr;
for( MyUtil::IntSeq::iterator itB=buddies.begin(); itB!=buddies.end(); ++itB ){
times.push_back( time_now );
timestr << time_now << " ";
}
for (multimap<int, int>::reverse_iterator itMap = orderFriend.rbegin(); itMap
!= orderFriend.rend(); ++itMap ){
buddies.push_back(itMap->second);
times.push_back(itMap->first);
timestr << itMap->first << " ";
}
BuddyByAddTimeDataNPtr obj = new BuddyByAddTimeDataN;
buddies.swap(obj->friends);
times.swap(obj->times);
MCE_INFO("[ReloadTask] id=" << _id << " friends.size()=" << obj->friends.size() << " times=" << timestr.str() );
SetDataHelper::instance().invokeDelay(_id,obj,timestr.str());
}
示例4: sort
void UserCounterI::sort() {
map<int, int> m;
for (unsigned int i = 0; i < types.size(); ++i) {
m.insert(make_pair(types[i], values[i]));
}
MyUtil::IntSeq t;
MyUtil::IntSeq v;
for (map<int, int>::iterator i = m.begin(); i != m.end(); ++i) {
t.push_back(i->first);
v.push_back(i->second);
}
types = t;
values = v;
}
示例5: 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;
}
}
示例6: create
Ice::ObjectPtr UserApiCacheFactoryI::create(Ice::Long id) {
MCE_WARN("UserApiCacheFactoryI::create -> No Hit For Id: "<<id);
MyUtil::IntSeq ids;
ids.push_back(id);
UserApiCacheReloaderAdapter::instance().getProxy(0)->reload(ids);
return NULL;
}
示例7: updateDb
void RecentContactSet::updateDb(int ownerId,const ContactInfoSeq& contactInfos){
GetProps& props = GetProps::instance();
string table = props.getTableName(ownerId);
Statement sqlAdd;
size_t guests_size = contactInfos.size() > size_t(GUESTS_SIZE) ? size_t(GUESTS_SIZE):contactInfos.size();
MyUtil::IntSeq byteSeq;
for ( size_t i = 0; i < guests_size; ++i ) {
byteSeq.push_back((contactInfos[i]->guestId));
byteSeq.push_back(time(NULL));
byteSeq.push_back((contactInfos[i]->type));
}
sqlAdd << "REPLACE INTO " << table << "(" << COLUMN_HOST << ", " << COLUMN_GUESTS << ")" << " values" << " ("<< ownerId << ","<<mysqlpp::quote<<IntSeqSerialize::serialize(byteSeq)<<")";
// QueryRunner(DB_SOURCE, CDbWServer, table).execute(sqlAdd);
QueryRunner(DB_SOURCE, CDbWServer, table).schedule(sqlAdd);
}
示例8: get_most_recent
MyUtil::IntSeq RecentlyOnlineBuddyData::get_most_recent(int limit) {
IceUtil::Mutex::Lock lock(*this);
MyUtil::IntSeq result;
for (std::deque<int>::reverse_iterator it = _buddies.rbegin();
(int) result.size() < limit && it != _buddies.rend(); ++it) {
if (find(result.begin(), result.end(), *it)!=result.end()) continue;
result.push_back(*it);
}
return result;
}
示例9: create
// FriendRankLoaderFactory::create(Ice::Int userId) {{{
Ice::ObjectPtr FriendRankLoaderFactory::create(Ice::Int userId)
{
MCE_INFO("FriendRankLoaderI::create single -> id: "<<userId);
MyUtil::IntSeq ids;
ids.push_back(userId);
MyUtil::ObjectResultPtr results = create(ids);
return results->data[userId];
}// }}}
示例10: ReloadTask
void xce::compareinfo::CompareInfoReloaderI::reload(const MyUtil::IntSeq& ids, const Ice::Current& current) {
ostringstream oss;
oss << "CompareInfoReloaderI::reload -> size: "<<ids.size() << current.con->toString().substr(current.con->toString().find("remote",25));
TimeCost tc = TimeCost::create(oss.str(), TimeCost::LOG_LEVEL_INFO);
MyUtil::IntSeq tempids;
for (MyUtil::IntSeq::const_iterator i=ids.begin(); i!=ids.end();++i){
if (*i > 0) {
tempids.push_back(*i);
}
}
MyUtil::TaskManager::instance().execute(new ReloadTask(tempids, current));
}
示例11:
void xce::usercache::UserCacheReloaderI::rebuildOnline(const MyUtil::IntSeq& ids, const Ice::Current& current) {
ostringstream oss;
oss << "UserCacheReloaderI::rebuildOnline -> size: "<< ids.size() << " " << current.con->toString().substr(current.con->toString().find("remote",25));
TimeCost tc = TimeCost::create(oss.str(), TimeCost::LOG_LEVEL_INFO);
MyUtil::IntSeq rebuildIds;
for (MyUtil::IntSeq::const_iterator i=ids.begin(); i!=ids.end();++i){
if (*i > 0) {
rebuildIds.push_back(*i);
}
}
RebuildOnline::instance().rebuild(rebuildIds);
}
示例12: 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);
}
示例13:
BuddyByOnlineTimeDataI::BuddyByOnlineTimeDataI( BuddyByOnlineTimeDataPtr data ){
std::multimap<int, int> orderFriend;
for (OnlineTimeSeq::const_iterator it = data->onlinetime.begin(); it
!= data->onlinetime.end(); ++it) {
orderFriend.insert(make_pair<int,int>(it->time,it->userId));
}
MyUtil::IntSeq buddies;
for (multimap<int, int>::reverse_iterator it = orderFriend.rbegin(); it
!= orderFriend.rend(); ++it ){
buddies.push_back(it->second);
}
friends.swap( buddies );
}
示例14: get
MyUtil::IntSeq IPRecordData::get(int limit){
IceUtil::Mutex::Lock lock(*this);
if( limit < 0){
return _users;
}
MyUtil::IntSeq result;
for( MyUtil::IntSeq::reverse_iterator it = _users.rbegin(); it != _users.rend(); ++it ) {
if (--limit < 0 ) {
break;
}
result.push_back(*it);
}
return result;
}
示例15: batchVerify
MyUtil::IntSeq TalkRightAdapter::batchVerify(int index, const VerifySeq& seq) {
MyUtil::IntSeq res;
try {
res = getManager(abs(index) % getCluster())->batchVerify(seq);
} catch(...) {
for(size_t i = 0; i < seq.size(); ++i){
res.push_back(seq.at(i)->index);
}
}
return res;
}