本文整理汇总了C++中ACE_Argv_Type_Converter::get_ASCII_argv方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_Argv_Type_Converter::get_ASCII_argv方法的具体用法?C++ ACE_Argv_Type_Converter::get_ASCII_argv怎么用?C++ ACE_Argv_Type_Converter::get_ASCII_argv使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACE_Argv_Type_Converter
的用法示例。
在下文中一共展示了ACE_Argv_Type_Converter::get_ASCII_argv方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ACE_TMAIN
int ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
Aggregator manager;
try
{
ACE_Argv_Type_Converter converter (argc, argv);
// Initilaize the ORB, POA etc.
manager.init (converter.get_argc(), converter.get_ASCII_argv());
// the command line arguments
if (parse_args (argc, argv) == -1)
return -1;
// Merge the different IORS
manager.make_merged_iors ();
// Set properties. This is the most important portion of the
// test
manager.set_properties ();
// Write IOR to file
manager.write_to_file ();
}
catch (const CORBA::Exception& e)
{
e._tao_print_exception(ACE_TEXT("Caught"));
return -1;
}
return 0;
}
示例2: testQtReactor
void testQtReactor (int argc, ACE_TCHAR *argv[])
{
// Qt specific code
ACE_DEBUG ((LM_INFO, ACE_TEXT ("Testing QtReactor\n")));
ACE_Argv_Type_Converter ct (argc, argv);
QTestApplication app (argc, ct.get_ASCII_argv ());
ACE_QtReactor qtReactor (&app);
ACE_Reactor reactor (&qtReactor);
HandlersRegister handlersRegister (&reactor);
ACE_Time_Value testTime (TotalTestTime / 1000, (TotalTestTime % 1000) * 1000);
if (0 <= handlersRegister.scheduleTimers (testTime) &&
0 <= handlersRegister.registerDgramHandlers () &&
0 <= handlersRegister.registerTCPHandlers ())
{
app.exec (TotalTestTime);
if (0 != handlersRegister.analyze ())
ACE_ERROR ((LM_ERROR, ACE_TEXT ("QtReactor_Test failed.\n")));
else
ACE_ERROR ((LM_INFO, ACE_TEXT ("QtReactor_Test passed.\n")));
}
}
示例3: ACE_TMAIN
// main entry point
int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
ACE_Argv_Type_Converter atc (argc, argv);
walkapp get (atc.get_argc (), atc.get_ASCII_argv ());
if (get.valid())
return get.run();
else
walkapp::usage();
return 1;
}
示例4: conv
void
SubDriver::init(int& argc, ACE_TCHAR* argv[])
{
// initialize the orb
ACE_Argv_Type_Converter conv (argc, argv);
orb_ = CORBA::ORB_init (conv.get_argc (),
conv.get_ASCII_argv (),
OpenDDS::DCPS::DEFAULT_ORB_NAME);
TheServiceParticipant->set_ORB (orb_.in());
OpenDDS::DCPS::TransportImpl_rch transport_impl
= TheTransportFactory->create_transport_impl (ALL_TRAFFIC, ACE_TEXT("SimpleTcp"), OpenDDS::DCPS::DONT_AUTO_CONFIG);
OpenDDS::DCPS::TransportConfiguration_rch config
= TheTransportFactory->create_configuration (ALL_TRAFFIC, ACE_TEXT("SimpleTcp"));
OpenDDS::DCPS::SimpleTcpConfiguration* tcp_config
= static_cast <OpenDDS::DCPS::SimpleTcpConfiguration*> (config.in ());
tcp_config->local_address_ = this->sub_addr_;
tcp_config->local_address_str_ = this->sub_addr_str_;
if (transport_impl->configure(config.in ()) != 0)
{
ACE_ERROR((LM_ERROR,
"(%P|%t) Failed to configure the transport impl\n"));
throw TestException();
}
// Indicate that the subscriber is ready to accept connection
FILE* readers_ready = ACE_OS::fopen (sub_ready_filename_.c_str (), ACE_TEXT("w"));
if (readers_ready == 0)
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT("(%P|%t) ERROR: Unable to create subscriber ready file\n")));
}
else
ACE_OS::fclose(readers_ready);
// And we are done with the init().
}
示例5: atc
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
ACE_Argv_Type_Converter atc (argc, argv);
try
{
if (0 != DRV_init (atc.get_argc (), atc.get_TCHAR_argv ()))
{
throw Bailout ();
}
// Parse arguments.
DRV_parse_args (atc.get_argc (), atc.get_ASCII_argv ());
// If a version message is requested, print it and exit cleanly.
if (idl_global->compile_flags () & IDL_CF_VERSION)
{
DRV_version ();
DRV_cleanup ();
return 0;
}
// If a usage message is requested, print it and exit cleanly.
if (idl_global->compile_flags () & IDL_CF_ONLY_USAGE)
{
DRV_usage ();
DRV_cleanup ();
return 0;
}
// If there are no input files, and we are not using the
// directory recursion option, there's no sense going any further.
if (0 == DRV_nfiles && 0 == idl_global->recursion_start ())
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("IDL: No input files\n")));
throw Bailout ();
}
AST_Generator *gen = be_util::generator_init ();
if (0 == gen)
{
ACE_ERROR ((
LM_ERROR,
ACE_TEXT ("IDL: DRV_generator_init() failed to create ")
ACE_TEXT ("generator, exiting\n")
));
throw Bailout ();
}
else
{
idl_global->set_gen (gen);
}
// Initialize AST and load predefined types.
FE_populate ();
// Does various things in various backends.
BE_post_init (DRV_files, DRV_nfiles);
FILE *output_file = 0;
if (idl_global->multi_file_input ())
{
output_file =
ACE_OS::fopen (idl_global->big_file_name (), "w");
}
for (DRV_file_index = 0;
DRV_file_index < DRV_nfiles;
++DRV_file_index)
{
if (idl_global->multi_file_input ())
{
ACE_OS::fprintf (output_file,
"#include \"%s\"\n",
DRV_files[DRV_file_index]);
}
else
{
DRV_drive (DRV_files[DRV_file_index]);
}
}
if (idl_global->multi_file_input ())
{
ACE_OS::fclose (output_file);
DRV_drive (idl_global->big_file_name ());
ACE_OS::unlink (idl_global->big_file_name ());
}
}
catch (Bailout)
{
// Incrementing here may be redundant, but the error count
// is the exit value, and we want to make sure it isn't 0
// if there was in fact an error. If a non-zero value is
// off by 1, it's not so important.
//.........这里部分代码省略.........
示例6: run_main
int run_main (int argc, ACE_TCHAR *argv[])
{
ACE_START_TEST (ACE_TEXT ("FlReactor_Test"));
Fl_Window window (300, 370);
Test_Window tw (10, 75, window.w () - 20, window.h ()-90);
window.resizable (&tw);
Fl_Hor_Slider slider (60, 5, window.w () - 70, 30, "Sides:");
slider.align (FL_ALIGN_LEFT);
slider.callback (sides_cb, &tw);
slider.value (tw.sides ());
slider.step (1);
slider.bounds (3, 10);
ACE_FlReactor reactor;
ACE_Reactor r (&reactor);
Fl_Box *box = new Fl_Box (FL_UP_BOX, 10, 40,
window.w () - 20, 30,
"Setting up");
box->labelfont (FL_BOLD);
Acceptor acceptor (&tw, box);
ACE_INET_Addr address;
if (acceptor.open (address, &r) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n",
"open acceptor"),
-1);
acceptor.acceptor ().get_local_addr (address);
const int bufsiz = 128;
ACE_TCHAR buf[bufsiz];
address.addr_to_string (buf, bufsiz, 0);
char msg[2 * bufsiz];
ACE_OS::sprintf (msg, "Listening on <%s>\n",
ACE_TEXT_ALWAYS_CHAR (buf));
box->label (msg);
box->redraw ();
window.end ();
ACE_Argv_Type_Converter ct (argc, argv);
window.show (argc, ct.get_ASCII_argv ());
tw.show ();
int const retval = Fl::run ();
ACE_END_TEST;
return retval;
}
示例7: narrow
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
int status = 0;
try
{
#if TAO_HAS_INTERCEPTORS == 1
PortableInterceptor::ORBInitializer_ptr temp_initializer =
PortableInterceptor::ORBInitializer::_nil ();
ACE_NEW_RETURN (temp_initializer,
Client_ORBInitializer,
-1); // No exceptions yet!
PortableInterceptor::ORBInitializer_var orb_initializer =
temp_initializer;
PortableInterceptor::register_orb_initializer (orb_initializer.in ());
#endif /* TAO_HAS_INTERCEPTORS == 1 */
ACE_Argv_Type_Converter narrow (argc, argv);
CORBA::ORB_var orb =
CORBA::ORB_init (narrow.get_argc (), narrow.get_ASCII_argv (), "ClientORB");
ACE_Argv_Type_Converter wide (narrow.get_argc (), narrow.get_ASCII_argv ());
if (::parse_args (wide.get_argc (), wide.get_TCHAR_argv ()) != 0)
return -1;
CORBA::Object_var object =
orb->string_to_object (ACE_TEXT_ALWAYS_CHAR (ior));
hello::GoodDay_var server =
hello::GoodDay::_narrow (object.in ());
if (CORBA::is_nil (server.in ()))
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Object reference <%s> is nil\n"),
ior),
1);
}
for (int i = 1; i <= 3; ++i)
{
ACE_DEBUG ((LM_INFO,
ACE_TEXT ("CLIENT: Issuing request %d.\n"),
i));
CORBA::Short number = server->number ();
ACE_DEBUG ((LM_INFO,
ACE_TEXT ("CLIENT: Request %d returns %d.\n"),
i,
number));
}
server->shutdown ();
orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("Caught exception:");
return -1;
}
return status;
}
示例8: conv
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
try
{
parse_args (argc, argv);
if (client_orb)
{
ACE_Argv_Type_Converter conv (argc, argv);
// Client creates the orb.
orb = CORBA::ORB_init (conv.get_argc (),
conv.get_ASCII_argv (),
OpenDDS::DCPS::DEFAULT_ORB_NAME);
TheServiceParticipant->set_ORB(orb.in());
// Client runs the orb.
CORBA::Object_var obj =
orb->resolve_initial_references ("RootPOA");
poa = PortableServer::POA::_narrow (obj.in ());
PortableServer::POAManager_var poa_manager =
poa->the_POAManager ();
poa_manager->activate ();
orb_task = new ORB_Task (orb.in ());
if (orb_task->activate (THR_NEW_LWP | THR_JOINABLE, 1) == -1)
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("OPENDDS_DCPS_Service_Participant::get_domain_participant_factory, ")
ACE_TEXT ("Failed to activate the orb task.")));
return 1;
}
dpf = TheParticipantFactory;
}
else
{
dpf = TheParticipantFactoryWithArgs(argc, argv);
poa = TheServiceParticipant->the_poa();
}
int ret = run_domain_test ();
TEST_CHECK (ret == 0);
ACE_DEBUG((LM_DEBUG,
ACE_TEXT("(%P|%t) main: ")
ACE_TEXT("(ret == 0)")
ACE_TEXT("\n")
));
for (ssize_t i = 0; i < 6; i ++)
{
run_next_sample_test (i);
run_next_send_sample_test (i);
run_next_instance_sample_test (i);
}
if (client_orb)
{
orb->shutdown (0);
orb_task->wait ();
}
TheTransportFactory->release();
TheServiceParticipant->shutdown ();
if (client_orb)
{
orb->destroy ();
}
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("Exception caught:");
return 1;
}
return 0;
}