本文整理汇总了C++中test::Hello_var::orb_core方法的典型用法代码示例。如果您正苦于以下问题:C++ Hello_var::orb_core方法的具体用法?C++ Hello_var::orb_core怎么用?C++ Hello_var::orb_core使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test::Hello_var
的用法示例。
在下文中一共展示了Hello_var::orb_core方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
try
{
CORBA::ORB_var orb =
CORBA::ORB_init (argc, argv, "test");
if (parse_args (argc, argv) != 0)
return 1;
CORBA::Object_var tmp = orb->string_to_object(ior);
if (CORBA::is_nil (tmp.in ()))
{
ACE_ERROR_RETURN ((LM_ERROR, "Invalid IOR.\n")
,1);
}
{
// Set the Synch Scopes
CORBA::Any scope_as_any;
if (synch_none == true)
{
ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Applying SYNC_NONE.\n"));
scope_as_any <<= Messaging::SYNC_NONE;
}
else if (synch_delayed == true)
{
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) - Applying SYNC_DELAYED_BUFFERING.\n"));
scope_as_any <<= TAO::SYNC_DELAYED_BUFFERING;
}
CORBA::PolicyList policies (1);
policies.length (1);
policies[0] =
orb->create_policy (Messaging::SYNC_SCOPE_POLICY_TYPE,
scope_as_any);
if (level_thread == true)
{
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) - Applying Synch Scope at thread level.\n"));
CORBA::Object_var object =
orb->resolve_initial_references ("PolicyCurrent");
CORBA::PolicyCurrent_var policy_current =
CORBA::PolicyCurrent::_narrow (object.in ());
policy_current->set_policy_overrides (policies,
CORBA::ADD_OVERRIDE);
}
else if (level_orb == true)
{
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) - Applying Synch Scope at orb level.\n"));
CORBA::Object_var obj =
orb->resolve_initial_references("ORBPolicyManager");
CORBA::PolicyManager_var policy_manager =
CORBA::PolicyManager::_narrow(obj.in());
policy_manager->set_policy_overrides (policies,
CORBA::ADD_OVERRIDE);
}
else if (level_obj == true)
{
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) - Applying Synch Scope at Object level.\n"));
tmp = tmp->_set_policy_overrides (policies, CORBA::SET_OVERRIDE);
}
policies[0]->destroy ();
}
Test::Hello_var hello =
Test::Hello::_narrow(tmp.in ());
if (CORBA::is_nil (hello.in ()))
{
ACE_ERROR_RETURN ((LM_ERROR,
"Nil Test::Hello reference <%s>\n",
ior),
1);
}
// If a blocking connection is initiated in the next step
// the test will get an exception indicating test failure.
// Be sure you IOR is for the localhost endpoint, else
// grab a book and wait around for timeout.
hello->get_string ();
TAO::Transport_Cache_Manager &tcm =
hello->orb_core ()->lane_resources ().transport_cache ();
TAO_Base_Transport_Property desc (hello->_stubobj ()->profile_in_use ()->endpoint ());
//.........这里部分代码省略.........