本文整理汇总了C++中corba::ORB_ptr::id方法的典型用法代码示例。如果您正苦于以下问题:C++ ORB_ptr::id方法的具体用法?C++ ORB_ptr::id怎么用?C++ ORB_ptr::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::ORB_ptr
的用法示例。
在下文中一共展示了ORB_ptr::id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: safe_svt
CORBA::Object_ptr
DAnCE_TargetManager_Module::init (CORBA::ORB_ptr orb,
int argc,
ACE_TCHAR *argv[])
{
DANCE_TRACE ("DAnCE_TargetManager_Module::init");
try
{
if (CORBA::is_nil(orb))
{
DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR, (LM_ERROR, DLINFO ACE_TEXT ("DAnCE_TargetManager_Module::init - ")
ACE_TEXT ("Attempted to create Target Manager with a nil orb.\n")));
return CORBA::Object::_nil();
}
else
{
this->orb_ = CORBA::ORB::_duplicate (orb);
}
if (ACE_OS::strcmp(orb->id(), this->orb_->id()) != 0)
{
DANCE_TRACE_LOG (DANCE_LOG_TRACE, (LM_TRACE, DLINFO ACE_TEXT ("DAnCE_TargetManager_Module::init - ")
ACE_TEXT ("Resetting TM's orb.\n")));
this->orb_ = CORBA::ORB::_duplicate (orb);
this->domain_nc_ = CosNaming::NamingContext::_nil();
}
if (!this->parse_args (argc, argv))
{
return CORBA::Object::_nil ();
}
this->create_poas ();
if (this->options_.domain_nc_)
{
try
{
DANCE_TRACE_LOG (DANCE_LOG_TRACE, (LM_TRACE, DLINFO ACE_TEXT ("DAnCE_TargetManager_Module::init - ")
ACE_TEXT ("Resolving DomainNC.\n")));
CORBA::Object_var domain_obj = this->orb_->string_to_object (this->options_.domain_nc_);
if (!CORBA::is_nil (domain_obj.in ()))
{
this->domain_nc_ = CosNaming::NamingContext::_narrow (domain_obj.in());
if (CORBA::is_nil (this->domain_nc_.in ()))
{
DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR, (LM_ERROR,DLINFO ACE_TEXT ("DAnCE_TargetManager_Module::init - ")
ACE_TEXT ("Narrow to NamingContext return nil for DomainNC.\n")));
return CORBA::Object::_nil ();
}
}
}
catch (CORBA::Exception&)
{
DANCE_DEBUG (DANCE_LOG_ERROR,
(LM_WARNING, DLINFO ACE_TEXT ("DAnCE_TargetManager_Module::init - ")
ACE_TEXT ("DomainNC context not found!\n")));
}
}
DANCE_TRACE_LOG (DANCE_LOG_TRACE, (LM_TRACE, DLINFO ACE_TEXT ("DAnCE_TargetManager_Module::init - ")
ACE_TEXT ("Initializing the IOR Table\n")));
// Initialize IOR table
CORBA::Object_var table_object = orb->resolve_initial_references ("IORTable");
IORTable::Table_var adapter = IORTable::Table::_narrow (table_object.in ());
if (CORBA::is_nil (adapter.in ()))
{
DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR, (LM_ERROR, DLINFO ACE_TEXT ("DAnCE_TargetManager_Module::init - ")
ACE_TEXT ("Unable to RIR the IORTable.\n")));
return CORBA::Object::_nil ();
}
//Creating repository manager servant
DAnCE::TargetManagerDaemon_i * rm = new DAnCE::TargetManagerDaemon_i (orb);
PortableServer::ServantBase_var safe_svt (rm);
ACE_CString repository_manager_oid;
if (this->options_.name_ == 0)
{
repository_manager_oid = "TargetManager";
}
else
{
repository_manager_oid = ACE_TEXT_ALWAYS_CHAR (this->options_.name_);
repository_manager_oid += ".TargetManager";
}
// Registering servant in poa
PortableServer::ObjectId_var oid =
PortableServer::string_to_ObjectId (repository_manager_oid.c_str());
this->rm_poa_->activate_object_with_id (oid, rm);
// Getting repository manager ior
//.........这里部分代码省略.........
示例2: if
CORBA::Object_ptr
DAnCE_NodeManager_Module::init (CORBA::ORB_ptr orb,
int argc,
ACE_TCHAR *argv[])
{
try
{
if (CORBA::is_nil(orb))
{
DANCE_ERROR (DANCE_LOG_EMERGENCY,
(LM_ERROR, DLINFO
ACE_TEXT("DAnCE_NodeManager_Module::init - ")
ACE_TEXT("Attempted to create Node Manager with a nil orb.\n")));
return CORBA::Object::_nil();
}
if (CORBA::is_nil(this->orb_.in()))
{
DANCE_TRACE_LOG (DANCE_LOG_DETAILED_TRACE,
(LM_TRACE, DLINFO ACE_TEXT("DAnCE_NodeManager_Module::init - ")
ACE_TEXT("NM's orb is nil.\n")));
this->orb_ = CORBA::ORB::_duplicate (orb);
}
else if (ACE_OS::strcmp(orb->id(), this->orb_->id()) != 0)
{
DANCE_DEBUG (DANCE_LOG_DETAILED_TRACE,
(LM_TRACE, DLINFO
ACE_TEXT("DAnCE_NodeManager_Module::init - ")
ACE_TEXT("Resetting NM's orb.\n")));
this->orb_ = CORBA::ORB::_duplicate (orb);
this->domain_nc_ = CosNaming::NamingContext::_nil();
}
if (!this->parse_args (argc, argv))
{
DANCE_ERROR (DANCE_LOG_EMERGENCY,
(LM_ERROR, DLINFO
ACE_TEXT("DAnCE_NodeManager_Module::init - ")
ACE_TEXT("Unable to parse the commandline arguments.\n")));
return CORBA::Object::_nil ();
}
this->register_value_factories ();
this->create_poas ();
if (this->options_.domain_nc_)
{
try
{
DANCE_TRACE_LOG (DANCE_LOG_TRACE,
(LM_TRACE, DLINFO ACE_TEXT("DAnCE_NodeManager_Module::init - ")
ACE_TEXT("Resolving DomainNC.\n")));
CORBA::Object_var domain_obj = this->orb_->string_to_object (this->options_.domain_nc_);
if (!CORBA::is_nil (domain_obj.in ()))
{
this->domain_nc_ = CosNaming::NamingContext::_narrow (domain_obj.in());
if (CORBA::is_nil (this->domain_nc_.in ()))
{
DANCE_ERROR (DANCE_LOG_EMERGENCY,
(LM_ERROR, DLINFO
ACE_TEXT("DAnCE_NodeManager_Module::init - ")
ACE_TEXT("Narrow to NamingContext return nil for DomainNC.\n")));
return CORBA::Object::_nil ();
}
}
}
catch (const CORBA::Exception&)
{
DANCE_ERROR (DANCE_LOG_WARNING, (LM_WARNING, DLINFO
ACE_TEXT("DAnCE_NodeManager_Module::init - ")
ACE_TEXT("DomainNC context not found!\n")));
}
}
DANCE_TRACE_LOG (DANCE_LOG_TRACE,
(LM_TRACE, DLINFO
ACE_TEXT("DAnCE_NodeManager_Module::init - ")
ACE_TEXT("Resolving plan NS naming context.\n")));
CosNaming::NamingContext_var rebind_nc;
if (this->options_.rebind_plan_ns_)
{
if (!this->options_.create_plan_ns_)
{
DANCE_ERROR (DANCE_LOG_EMERGENCY,
(LM_ERROR, DLINFO
ACE_TEXT ("DAnCE_NodeManager_Module::init - ")
ACE_TEXT ("Rebind_plan_ns option is enabled but Create_plan_ns is not.\n")));
return CORBA::Object::_nil();
}
CORBA::Object_var tmp_obj;
if (0 != this->options_.rebind_plan_ns_ior_)
{
tmp_obj = orb->string_to_object (this->options_.rebind_plan_ns_ior_);
rebind_nc = CosNaming::NamingContext::_narrow (tmp_obj);
}
else
{
if (CORBA::is_nil (this->domain_nc_.in ()))
{
//.........这里部分代码省略.........