本文整理汇总了C++中ice::ObjectProxySeq::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectProxySeq::push_back方法的具体用法?C++ ObjectProxySeq::push_back怎么用?C++ ObjectProxySeq::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ice::ObjectProxySeq
的用法示例。
在下文中一共展示了ObjectProxySeq::push_back方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
bool
IceInternal::RouterInfo::addProxy(const Ice::ObjectPrx& 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);
_router->begin_addProxies(proxies,
newCallback_Router_addProxies(this,
&RouterInfo::addProxyResponse,
&RouterInfo::addProxyException),
cookie);
return false;
}
示例2: ObjectProxySeq
Ice::ObjectProxySeq
QueryI::findAllReplicas(const Ice::ObjectPrx& proxy, const Ice::Current&) const
{
if(!proxy)
{
return Ice::ObjectProxySeq();
}
//
// If the given proxy has an empty adapter id, we check if it's a
// well-known object. If it's a well-known object we use the
// registered proxy instead.
//
Ice::ObjectPrx prx = proxy;
if(prx->ice_getAdapterId().empty())
{
try
{
ObjectInfo info = _database->getObjectInfo(prx->ice_getIdentity());
prx = info.proxy;
}
catch(const ObjectNotRegisteredException&)
{
return Ice::ObjectProxySeq();
}
}
try
{
AdapterInfoSeq infos = _database->getAdapterInfo(prx->ice_getAdapterId());
if(infos.empty() || infos[0].replicaGroupId != prx->ice_getAdapterId())
{
// The adapter id doesn't refer to a replica group or the replica group is empty.
return Ice::ObjectProxySeq();
}
Ice::ObjectProxySeq proxies;
for(AdapterInfoSeq::const_iterator p = infos.begin(); p != infos.end(); ++p)
{
assert(!p->id.empty());
proxies.push_back(prx->ice_adapterId(p->id));
}
return proxies;
}
catch(const AdapterNotExistException&)
{
return Ice::ObjectProxySeq();
}
}
示例3: 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;
}
示例4: sync
Ice::ObjectProxySeq
ObjectCache::getObjectsByType(const string& type)
{
Lock sync(*this);
Ice::ObjectProxySeq proxies;
map<string, TypeEntry>::const_iterator p = _types.find(type);
if(p == _types.end())
{
return proxies;
}
const vector<ObjectEntryPtr>& objects = p->second.getObjects();
for(vector<ObjectEntryPtr>::const_iterator q = objects.begin(); q != objects.end(); ++q)
{
proxies.push_back((*q)->getProxy());
}
return proxies;
}