本文整理汇总了C++中test::Hello_var::_stubobj方法的典型用法代码示例。如果您正苦于以下问题:C++ Hello_var::_stubobj方法的具体用法?C++ Hello_var::_stubobj怎么用?C++ Hello_var::_stubobj使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test::Hello_var
的用法示例。
在下文中一共展示了Hello_var::_stubobj方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: owner_transfer
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
int status = 0;
try
{
CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
CORBA::Object_var poa_object =
orb->resolve_initial_references("RootPOA");
PortableServer::POA_var root_poa =
PortableServer::POA::_narrow (poa_object.in ());
if (CORBA::is_nil (root_poa.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
" (%P|%t) Panic: nil RootPOA\n"),
1);
Hello *hello_impl;
ACE_NEW_RETURN (hello_impl,
Hello,
1);
PortableServer::ServantBase_var owner_transfer(hello_impl);
PortableServer::ObjectId_var id =
root_poa->activate_object (hello_impl);
CORBA::Object_var obj = root_poa->id_to_reference (id.in ());
Test::Hello_var hello = Test::Hello::_narrow (obj.in ());
Filter_Localhost filter;
obj = filter.sanitize_profiles (hello.in ());
Test::Hello_var after = Test::Hello::_narrow(obj.in());
if (hello->_stubobj ()->base_profiles ().profile_count () ==
after->_stubobj ()->base_profiles ().profile_count ())
{
ACE_ERROR ((LM_ERROR,
"ERROR: profiles were not correctly filtered\n"));
status++;
}
root_poa->destroy (1, 1);
orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("Exception caught:");
status++;
}
return status;
}
示例2: 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 ());
//.........这里部分代码省略.........