本文整理汇总了C++中corba::Any_var::out方法的典型用法代码示例。如果您正苦于以下问题:C++ Any_var::out方法的具体用法?C++ Any_var::out怎么用?C++ Any_var::out使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::Any_var
的用法示例。
在下文中一共展示了Any_var::out方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
Plugin_Configurator::deploy_plan (::Deployment::DeploymentPlan &plan)
{
DANCE_TRACE ("Plugin_Configurator::deploy_plan");
DAnCE::Inst_Handler_Impl inst_handler;
DAnCE::Interceptor_Handler_Impl interceptor_handler;
DAnCE::Config_Handler_Impl config_handler;
for (CORBA::ULong i = 0; i < plan.instance.length (); ++i)
{
if (plan.instance[i].implementationRef >= plan.implementation.length ())
{
DANCE_ERROR (DANCE_LOG_ERROR,
(LM_ERROR, DLINFO
ACE_TEXT ("Plugin_Configurator::deploy_plan - ")
ACE_TEXT ("Invalid implementationRef for instance <%C>\n"),
plan.instance[i].name.in ()));
continue;
}
::Deployment::MonolithicDeploymentDescription &mdd =
plan.implementation[plan.instance[i].implementationRef];
CORBA::String_var inst_type =
DAnCE::Utility::get_instance_type (mdd.execParameter);
if (ACE_OS::strcmp (inst_type.in (),
DAnCE::DANCE_INSTALLATIONHANDLER) == 0)
{
CORBA::Any_var any;
inst_handler.install_instance (plan, i, any.out ());
}
else if (ACE_OS::strcmp (inst_type.in (),
DAnCE::DANCE_DEPLOYMENTINTERCEPTOR) == 0)
{
CORBA::Any_var any;
interceptor_handler.install_instance (plan, i, any.out ());
}
else if (ACE_OS::strcmp (inst_type.in (),
DAnCE::DANCE_CONFIGPLUGIN) == 0)
{
CORBA::Any_var any;
config_handler.install_instance (plan, i, any.out ());
}
}
}
示例2: ACE_TMAIN
// ------------------------------------------------------------
// Client
// ------------------------------------------------------------
int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
int error_count = 0;
try
{
// Init the orb
CORBA::ORB_var orb= CORBA::ORB_init (argc, argv);
// Get IOR from command line (or file)
if (parse_args (argc, argv) != 0)
return 1;
// The first arg should be the IOR
CORBA::Object_var object =
orb->string_to_object (ior);
// Get the server
simple_var server = simple::_narrow (object.in ());
const char *bare_string = "Hello World";
const char *any_string = "Any World";
CORBA::Any inarg;
inarg <<= any_string;
CORBA::Any_var outarg;
// Invoke the call.
CORBA::String_var reply =
server->op1 (bare_string,
inarg,
outarg.out ());
const char *any_reply;
outarg >>= any_reply;
ACE_DEBUG ((LM_DEBUG,
"Client sent %C, got %C\n", bare_string, reply.in ()) );
if (ACE_OS::strcmp (bare_string, reply.in ()) != 0)
{
++error_count;
}
ACE_DEBUG ((LM_DEBUG,
"Client sent %C, got %C\n", any_string, any_reply) );
if (ACE_OS::strcmp (any_string, any_reply) != 0)
{
++error_count;
}
#if defined (ACE_HAS_WCHAR)
wchar_t *wide_string = ACE_OS::strdup(ACE_TEXT_ALWAYS_WCHAR(ACE_TEXT ("Wide String")));
wchar_t *wide_reply = server->op2 (wide_string);
ACE_DEBUG ((LM_DEBUG,
"sent %W, got %W\n", wide_string, wide_reply));
ACE_OS::free (wide_string);
CORBA::wstring_free (wide_reply);
#endif /* ACE_HAS_WCHAR */
server->shutdown ();
orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("Exception caught in client:");
return 1;
}
return error_count;
}