本文整理汇总了C++中UserConnection::removeSubject方法的典型用法代码示例。如果您正苦于以下问题:C++ UserConnection::removeSubject方法的具体用法?C++ UserConnection::removeSubject怎么用?C++ UserConnection::removeSubject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserConnection
的用法示例。
在下文中一共展示了UserConnection::removeSubject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
void usubRequest::operator()(const SubscriptionLib::UsubRequest& req){
UserConnection * user = Users::getInstance()->getUser(req.getLogin());
Subscription * subs = SubList::getInstance()->getSubscription(req.getSubId());
if(user!=NULL && subs!=NULL &&socket_==user->getsocket() && user->isContainsSubject(subs)){
user->removeSubject(subs);
subs->removeObserver(user);
SubscriptionLib::UsubResponse response(0, std::string("USubs operation was succeed"));
MsgSender::deliver(response, user->getsocket());
}else{;
SubscriptionLib::UsubResponse response(1, std::string("User is not authorized |subscription with specified id is not exist | user is not subscribe this subscription"));
MsgSender::deliver(response, socket_);
}
}