summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp')
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp75
1 files changed, 26 insertions, 49 deletions
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp
index c29daa4ff2a..a251edf0f60 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp
@@ -7,8 +7,8 @@
#include "ace/Stats.h"
#include "ace/Sample_History.h"
-ACE_RCSID (Latency_Test,
- Latency_Query_Client,
+ACE_RCSID (Latency_Test,
+ Latency_Query_Client,
"$Id$")
const CORBA::ULong DEFAULT_NUMCALLS = 20000;
@@ -28,13 +28,11 @@ int
Latency_Query_Client::init (int argc,
char *argv[])
{
- ACE_TRY_NEW_ENV
+ try
{
this->orb_ = CORBA::ORB_init (argc,
argv,
- 0
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ 0);
int retval = this->parse_args (argc,
argv);
@@ -45,9 +43,7 @@ Latency_Query_Client::init (int argc,
}
CORBA::Object_var object =
- this->orb_->resolve_initial_references ("InterfaceRepository"
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->orb_->resolve_initial_references ("InterfaceRepository");
if (CORBA::is_nil (object.in ()))
{
@@ -60,9 +56,7 @@ Latency_Query_Client::init (int argc,
}
this->repo_ =
- CORBA::Repository::_narrow (object.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ CORBA::Repository::_narrow (object.in ());
if (CORBA::is_nil (this->repo_.in ()))
{
@@ -71,21 +65,18 @@ Latency_Query_Client::init (int argc,
-1);
}
- retval = this->populate_ifr (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ retval = this->populate_ifr ();
if (retval != 0)
{
return retval;
}
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Latency_Query_Client::init:");
+ ex._tao_print_exception ("Latency_Query_Client::init:");
return -1;
}
- ACE_ENDTRY;
return 0;
}
@@ -96,12 +87,11 @@ Latency_Query_Client::run (void)
// CORBA::DefinitionKind dk;
CORBA::AttributeMode am;
- ACE_TRY_NEW_ENV
+ try
{
for (int j = 0; j < 100; ++j)
{
- am = this->attr_->mode (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ am = this->attr_->mode ();
if (am != CORBA::ATTR_NORMAL)
{
@@ -116,8 +106,7 @@ Latency_Query_Client::run (void)
{
ACE_hrtime_t start = ACE_OS::gethrtime ();
- am = this->attr_->mode (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ am = this->attr_->mode ();
ACE_hrtime_t now = ACE_OS::gethrtime ();
history.sample (now - start);
@@ -127,12 +116,12 @@ Latency_Query_Client::run (void)
if (this->debug_)
{
- ACE_DEBUG ((LM_DEBUG,
+ ACE_DEBUG ((LM_DEBUG,
"test finished\n"));
- ACE_DEBUG ((LM_DEBUG,
+ ACE_DEBUG ((LM_DEBUG,
"High resolution timer calibration...."));
ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
- ACE_DEBUG ((LM_DEBUG,
+ ACE_DEBUG ((LM_DEBUG,
"done\n"));
if (this->do_dump_history_)
@@ -144,19 +133,17 @@ Latency_Query_Client::run (void)
history.collect_basic_stats (stats);
stats.dump_results ("Total", gsf);
- ACE_Throughput_Stats::dump_throughput ("Total",
+ ACE_Throughput_Stats::dump_throughput ("Total",
gsf,
test_end - test_start,
stats.samples_count ());
}
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Latency_Query_Client::run:");
+ ex._tao_print_exception ("Latency_Query_Client::run:");
return -1;
}
- ACE_ENDTRY;
return 0;
}
@@ -176,10 +163,10 @@ Latency_Query_Client::parse_args (int argc,
case 'd':
this->debug_ = true;
break;
- case 'h':
+ case 'h':
this->do_dump_history_ = true;
break;
- case 'i':
+ case 'i':
result = ACE_OS::atoi (opts.opt_arg ());
if (result > 0)
@@ -204,17 +191,13 @@ Latency_Query_Client::parse_args (int argc,
}
int
-Latency_Query_Client::populate_ifr (ACE_ENV_SINGLE_ARG_DECL)
+Latency_Query_Client::populate_ifr (void)
{
- CORBA::Contained_var irobj = this->repo_->lookup_id ("IDL:dummy/attr:1.0"
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ CORBA::Contained_var irobj = this->repo_->lookup_id ("IDL:dummy/attr:1.0");
if (! CORBA::is_nil (irobj.in ()))
{
- this->attr_ = CORBA::AttributeDef::_narrow (irobj.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ this->attr_ = CORBA::AttributeDef::_narrow (irobj.in ());
if (CORBA::is_nil (this->attr_.in ()))
{
@@ -234,23 +217,17 @@ Latency_Query_Client::populate_ifr (ACE_ENV_SINGLE_ARG_DECL)
this->repo_->create_interface ("IDL:dummy:1.0",
"dummy",
"1.0",
- in_bases
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ in_bases);
CORBA::PrimitiveDef_var p_long =
- this->repo_->get_primitive (CORBA::pk_long
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ this->repo_->get_primitive (CORBA::pk_long);
this->attr_ =
iface->create_attribute ("IDL:dummt/attr:1.0",
"attr",
"1.0",
p_long.in (),
- CORBA::ATTR_NORMAL
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ CORBA::ATTR_NORMAL);
return 0;
}