summaryrefslogtreecommitdiff
path: root/TAO/performance-tests/Sequence_Latency/AMI/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/performance-tests/Sequence_Latency/AMI/client.cpp')
-rw-r--r--TAO/performance-tests/Sequence_Latency/AMI/client.cpp152
1 files changed, 51 insertions, 101 deletions
diff --git a/TAO/performance-tests/Sequence_Latency/AMI/client.cpp b/TAO/performance-tests/Sequence_Latency/AMI/client.cpp
index c1343244eab..89303ea3f11 100644
--- a/TAO/performance-tests/Sequence_Latency/AMI/client.cpp
+++ b/TAO/performance-tests/Sequence_Latency/AMI/client.cpp
@@ -79,8 +79,7 @@ parse_args (int argc, char *argv[])
void test_octet_seq (Test::Roundtrip_ptr roundtrip,
CORBA::ORB_ptr orb,
Test::AMI_RoundtripHandler_ptr roundtrip_handler,
- Roundtrip_Handler *roundtrip_handler_impl
- ACE_ENV_ARG_DECL)
+ Roundtrip_Handler *roundtrip_handler_impl)
{
Test::octet_load ol (sz);
ol.length (sz);
@@ -95,20 +94,17 @@ void test_octet_seq (Test::Roundtrip_ptr roundtrip,
// Invoke asynchronous operation....
roundtrip->sendc_test_octet_method (rth.in (),
ol,
- ACE_OS::gethrtime ()
- ACE_ENV_ARG_PARAMETER);
- if (orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER))
- orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_OS::gethrtime ());
+ if (orb->work_pending ())
+ orb->perform_work ();
- ACE_CHECK;
}
ACE_Time_Value tv (0, 2000);
while (roundtrip_handler_impl->pending_callbacks ())
{
- orb->perform_work (tv ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ orb->perform_work (tv);
}
ACE_hrtime_t test_end = ACE_OS::gethrtime ();
@@ -128,8 +124,7 @@ void test_octet_seq (Test::Roundtrip_ptr roundtrip,
void test_char_seq (Test::Roundtrip_ptr roundtrip,
CORBA::ORB_ptr orb,
Test::AMI_RoundtripHandler_ptr roundtrip_handler,
- Roundtrip_Handler *roundtrip_handler_impl
- ACE_ENV_ARG_DECL)
+ Roundtrip_Handler *roundtrip_handler_impl)
{
Test::char_load cl (sz);
cl.length (sz);
@@ -144,20 +139,17 @@ void test_char_seq (Test::Roundtrip_ptr roundtrip,
// Invoke asynchronous operation....
roundtrip->sendc_test_char_method (rth.in (),
cl,
- ACE_OS::gethrtime ()
- ACE_ENV_ARG_PARAMETER);
- if (orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER))
- orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_OS::gethrtime ());
+ if (orb->work_pending ())
+ orb->perform_work ();
- ACE_CHECK;
}
ACE_Time_Value tv (0, 2000);
while (roundtrip_handler_impl->pending_callbacks ())
{
- orb->perform_work (tv ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ orb->perform_work (tv);
}
ACE_hrtime_t test_end = ACE_OS::gethrtime ();
@@ -177,8 +169,7 @@ void test_char_seq (Test::Roundtrip_ptr roundtrip,
void test_long_seq (Test::Roundtrip_ptr roundtrip,
CORBA::ORB_ptr orb,
Test::AMI_RoundtripHandler_ptr roundtrip_handler,
- Roundtrip_Handler *roundtrip_handler_impl
- ACE_ENV_ARG_DECL)
+ Roundtrip_Handler *roundtrip_handler_impl)
{
Test::long_load ll (sz);
ll.length (sz);
@@ -193,20 +184,17 @@ void test_long_seq (Test::Roundtrip_ptr roundtrip,
// Invoke asynchronous operation....
roundtrip->sendc_test_long_method (rth.in (),
ll,
- ACE_OS::gethrtime ()
- ACE_ENV_ARG_PARAMETER);
- if (orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER))
- orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_OS::gethrtime ());
+ if (orb->work_pending ())
+ orb->perform_work ();
- ACE_CHECK;
}
ACE_Time_Value tv (0, 2000);
while (roundtrip_handler_impl->pending_callbacks ())
{
- orb->perform_work (tv ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ orb->perform_work (tv);
}
ACE_hrtime_t test_end = ACE_OS::gethrtime ();
@@ -226,8 +214,7 @@ void test_long_seq (Test::Roundtrip_ptr roundtrip,
void test_short_seq (Test::Roundtrip_ptr roundtrip,
CORBA::ORB_ptr orb,
Test::AMI_RoundtripHandler_ptr roundtrip_handler,
- Roundtrip_Handler *roundtrip_handler_impl
- ACE_ENV_ARG_DECL)
+ Roundtrip_Handler *roundtrip_handler_impl)
{
Test::short_load sl (sz);
sl.length (sz);
@@ -242,20 +229,17 @@ void test_short_seq (Test::Roundtrip_ptr roundtrip,
// Invoke asynchronous operation....
roundtrip->sendc_test_short_method (rth.in (),
sl,
- ACE_OS::gethrtime ()
- ACE_ENV_ARG_PARAMETER);
- if (orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER))
- orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_OS::gethrtime ());
+ if (orb->work_pending ())
+ orb->perform_work ();
- ACE_CHECK;
}
ACE_Time_Value tv (0, 2000);
while (roundtrip_handler_impl->pending_callbacks ())
{
- orb->perform_work (tv ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ orb->perform_work (tv);
}
ACE_hrtime_t test_end = ACE_OS::gethrtime ();
@@ -275,8 +259,7 @@ void test_short_seq (Test::Roundtrip_ptr roundtrip,
void test_double_seq (Test::Roundtrip_ptr roundtrip,
CORBA::ORB_ptr orb,
Test::AMI_RoundtripHandler_ptr roundtrip_handler,
- Roundtrip_Handler *roundtrip_handler_impl
- ACE_ENV_ARG_DECL)
+ Roundtrip_Handler *roundtrip_handler_impl)
{
Test::double_load dl (sz);
dl.length (sz);
@@ -291,20 +274,17 @@ void test_double_seq (Test::Roundtrip_ptr roundtrip,
// Invoke asynchronous operation....
roundtrip->sendc_test_double_method (rth.in (),
dl,
- ACE_OS::gethrtime ()
- ACE_ENV_ARG_PARAMETER);
- if (orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER))
- orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_OS::gethrtime ());
+ if (orb->work_pending ())
+ orb->perform_work ();
- ACE_CHECK;
}
ACE_Time_Value tv (0, 2000);
while (roundtrip_handler_impl->pending_callbacks ())
{
- orb->perform_work (tv ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ orb->perform_work (tv);
}
ACE_hrtime_t test_end = ACE_OS::gethrtime ();
@@ -324,8 +304,7 @@ void test_double_seq (Test::Roundtrip_ptr roundtrip,
void test_longlong_seq (Test::Roundtrip_ptr roundtrip,
CORBA::ORB_ptr orb,
Test::AMI_RoundtripHandler_ptr roundtrip_handler,
- Roundtrip_Handler *roundtrip_handler_impl
- ACE_ENV_ARG_DECL)
+ Roundtrip_Handler *roundtrip_handler_impl)
{
Test::longlong_load ll (sz);
ll.length (sz);
@@ -340,20 +319,17 @@ void test_longlong_seq (Test::Roundtrip_ptr roundtrip,
// Invoke asynchronous operation....
roundtrip->sendc_test_longlong_method (rth.in (),
ll,
- ACE_OS::gethrtime ()
- ACE_ENV_ARG_PARAMETER);
- if (orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER))
- orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_OS::gethrtime ());
+ if (orb->work_pending ())
+ orb->perform_work ();
- ACE_CHECK;
}
ACE_Time_Value tv (0, 2000);
while (roundtrip_handler_impl->pending_callbacks ())
{
- orb->perform_work (tv ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ orb->perform_work (tv);
}
ACE_hrtime_t test_end = ACE_OS::gethrtime ();
@@ -395,15 +371,13 @@ main (int argc, char *argv[])
"client (%P|%t): sched_params failed\n"));
}
- ACE_TRY_NEW_ENV
+ try
{
CORBA::ORB_var orb =
- CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ CORBA::ORB_init (argc, argv, "");
CORBA::Object_var poa_object =
- orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->resolve_initial_references("RootPOA");
if (CORBA::is_nil (poa_object.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
@@ -411,23 +385,19 @@ main (int argc, char *argv[])
1);
PortableServer::POA_var root_poa =
- PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ PortableServer::POA::_narrow (poa_object.in ());
PortableServer::POAManager_var poa_manager =
- root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ root_poa->the_POAManager ();
if (parse_args (argc, argv) != 0)
return 1;
CORBA::Object_var object =
- orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->string_to_object (ior);
Test::Roundtrip_var roundtrip =
- Test::Roundtrip::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ Test::Roundtrip::_narrow (object.in ());
if (CORBA::is_nil (roundtrip.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
@@ -441,9 +411,7 @@ main (int argc, char *argv[])
{
ACE_hrtime_t start = 0;
(void) roundtrip->test_octet_method (oc,
- start
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ start);
}
Roundtrip_Handler *roundtrip_handler_impl;
@@ -453,82 +421,64 @@ main (int argc, char *argv[])
PortableServer::ServantBase_var owner_transfer(roundtrip_handler_impl);
Test::AMI_RoundtripHandler_var roundtrip_handler =
- roundtrip_handler_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ roundtrip_handler_impl->_this ();
- poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ poa_manager->activate ();
if (ACE_OS::strcmp (data_type, "octet") == 0 )
{
test_octet_seq (roundtrip.in (),
orb.in (),
roundtrip_handler.in (),
- roundtrip_handler_impl
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ roundtrip_handler_impl);
}
else if (ACE_OS::strcmp (data_type, "char") == 0)
{
test_char_seq (roundtrip.in (),
orb.in (),
roundtrip_handler.in (),
- roundtrip_handler_impl
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ roundtrip_handler_impl);
}
else if (ACE_OS::strcmp (data_type, "long") == 0)
{
test_long_seq (roundtrip.in (),
orb.in (),
roundtrip_handler.in (),
- roundtrip_handler_impl
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ roundtrip_handler_impl);
}
else if (ACE_OS::strcmp (data_type, "short") == 0)
{
test_short_seq (roundtrip.in (),
orb.in (),
roundtrip_handler.in (),
- roundtrip_handler_impl
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ roundtrip_handler_impl);
}
else if (ACE_OS::strcmp (data_type, "double") == 0)
{
test_double_seq (roundtrip.in (),
orb.in (),
roundtrip_handler.in (),
- roundtrip_handler_impl
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ roundtrip_handler_impl);
}
else if (ACE_OS::strcmp (data_type, "longlong") == 0)
{
test_longlong_seq (roundtrip.in (),
orb.in (),
roundtrip_handler.in (),
- roundtrip_handler_impl
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ roundtrip_handler_impl);
}
- roundtrip->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ roundtrip->shutdown ();
- root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ root_poa->destroy (1, 1);
- orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->destroy ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught: ");
+ ex._tao_print_exception ("Exception caught: ");
return 1;
}
- ACE_ENDTRY;
return 0;
}