本文整理汇总了C++中ice::ObjectPrxPtr::ice_getIdentity方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPrxPtr::ice_getIdentity方法的具体用法?C++ ObjectPrxPtr::ice_getIdentity怎么用?C++ ObjectPrxPtr::ice_getIdentity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ice::ObjectPrxPtr
的用法示例。
在下文中一共展示了ObjectPrxPtr::ice_getIdentity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sync
void
IceInternal::RouterInfo::addAndEvictProxies(const Ice::ObjectPrxPtr& proxy, const Ice::ObjectProxySeq& evictedProxies)
{
IceUtil::Mutex::Lock sync(*this);
//
// Check if the proxy hasn't already been evicted by a concurrent addProxies call.
// If it's the case, don't add it to our local map.
//
multiset<Identity>::iterator p = _evictedIdentities.find(proxy->ice_getIdentity());
if(p != _evictedIdentities.end())
{
_evictedIdentities.erase(p);
}
else
{
//
// If we successfully added the proxy to the router,
// we add it to our local map.
//
_identities.insert(proxy->ice_getIdentity());
}
//
// We also must remove whatever proxies the router evicted.
//
for(Ice::ObjectProxySeq::const_iterator q = evictedProxies.begin(); q != evictedProxies.end(); ++q)
{
if(_identities.erase((*q)->ice_getIdentity()) == 0)
{
//
// It's possible for the proxy to not have been
// added yet in the local map if two threads
// concurrently call addProxies.
//
_evictedIdentities.insert((*q)->ice_getIdentity());
}
}
}
示例2: assert
bool
IceInternal::RouterInfo::addProxy(const Ice::ObjectPrxPtr& proxy, const AddProxyCallbackPtr& callback)
{
assert(proxy);
{
IceUtil::Mutex::Lock sync(*this);
if(_identities.find(proxy->ice_getIdentity()) != _identities.end())
{
//
// Only add the proxy to the router if it's not already in our local map.
//
return true;
}
}
Ice::ObjectProxySeq proxies;
proxies.push_back(proxy);
AddProxyCookiePtr cookie = new AddProxyCookie(callback, proxy);
#ifdef ICE_CPP11_MAPPING
RouterInfoPtr self = this;
_router->addProxies_async(proxies,
[self, cookie](const Ice::ObjectProxySeq& proxies)
{
self->addProxyResponse(proxies, cookie);
},
[self, cookie](exception_ptr e)
{
try
{
rethrow_exception(e);
}
catch(const Ice::Exception& ex)
{
self->addProxyException(ex, cookie);
}
});
#else
_router->begin_addProxies(proxies,
newCallback_Router_addProxies(this,
&RouterInfo::addProxyResponse,
&RouterInfo::addProxyException),
cookie);
#endif
return false;
}
示例3:
void
ServerLocatorRegistry::addObject(const Ice::ObjectPrxPtr& object)
{
_objects[object->ice_getIdentity()] = object;
}