本文整理汇总了C++中myutil::Str2StrMap类的典型用法代码示例。如果您正苦于以下问题:C++ Str2StrMap类的具体用法?C++ Str2StrMap怎么用?C++ Str2StrMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Str2StrMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setVipMemberData
void VipMemberDataWriterI::setVipMemberData(Ice::Int id, const MyUtil::Str2StrMap& props, const Ice::Current & current)
{
std::ostringstream inMsg;
inMsg<<"id = "<<id;
MyUtil::InvokeClient ic = MyUtil::InvokeClient::create(current, inMsg.str(), MyUtil::InvokeClient::INVOKE_LEVEL_INFO);
//去掉map中的用户id
MyUtil::Str2StrMap::iterator it = const_cast<MyUtil::Str2StrMap&>(props).find("UID");
if(it!=props.end())
{
const_cast<MyUtil::Str2StrMap&>(props).erase(it);
}
MyUtil::Str2StrMap::const_iterator tIt = props.find("TYPE");
if(tIt == props.end())
{
MCE_WARN("VipMemberDataWriterI::setVipMemberData Exception no type in props for id " << boost::lexical_cast<std::string>(id));
return;
}
MyUtil::Str2StrMap filter;
filter["uid"] = boost::lexical_cast<string>(id);
filter["type"] = tIt->second;
{
xce::tempmutex::Lock lock(_tempMutexManager,id);
com::xiaonei::xce::QueryRunner(DB_MEMBERS,com::xiaonei::xce::CDbWServer).execute(com::xiaonei::xce::Statement::buildUpdate(TABLE_VIP_MEMBER, filter, props));
xce::adapter::vipmemberdata::VipMemberDataReaderAdapter::instance().setVipMemberData(id,props);
}
}
示例2: PrintProp
void PrintProp(int actor,const MyUtil::Str2StrMap & props){
ostringstream oss;
oss << "PrintProp uid:" << actor;
for(Str2StrMap::const_iterator i = props.begin(); i != props.end();++i){
oss << " " << i->first << ":" << i->second;
}
MCE_INFO(oss.str());
}
示例3: SpecialProcess
void DispatchNManagerI::SpecialProcess(const MyUtil::Str2StrMap& props,
int & task_level, bool& store) {
if (props.find("schema_id")->second == "48") { task_level = kTaskLevelActivity;} //干旱捐款活动,应该没用了
props.find("schema_id")->second;
Str2StrMap::const_iterator i = props.find("schema_id");
if (i != props.end() && i->second == "193") {
store = false;//193是A在群回复B(无气泡,通知用)
}
}
示例4: GetServreIndex
Ice::Long DispatchManagerI::GetServreIndex(Ice::Long nid, const MyUtil::Str2StrMap& props) {
Ice::Long server_index = nid;
MyUtil::Str2StrMap::const_iterator it = props.find("feed_source");
if (it != props.end()) {
try {
server_index = boost::lexical_cast<Ice::Long>(it->second);
} catch (boost::bad_lexical_cast & e) {}
}
return server_index;
}
示例5:
void
MyUtil::__writeStr2StrMap(::IceInternal::BasicStream* __os, const ::MyUtil::Str2StrMap& v)
{
__os->writeSize(::Ice::Int(v.size()));
::MyUtil::Str2StrMap::const_iterator p;
for(p = v.begin(); p != v.end(); ++p)
{
__os->write(p->first);
__os->write(p->second);
}
}
示例6: createUserDoing
void UserDoingManagerI::createUserDoing(const MyUtil::Str2StrMap& props, const Ice::Current& current )
{
MCE_INFO("UserPassportManagerI::createUserDoing" << " " << current.con->toString().substr(current.con->toString().find("remote",25)));
int id;
MyUtil::Str2StrMap::const_iterator it = props.find("ID");
if(it!=props.end()) {
id=boost::lexical_cast<Ice::Int>(it->second);
} else {
MCE_WARN("UserDoingManagerI::createUserDoing CreateUserDoingException::Can find userID in props");
return;
}
UserDoingAdapter::instance().getUserDoingManager(id)->createUserDoing(props);
}
示例7: while
void
MyUtil::__readStr2StrMap(::IceInternal::BasicStream* __is, ::MyUtil::Str2StrMap& v)
{
::Ice::Int sz;
__is->readSize(sz);
while(sz--)
{
::std::pair<const ::std::string, ::std::string> pair;
__is->read(const_cast< ::std::string&>(pair.first));
::MyUtil::Str2StrMap::iterator __i = v.insert(v.end(), pair);
__is->read(__i->second);
}
}
示例8: createUserContact
void UserContactManagerI::createUserContact(const MyUtil::Str2StrMap& properities, const Ice::Current & current) {
InvokeClient::create(current, "", InvokeClient::INVOKE_LEVEL_INFO);
MyUtil::Str2StrMap::const_iterator itr = properities.find("ID");
int id;
if (itr == properities.end()) {
MCE_WARN("UserContactManagerI::createUserContact, Exception[NoId]");
return;
} else {
id = boost::lexical_cast<int>(itr->second);
}
UserContactWriterAdapter::instance().createUserContact(id, properities);
}
示例9: getPropsString
void SchemaManager::getPropsString(const MyUtil::Str2StrMap& props,
string& props_str) {
if (props.empty()) {
return;
}
MyUtil::Str2StrMap::const_iterator it = props.begin();
props_str.append(it->first);
props_str.append(":");
props_str.append(it->second);
++it;
for (; it != props.end(); ++it) {
props_str.append(",");
props_str.append(it->first);
props_str.append(":");
props_str.append(it->second);
}
}
示例10: createVipMemberData
void VipMemberDataWriterI::createVipMemberData(const MyUtil::Str2StrMap& props, const Ice::Current & current)
{
MyUtil::InvokeClient ic = MyUtil::InvokeClient::create(current, "", MyUtil::InvokeClient::INVOKE_LEVEL_INFO);
MyUtil::Str2StrMap::const_iterator it = props.find("UID");
int id;
if (it == props.end())
{
MCE_WARN("VipMemberDataWriterI::createVipMemberData , Exception no id!");
return;
} else {
id = boost::lexical_cast<int>(it->second);
}
it = props.find("TYPE");
if (it == props.end())
{
MCE_WARN("VipMemberDataWriterI::createVipMemberData , Exception no type!");
return;
}
{
xce::tempmutex::Lock lock(_tempMutexManager,id);
com::xiaonei::xce::QueryRunner(DB_MEMBERS,com::xiaonei::xce::CDbWServer).execute(com::xiaonei::xce::Statement::buildInsert(TABLE_VIP_MEMBER, props));
VipMemberMemDataIPtr result = new VipMemberMemDataI;
com::xiaonei::xce::Statement sql;
sql << "SELECT * FROM " << TABLE_VIP_MEMBER << " WHERE uid = '" << id << "'";
VipMemberMemDataResultHandlerI handler(result);
com::xiaonei::xce::QueryRunner(DB_MEMBERS, com::xiaonei::xce::CDbWServer).query(sql, handler);
if (result->data.empty())
{
MCE_WARN("VipMemberDataWriterI::createVipMemberData , Exception NoSuchVipMemberData id = " << id);
return;
}
xce::adapter::vipmemberdata::VipMemberDataReaderAdapter::instance().setData(id, result);
}
}
示例11: handler
void Icon2UrlDataWriterI::createIcon2UrlData(const MyUtil::Str2StrMap& props, const Ice::Current & current)
{
MyUtil::InvokeClient ic = MyUtil::InvokeClient::create(current, "", MyUtil::InvokeClient::INVOKE_LEVEL_INFO);
MyUtil::Str2StrMap::const_iterator it = props.find("ID");
int id;
if (it == props.end())
{
MCE_WARN("Icon2UrlDataWriterI::createIcon2UrlData , Exception no id!");
return;
} else {
id = boost::lexical_cast<int>(it->second);
}
{
xce::tempmutex::Lock lock(_tempMutexManager,id);
com::xiaonei::xce::QueryRunner(DB_MEMBERS,com::xiaonei::xce::CDbWServer).execute(com::xiaonei::xce::Statement::buildInsert(TABLE_ICON_URL, props));
Icon2UrlDataIPtr result = new Icon2UrlDataI;
com::xiaonei::xce::Statement sql;
sql << "SELECT * FROM " << TABLE_ICON_URL << " WHERE id = '" << id << "'";
Icon2UrlDataResultHandlerI handler(result);
com::xiaonei::xce::QueryRunner(DB_MEMBERS, com::xiaonei::xce::CDbWServer).query(sql, handler);
if (id != result->iconId)
{
MCE_WARN("Icon2UrlDataWriterI::createIcon2UrlData , Exception NoSuchIcon2UrlData id = " << id);
return;
}
xce::adapter::icon2urldata::Icon2UrlDataReaderAdapter::instance().setData(id, result);
}
}
示例12: deliverWebpager
void DispatchManagerI::deliverWebpager(const MyUtil::Str2StrMap& props,
const Ice::Current&) {
if (!SchemaManager::instance().checkDispatch(props)) {
MCE_WARN("DispatchManagerI::deliverWebpager illegal input");
return;
}
Ice::Long nid = createNotifyId();
MCE_INFO("DispatchManagerI::deliverWebpager nid=" << nid << " to=" << props.find("to")->second);
Ice::Long server_index = GetServreIndex(nid, props);
try {
NotifyDispatcherNAdapter::instance().dispatchN(server_index, nid, false, props);
} catch(Ice::Exception& e) {
MCE_WARN("NotifyDispatcherNAdapter error : " << e);
}
}
示例13: setHatData
void HatDataWriterI::setHatData(Ice::Int id, const MyUtil::Str2StrMap& props, const Ice::Current & current)
{
std::ostringstream inMsg;
inMsg<<"id = "<<id;
MyUtil::InvokeClient ic = MyUtil::InvokeClient::create(current, inMsg.str(), MyUtil::InvokeClient::INVOKE_LEVEL_INFO);
//去掉map中的用户id
MyUtil::Str2StrMap::iterator it = const_cast<MyUtil::Str2StrMap&>(props).find("ID");
if(it!=props.end())
{
const_cast<MyUtil::Str2StrMap&>(props).erase(it);
}
MyUtil::Str2StrMap filter;
filter["id"] = boost::lexical_cast<string>(id);
{
xce::tempmutex::Lock lock(_tempMutexManager,id);
com::xiaonei::xce::QueryRunner(DB_MEMBERS,com::xiaonei::xce::CDbWServer).execute(com::xiaonei::xce::Statement::buildUpdate(TABLE_HAT, filter, props));
xce::adapter::hatdata::HatDataReaderAdapter::instance().setHatData(id,props);
}
}
示例14:
UserConfigInfoPtr xce::adapter::UserConfigInfo::parse(const MyUtil::Str2StrMap& data) {
Str2StrMap::const_iterator i;
i = data.find("ID");
if (i != data.end()) {
userId_ = boost::lexical_cast<int>(i->second);
}
i = data.find("BASIC_CONFIG");
if (i != data.end()) {
basicConfig_ = boost::lexical_cast<int>(i->second);
}
i = data.find("POKE_CONFIG");
if (i != data.end()) {
pokeConfig_ = boost::lexical_cast<int>(i->second);
}
i = data.find("REQUEST_FRIEND_CONFIG");
if (i != data.end()) {
requestFriendConfig_ = boost::lexical_cast<int>(i->second);
}
i = data.find("PHOTO_CONFIG");
if (i != data.end()) {
photoConfig_ = boost::lexical_cast<int>(i->second);
}
i = data.find("MESSAGE_CONFIG");
if (i != data.end()) {
messageConfig_ = boost::lexical_cast<int>(i->second);
}
i = data.find("EMAIL_CONFIG");
if (i != data.end()) {
emailConfig_ = boost::lexical_cast<long>(i->second);
}
i = data.find("BROWSE_CONFIG");
if (i != data.end()) {
browseConfig_ = boost::lexical_cast<int>(i->second);
}
i = data.find("RECV_FEED_CONFIG");
if (i != data.end()) {
recvFeedConfig_ = i->second;
}
i = data.find("SEND_FEED_CONFIG");
if (i != data.end()) {
sendFeedConfig_ = i->second;
}
i = data.find("WANT_SEE_CSS");
if (i != data.end()) {
wantSeeCss_ = boost::lexical_cast<short>(i->second);
}
i = data.find("DISPLAY_MENU_LIST");
if (i != data.end()) {
displayMenuList_ = i->second;
}
i = data.find("MORE_MENU_LIST");
if (i != data.end()) {
moreMenuList_ = i->second;
}
i = data.find("PROFILE_PRIVACY");
if (i != data.end()) {
profilePrivacy_ = i->second;
}
i = data.find("STATUS_CONFIG");
if (i != data.end()) {
statusConfig_ = boost::lexical_cast<int>(i->second);
}
return this;
}
示例15: dispatch
void DispatchManagerI::dispatch(const MyUtil::Str2StrMap& props,
const Ice::Current& cur) {
TimeStat ts;
if (!SchemaManager::instance().checkDispatch(props)) {
MCE_WARN("DispatchManagerI::dispatch illegal input");
return;
}
if(props.find("type")->second == "213"){
MCE_WARN("type = 213. not send. " << GetIp(cur));
return ;
}
Ice::Int from_uid = 0;
try {
from_uid = boost::lexical_cast<Ice::Int>(props.find("from")->second);
} catch (boost::bad_lexical_cast & e) {
return;
}
// TODO 取消注释
// UserPassportDataPtr data = UserPassportAdapter::instance().getUserPassport(from_uid);
// if (data && (data->safeStatus & 0x07C0)) {
// MCE_INFO("user blocked : " << from_uid);
// return;
// }
UserPassportInfoPtr data;
try {
data = UserPassportAdapter::instance().getUserPassport(from_uid);
} catch(Ice::Exception& e) {
MCE_WARN("NotifyDispatcherNAdapter call UserPassportAdapter from id " << from_uid <<" error : " << e);
}
if (data && (data->safestatus() & 0x07C0)) {
MCE_WARN("user blocked : " << from_uid);
return;
}
Ice::Long nid = createNotifyId();
Ice::Long server_index = GetServreIndex(nid, props);
try {
NotifyDispatcherNAdapter::instance().dispatchN(server_index, nid, true, props);
} catch(Ice::Exception& e) {
MCE_WARN("NotifyDispatcherNAdapter error : " << e);
}
MyUtil::Str2StrMap::const_iterator it = props.find("tominigroup");
string groups = "NULL";
if(it != props.end()){
groups = it->second;
}
MCE_INFO("DispatchManagerI::dispatch nid:" << nid
<< " to:" << props.find("to")->second
<< " schema:" << props.find("schema_id")->second
<< " type:" << props.find("type")->second
<< " from:" << props.find("from")->second
<< " idx:" << server_index
<< " tog:" << groups
<< " cost:" << ts.getTime()
<< " " << GetIp(cur)
);
}