本文整理汇总了C++中portableserver::POA_var::_retn方法的典型用法代码示例。如果您正苦于以下问题:C++ POA_var::_retn方法的具体用法?C++ POA_var::_retn怎么用?C++ POA_var::_retn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableserver::POA_var
的用法示例。
在下文中一共展示了POA_var::_retn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: policies
PortableServer::POA_ptr
ServerApp::create_poa(CORBA::ORB_ptr orb,
const char* poa_name)
{
// Get the Root POA.
PortableServer::POA_var root_poa
= RefHelper<PortableServer::POA>::resolve_initial_ref(orb,
"RootPOA");
// Get the POAManager from the Root POA.
PortableServer::POAManager_var poa_manager
= root_poa->the_POAManager();
// Create the child POA Policies.
CORBA::PolicyList policies(0);
policies.length(0);
// Create the child POA
PortableServer::POA_var poa = AppHelper::create_poa(poa_name,
root_poa.in(),
poa_manager.in(),
policies);
// Give away the child POA_ptr from the POA_var variable.
return poa._retn();
}
示例2:
PortableServer::POA_ptr
createPOA (PortableServer::POA_ptr root_poa,
bool share_mgr,
const char* poa_name)
{
PortableServer::LifespanPolicy_var life =
root_poa->create_lifespan_policy(PortableServer::PERSISTENT);
PortableServer::IdAssignmentPolicy_var assign =
root_poa->create_id_assignment_policy(PortableServer::USER_ID);
CORBA::PolicyList pols;
pols.length(2);
pols[0] = PortableServer::LifespanPolicy::_duplicate(life.in());
pols[1] = PortableServer::IdAssignmentPolicy::_duplicate(assign.in());
PortableServer::POAManager_var mgr = PortableServer::POAManager::_nil();
if (share_mgr)
{
mgr = root_poa->the_POAManager();
}
PortableServer::POA_var poa =
root_poa->create_POA(poa_name, mgr.in(), pols);
life->destroy();
assign->destroy();
return poa._retn();
}
示例3: throw
PortableServer::POA_ptr
VOmniORBHelper::poaGetOrCreatePoa(const char* program, const char* object,
int telescopenumber)
throw(CORBA::SystemException)
{
ZThread::Guard<ZThread::RecursiveMutex> guard(m_mutex);
// Munge the path name into a unique POA name
char* poa_name = poaPathToPoaName(program, object, telescopenumber);
// Check to see if we created this one already, if so then return it now
std::map<std::string,PortableServer::POA_var>::iterator poaFound =
m_poaMap.find(poa_name);
if(poaFound != m_poaMap.end())
return PortableServer::POA::_duplicate(poaFound->second);
// Grab the root POA
PortableServer::POA_var root_poa = poaRootPoa();
// Must create the POA, use the PERSISTENT and USER_ID policies
PortableServer::LifespanPolicy_var lifespan =
root_poa -> create_lifespan_policy(PortableServer::PERSISTENT);
PortableServer::IdAssignmentPolicy_var assign =
root_poa -> create_id_assignment_policy(PortableServer::USER_ID);
CORBA::PolicyList policy_list;
policy_list.length(2);
policy_list[0] = PortableServer::LifespanPolicy::_duplicate(lifespan);
policy_list[1] = PortableServer::IdAssignmentPolicy::_duplicate(assign);
// Root POA manager
PortableServer::POAManager_var root_poa_manager =
PortableServer::POAManager::_duplicate(m_rootPoaManager);
// Create the POA
PortableServer::POA_var poa =
root_poa -> create_POA(poa_name, root_poa_manager, policy_list);
// Make a copy of the POA object and remember it in case we are asked
// for it again some time
m_poaMap[poa_name] = PortableServer::POA::_duplicate(poa);
CORBA::string_free(poa_name);
lifespan->destroy();
assign->destroy();
return poa._retn();
}
示例4: GCServantLocator
PortableServer::POA_ptr ossie::corba::createGCPOA(PortableServer::POA_ptr parent, const std::string& name)
{
CORBA::PolicyList policy_list;
policy_list.length(2);
policy_list[0] = parent->create_servant_retention_policy(PortableServer::NON_RETAIN);
policy_list[1] = parent->create_request_processing_policy(PortableServer::USE_SERVANT_MANAGER);
PortableServer::POAManager_var poa_mgr = parent->the_POAManager();
PortableServer::POA_var poa = parent->create_POA(name.c_str(), poa_mgr, policy_list);
for (size_t ii = 0; ii < policy_list.length(); ++ii) {
policy_list[ii]->destroy();
}
GCServantLocator* manager = new GCServantLocator();
PortableServer::ServantManager_var manager_ref = manager->_this();
poa->set_servant_manager(manager_ref);
manager->_remove_ref();
return poa._retn();
}