本文整理汇总了C++中Bindings::find方法的典型用法代码示例。如果您正苦于以下问题:C++ Bindings::find方法的具体用法?C++ Bindings::find怎么用?C++ Bindings::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bindings
的用法示例。
在下文中一共展示了Bindings::find方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
std::vector<std::string> SubscriberManager::subscriptions_to_remove(const Bindings& orig_bindings,
const Subscriptions& orig_subscriptions,
const Bindings& bindings_to_update,
const std::vector<std::string> binding_ids_to_remove)
{
std::vector<std::string> subscription_ids_to_remove;
std::set<std::string> missing_uris;
// Store off the contact URIs of bindings to be removed. Any subscriptions
// sharing any of these contact URIs will be removed.
for (std::string binding_id : binding_ids_to_remove)
{
Bindings::const_iterator b = orig_bindings.find(binding_id);
if (b != orig_bindings.end())
{
missing_uris.insert(b->second->_uri);
}
}
// Store off the original contact URI of bindings where the contact is about
// to be changed. Any subscriptions that share any of the original contact
// URIs will be removed.
for (BindingPair bp : bindings_to_update)
{
Bindings::const_iterator b = orig_bindings.find(bp.first);
if ((b != orig_bindings.end()) &&
(b->second->_uri != bp.second->_uri))
{
missing_uris.insert(b->second->_uri);
}
}
// Loop over the subscriptions. If any have the same contact as one of the
// missing URIs, the subscription should be removed.
for (SubscriptionPair sp : orig_subscriptions)
{
if (missing_uris.find(sp.second->_req_uri) != missing_uris.end())
{
TRC_DEBUG("Subscription %s is being removed because the binding that shares"
" its contact URI %s is being removed or changing contact URI",
sp.first.c_str(),
sp.second->_req_uri.c_str());
subscription_ids_to_remove.push_back(sp.first);
}
}
return subscription_ids_to_remove;
}