diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-02-12 15:41:09 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-02-12 15:41:09 +0000 |
commit | 3b71fccf6a57443a96eb8062dbc073bdd21ac0dc (patch) | |
tree | a4eb221ce014f66b04fc13b11e19e3e088cc7729 | |
parent | 297a8299f6c4755079a503599e69a801d72fb472 (diff) | |
download | ATCD-3b71fccf6a57443a96eb8062dbc073bdd21ac0dc.tar.gz |
(svc): added .in () to objref and cb so that it will compile with g++
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp | 179 | ||||
-rw-r--r-- | TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp | 179 |
2 files changed, 178 insertions, 180 deletions
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp index 9970ac1099d..1d7612fa3f7 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp @@ -1,4 +1,3 @@ -// // $Id$ // #include "Task_Client.h" @@ -88,7 +87,7 @@ Task_State::Task_State (int argc, char **argv) case 'p': base_port_ = ACE_OS::atoi (opts.optarg); continue; - case 'n': // loop count + case 'n': // loop count loop_count_ = (u_int) ACE_OS::atoi (opts.optarg); continue; case 't': @@ -127,7 +126,7 @@ Client::put_ave_latency (int ave_latency, u_int thread_id) { } void -Client::put_latency (double *jitter, double latency, u_int thread_id) +Client::put_latency (double *jitter, double latency, u_int thread_id) { ts_->lock_.acquire (); ts_->latency_[thread_id] = latency; @@ -143,7 +142,7 @@ Client::get_high_priority_latency (void) } double -Client::get_low_priority_latency (void) +Client::get_low_priority_latency (void) { double l = 0; @@ -153,7 +152,7 @@ Client::get_low_priority_latency (void) } int -Client::get_latency (u_int thread_id) +Client::get_latency (u_int thread_id) { return ts_->ave_latency_ [thread_id]; } @@ -205,9 +204,9 @@ Client::svc (void) "(%t) Im the high priority client, my id is %d.\n", thread_id)); ACE_OS::sprintf (ior, - "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, - ts_->base_port_); + "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, + ts_->base_port_); frequency = CB_HIGH_PRIORITY_RATE; } else @@ -216,105 +215,105 @@ Client::svc (void) "(%t) Im a low priority client, my id is %d\n", thread_id)); ACE_OS::sprintf (ior, - "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, - ts_->base_port_ + thread_id); + "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, + ts_->base_port_ + thread_id); frequency = CB_LOW_PRIORITY_RATE; } } else { - switch (thread_id) - { - case CB_40HZ_CONSUMER: - ACE_DEBUG ((LM_DEBUG, - "(%t) Im the high priority client, " - "my id is %d.\n", thread_id)); - ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, ts_->base_port_); - frequency = CB_40HZ_CONSUMER_RATE; - break; - case CB_20HZ_CONSUMER: - ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " - "my id is %d.\n", thread_id)); - ::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, ts_->base_port_+1); - frequency = CB_20HZ_CONSUMER_RATE; - break; - case CB_10HZ_CONSUMER: - ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " - "my id is %d.\n", thread_id)); - ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, ts_->base_port_+2); - frequency = CB_10HZ_CONSUMER_RATE; - break; - case CB_5HZ_CONSUMER: - ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " - "my id is %d.\n", thread_id)); - ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, ts_->base_port_+3); - frequency = CB_5HZ_CONSUMER_RATE; - break; - case CB_1HZ_CONSUMER: - ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " - "my id is %d.\n", thread_id)); - ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, ts_->base_port_+4); - frequency = CB_1HZ_CONSUMER_RATE; - break; - default: - ACE_DEBUG ((LM_DEBUG, "(%t) Invalid Thread ID.\n", thread_id)); - } + switch (thread_id) + { + case CB_40HZ_CONSUMER: + ACE_DEBUG ((LM_DEBUG, + "(%t) Im the high priority client, " + "my id is %d.\n", thread_id)); + ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, ts_->base_port_); + frequency = CB_40HZ_CONSUMER_RATE; + break; + case CB_20HZ_CONSUMER: + ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " + "my id is %d.\n", thread_id)); + ::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, ts_->base_port_+1); + frequency = CB_20HZ_CONSUMER_RATE; + break; + case CB_10HZ_CONSUMER: + ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " + "my id is %d.\n", thread_id)); + ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, ts_->base_port_+2); + frequency = CB_10HZ_CONSUMER_RATE; + break; + case CB_5HZ_CONSUMER: + ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " + "my id is %d.\n", thread_id)); + ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, ts_->base_port_+3); + frequency = CB_5HZ_CONSUMER_RATE; + break; + case CB_1HZ_CONSUMER: + ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " + "my id is %d.\n", thread_id)); + ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, ts_->base_port_+4); + frequency = CB_1HZ_CONSUMER_RATE; + break; + default: + ACE_DEBUG ((LM_DEBUG, "(%t) Invalid Thread ID.\n", thread_id)); + } } - + ACE_DEBUG ((LM_DEBUG, "Using ior = %s\n", ior)); - + TAO_TRY { - CORBA::ORB_var orb = - CORBA::ORB_init (ts_->argc_, ts_->argv_, - "internet", TAO_TRY_ENV); - TAO_CHECK_ENV; + CORBA::ORB_var orb = + CORBA::ORB_init (ts_->argc_, ts_->argv_, + "internet", TAO_TRY_ENV); + TAO_CHECK_ENV; - CORBA::Object_var objref = - orb->string_to_object (ior, TAO_TRY_ENV); - TAO_CHECK_ENV; + CORBA::Object_var objref = + orb->string_to_object (ior, TAO_TRY_ENV); + TAO_CHECK_ENV; - if (CORBA::is_nil (objref.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "%s: must identify non-null target objref\n", - ts_->argv_ [0]), - 1); + if (CORBA::is_nil (objref.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + "%s: must identify non-null target objref\n", + ts_->argv_ [0]), + 1); - // Narrow the CORBA::Object reference to the stub object, checking - // the type along the way using _is_a. - Cubit_var cb = Cubit::_narrow (objref, TAO_TRY_ENV); - TAO_CHECK_ENV; + // Narrow the CORBA::Object reference to the stub object, checking + // the type along the way using _is_a. + Cubit_var cb = Cubit::_narrow (objref.in (), TAO_TRY_ENV); + TAO_CHECK_ENV; - if (CORBA::is_nil (cb.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "Create cubit failed\n"), 1); + if (CORBA::is_nil (cb.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + "Create cubit failed\n"), 1); - ACE_DEBUG ((LM_DEBUG, "(%t) Binding succeeded\n")); + ACE_DEBUG ((LM_DEBUG, "(%t) Binding succeeded\n")); - CORBA::String_var str = - orb->object_to_string (cb.in (), TAO_TRY_ENV); + CORBA::String_var str = + orb->object_to_string (cb.in (), TAO_TRY_ENV); - ACE_DEBUG ((LM_DEBUG, - "Object connected <%s>\n", str.in ())); + ACE_DEBUG ((LM_DEBUG, + "Object connected <%s>\n", str.in ())); - ACE_DEBUG ((LM_DEBUG, "(%t) Waiting for other threads to " - "finish binding..\n")); - ts_->barrier_->wait (); - ACE_DEBUG ((LM_DEBUG, "(%t) Everyone's done, here I go!!\n")); + ACE_DEBUG ((LM_DEBUG, "(%t) Waiting for other threads to " + "finish binding..\n")); + ts_->barrier_->wait (); + ACE_DEBUG ((LM_DEBUG, "(%t) Everyone's done, here I go!!\n")); - this->run_tests (cb, ts_->loop_count_, thread_id, - ts_->datatype_, frequency); + this->run_tests (cb.in (), ts_->loop_count_, thread_id, + ts_->datatype_, frequency); } TAO_CATCHANY { - TAO_TRY_ENV.print_exception ("get_object"); + TAO_TRY_ENV.print_exception ("get_object"); } TAO_ENDTRY; } @@ -381,7 +380,7 @@ Client::run_tests (Cubit_ptr cb, ret_short = cb->cube_short (arg_short, env); - if (env.exception () != 0) + if (env.exception () != 0) ACE_ERROR_RETURN ((LM_ERROR, "%s:Call failed\n", env.exception ()), @@ -389,7 +388,7 @@ Client::run_tests (Cubit_ptr cb, arg_short = arg_short * arg_short * arg_short; - if (arg_short != ret_short) + if (arg_short != ret_short) { ACE_DEBUG ((LM_DEBUG, "** cube_short(%d) (--> %d)\n", arg_short , ret_short)); error_count++; @@ -422,7 +421,7 @@ Client::run_tests (Cubit_ptr cb, case CB_STRUCT: // Cube a "struct" ... { - Cubit::Many arg_struct, ret_struct; + Cubit::Many arg_struct, ret_struct; call_count++; @@ -446,7 +445,7 @@ Client::run_tests (Cubit_ptr cb, ACE_DEBUG ((LM_DEBUG, "**cube_struct error!\n")); error_count++; } - + break; } } @@ -479,7 +478,7 @@ Client::run_tests (Cubit_ptr cb, latency /= call_count; - if (latency > 0) + if (latency > 0) { ACE_DEBUG ((LM_DEBUG, "cube average call ACE_OS::time\t= %f msec, \t" "%f calls/second\n", diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp index 9970ac1099d..1d7612fa3f7 100644 --- a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp +++ b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp @@ -1,4 +1,3 @@ -// // $Id$ // #include "Task_Client.h" @@ -88,7 +87,7 @@ Task_State::Task_State (int argc, char **argv) case 'p': base_port_ = ACE_OS::atoi (opts.optarg); continue; - case 'n': // loop count + case 'n': // loop count loop_count_ = (u_int) ACE_OS::atoi (opts.optarg); continue; case 't': @@ -127,7 +126,7 @@ Client::put_ave_latency (int ave_latency, u_int thread_id) { } void -Client::put_latency (double *jitter, double latency, u_int thread_id) +Client::put_latency (double *jitter, double latency, u_int thread_id) { ts_->lock_.acquire (); ts_->latency_[thread_id] = latency; @@ -143,7 +142,7 @@ Client::get_high_priority_latency (void) } double -Client::get_low_priority_latency (void) +Client::get_low_priority_latency (void) { double l = 0; @@ -153,7 +152,7 @@ Client::get_low_priority_latency (void) } int -Client::get_latency (u_int thread_id) +Client::get_latency (u_int thread_id) { return ts_->ave_latency_ [thread_id]; } @@ -205,9 +204,9 @@ Client::svc (void) "(%t) Im the high priority client, my id is %d.\n", thread_id)); ACE_OS::sprintf (ior, - "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, - ts_->base_port_); + "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, + ts_->base_port_); frequency = CB_HIGH_PRIORITY_RATE; } else @@ -216,105 +215,105 @@ Client::svc (void) "(%t) Im a low priority client, my id is %d\n", thread_id)); ACE_OS::sprintf (ior, - "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, - ts_->base_port_ + thread_id); + "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, + ts_->base_port_ + thread_id); frequency = CB_LOW_PRIORITY_RATE; } } else { - switch (thread_id) - { - case CB_40HZ_CONSUMER: - ACE_DEBUG ((LM_DEBUG, - "(%t) Im the high priority client, " - "my id is %d.\n", thread_id)); - ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, ts_->base_port_); - frequency = CB_40HZ_CONSUMER_RATE; - break; - case CB_20HZ_CONSUMER: - ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " - "my id is %d.\n", thread_id)); - ::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, ts_->base_port_+1); - frequency = CB_20HZ_CONSUMER_RATE; - break; - case CB_10HZ_CONSUMER: - ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " - "my id is %d.\n", thread_id)); - ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, ts_->base_port_+2); - frequency = CB_10HZ_CONSUMER_RATE; - break; - case CB_5HZ_CONSUMER: - ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " - "my id is %d.\n", thread_id)); - ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, ts_->base_port_+3); - frequency = CB_5HZ_CONSUMER_RATE; - break; - case CB_1HZ_CONSUMER: - ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " - "my id is %d.\n", thread_id)); - ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", - ts_->server_host_, ts_->base_port_+4); - frequency = CB_1HZ_CONSUMER_RATE; - break; - default: - ACE_DEBUG ((LM_DEBUG, "(%t) Invalid Thread ID.\n", thread_id)); - } + switch (thread_id) + { + case CB_40HZ_CONSUMER: + ACE_DEBUG ((LM_DEBUG, + "(%t) Im the high priority client, " + "my id is %d.\n", thread_id)); + ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, ts_->base_port_); + frequency = CB_40HZ_CONSUMER_RATE; + break; + case CB_20HZ_CONSUMER: + ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " + "my id is %d.\n", thread_id)); + ::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, ts_->base_port_+1); + frequency = CB_20HZ_CONSUMER_RATE; + break; + case CB_10HZ_CONSUMER: + ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " + "my id is %d.\n", thread_id)); + ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, ts_->base_port_+2); + frequency = CB_10HZ_CONSUMER_RATE; + break; + case CB_5HZ_CONSUMER: + ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " + "my id is %d.\n", thread_id)); + ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, ts_->base_port_+3); + frequency = CB_5HZ_CONSUMER_RATE; + break; + case CB_1HZ_CONSUMER: + ACE_DEBUG ((LM_DEBUG, "(%t) Im the high priority client, " + "my id is %d.\n", thread_id)); + ACE_OS::sprintf (ior, "iiop:1.0//%s:%d/Cubit00", + ts_->server_host_, ts_->base_port_+4); + frequency = CB_1HZ_CONSUMER_RATE; + break; + default: + ACE_DEBUG ((LM_DEBUG, "(%t) Invalid Thread ID.\n", thread_id)); + } } - + ACE_DEBUG ((LM_DEBUG, "Using ior = %s\n", ior)); - + TAO_TRY { - CORBA::ORB_var orb = - CORBA::ORB_init (ts_->argc_, ts_->argv_, - "internet", TAO_TRY_ENV); - TAO_CHECK_ENV; + CORBA::ORB_var orb = + CORBA::ORB_init (ts_->argc_, ts_->argv_, + "internet", TAO_TRY_ENV); + TAO_CHECK_ENV; - CORBA::Object_var objref = - orb->string_to_object (ior, TAO_TRY_ENV); - TAO_CHECK_ENV; + CORBA::Object_var objref = + orb->string_to_object (ior, TAO_TRY_ENV); + TAO_CHECK_ENV; - if (CORBA::is_nil (objref.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "%s: must identify non-null target objref\n", - ts_->argv_ [0]), - 1); + if (CORBA::is_nil (objref.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + "%s: must identify non-null target objref\n", + ts_->argv_ [0]), + 1); - // Narrow the CORBA::Object reference to the stub object, checking - // the type along the way using _is_a. - Cubit_var cb = Cubit::_narrow (objref, TAO_TRY_ENV); - TAO_CHECK_ENV; + // Narrow the CORBA::Object reference to the stub object, checking + // the type along the way using _is_a. + Cubit_var cb = Cubit::_narrow (objref.in (), TAO_TRY_ENV); + TAO_CHECK_ENV; - if (CORBA::is_nil (cb.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "Create cubit failed\n"), 1); + if (CORBA::is_nil (cb.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + "Create cubit failed\n"), 1); - ACE_DEBUG ((LM_DEBUG, "(%t) Binding succeeded\n")); + ACE_DEBUG ((LM_DEBUG, "(%t) Binding succeeded\n")); - CORBA::String_var str = - orb->object_to_string (cb.in (), TAO_TRY_ENV); + CORBA::String_var str = + orb->object_to_string (cb.in (), TAO_TRY_ENV); - ACE_DEBUG ((LM_DEBUG, - "Object connected <%s>\n", str.in ())); + ACE_DEBUG ((LM_DEBUG, + "Object connected <%s>\n", str.in ())); - ACE_DEBUG ((LM_DEBUG, "(%t) Waiting for other threads to " - "finish binding..\n")); - ts_->barrier_->wait (); - ACE_DEBUG ((LM_DEBUG, "(%t) Everyone's done, here I go!!\n")); + ACE_DEBUG ((LM_DEBUG, "(%t) Waiting for other threads to " + "finish binding..\n")); + ts_->barrier_->wait (); + ACE_DEBUG ((LM_DEBUG, "(%t) Everyone's done, here I go!!\n")); - this->run_tests (cb, ts_->loop_count_, thread_id, - ts_->datatype_, frequency); + this->run_tests (cb.in (), ts_->loop_count_, thread_id, + ts_->datatype_, frequency); } TAO_CATCHANY { - TAO_TRY_ENV.print_exception ("get_object"); + TAO_TRY_ENV.print_exception ("get_object"); } TAO_ENDTRY; } @@ -381,7 +380,7 @@ Client::run_tests (Cubit_ptr cb, ret_short = cb->cube_short (arg_short, env); - if (env.exception () != 0) + if (env.exception () != 0) ACE_ERROR_RETURN ((LM_ERROR, "%s:Call failed\n", env.exception ()), @@ -389,7 +388,7 @@ Client::run_tests (Cubit_ptr cb, arg_short = arg_short * arg_short * arg_short; - if (arg_short != ret_short) + if (arg_short != ret_short) { ACE_DEBUG ((LM_DEBUG, "** cube_short(%d) (--> %d)\n", arg_short , ret_short)); error_count++; @@ -422,7 +421,7 @@ Client::run_tests (Cubit_ptr cb, case CB_STRUCT: // Cube a "struct" ... { - Cubit::Many arg_struct, ret_struct; + Cubit::Many arg_struct, ret_struct; call_count++; @@ -446,7 +445,7 @@ Client::run_tests (Cubit_ptr cb, ACE_DEBUG ((LM_DEBUG, "**cube_struct error!\n")); error_count++; } - + break; } } @@ -479,7 +478,7 @@ Client::run_tests (Cubit_ptr cb, latency /= call_count; - if (latency > 0) + if (latency > 0) { ACE_DEBUG ((LM_DEBUG, "cube average call ACE_OS::time\t= %f msec, \t" "%f calls/second\n", |