From b11770b30f8b58d20fe2d61846bfa3fc5354ee7e Mon Sep 17 00:00:00 2001 From: Ossama Othman Date: Sat, 8 Dec 2001 21:59:30 +0000 Subject: Merged corba-env-clean branch. --- .../Smart_Proxies/Policy/Smart_Proxy_Impl.cpp | 22 +++++------ TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.h | 18 ++++----- TAO/tests/Smart_Proxies/Policy/client.cpp | 38 +++++++++---------- TAO/tests/Smart_Proxies/Policy/server.cpp | 44 +++++++++++----------- 4 files changed, 60 insertions(+), 62 deletions(-) (limited to 'TAO/tests/Smart_Proxies/Policy') diff --git a/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp b/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp index e016b3b16c1..1fdcda810e7 100644 --- a/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp +++ b/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp @@ -10,8 +10,8 @@ Smart_Test_Factory::Smart_Test_Factory (int one_shot_factory) } Test_ptr -Smart_Test_Factory::create_proxy (Test_ptr proxy, - CORBA::Environment &) +Smart_Test_Factory::create_proxy (Test_ptr proxy + TAO_ENV_ARG_DECL_NOT_USED) { ACE_DEBUG ((LM_DEBUG, "create_smart_proxy\n")); @@ -20,7 +20,7 @@ Smart_Test_Factory::create_proxy (Test_ptr proxy, ACE_NEW_RETURN (proxy, Smart_Test_Proxy (proxy), 0); return proxy; - + } Smart_Test_Proxy::Smart_Test_Proxy (Test_ptr proxy) @@ -28,20 +28,20 @@ Smart_Test_Proxy::Smart_Test_Proxy (Test_ptr proxy) { } -CORBA::Short -Smart_Test_Proxy::method (CORBA::Short boo, - CORBA::Environment &ACE_TRY_ENV) +CORBA::Short +Smart_Test_Proxy::method (CORBA::Short boo + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Test::Oops)) { ACE_DEBUG ((LM_DEBUG, "Yahoo, I am smart\n")); - + CORBA::Short retval = 0; - ACE_TRY + ACE_TRY { - retval = TAO_Test_Smart_Proxy_Base::method (boo, - ACE_TRY_ENV); + retval = TAO_Test_Smart_Proxy_Base::method (boo + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCH (Test::Oops, reason) @@ -51,6 +51,6 @@ Smart_Test_Proxy::method (CORBA::Short boo, return -1; } ACE_ENDTRY; - + return retval; } diff --git a/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.h b/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.h index 776b11b6b78..10edb88bf24 100644 --- a/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.h +++ b/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.h @@ -7,22 +7,20 @@ class Smart_Test_Factory : public virtual TAO_Test_Default_Proxy_Factory public: Smart_Test_Factory (int one_shot_factory = 1); - - virtual Test_ptr create_proxy (Test_ptr proxy, - CORBA::Environment &env = - TAO_default_environment ()); - // This method will create the smart_proxy. + + virtual Test_ptr create_proxy (Test_ptr proxy + TAO_ENV_ARG_DECL_WITH_DEFAULTS); + // This method will create the smart_proxy. }; -class Smart_Test_Proxy : public virtual TAO_Test_Smart_Proxy_Base +class Smart_Test_Proxy : public virtual TAO_Test_Smart_Proxy_Base { public: Smart_Test_Proxy (Test_ptr proxy); - virtual CORBA::Short method (CORBA::Short boo, - CORBA::Environment &ACE_TRY_ENV = - TAO_default_environment ()) - ACE_THROW_SPEC ((CORBA::SystemException, + virtual CORBA::Short method (CORBA::Short boo + TAO_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, Test::Oops)); // "Smartify" the method call! diff --git a/TAO/tests/Smart_Proxies/Policy/client.cpp b/TAO/tests/Smart_Proxies/Policy/client.cpp index fc775d205a0..5c5c0f2211a 100644 --- a/TAO/tests/Smart_Proxies/Policy/client.cpp +++ b/TAO/tests/Smart_Proxies/Policy/client.cpp @@ -56,7 +56,7 @@ parse_args (int argc, char *argv[]) return 0; } -int +int run_test (CORBA::ORB_ptr orb_ptr, int target) { @@ -67,28 +67,28 @@ run_test (CORBA::ORB_ptr orb_ptr, if (target == 1) { object = - orb->string_to_object (ior1, - ACE_TRY_ENV); + orb->string_to_object (ior1 + TAO_ENV_ARG_PARAMETER); } else { object = - orb->string_to_object (ior2, - ACE_TRY_ENV); + orb->string_to_object (ior2 + TAO_ENV_ARG_PARAMETER); } ACE_TRY_CHECK; - + Test_var server = - Test::_narrow (object.in (), - ACE_TRY_ENV); + Test::_narrow (object.in () + TAO_ENV_ARG_PARAMETER); if (CORBA::is_nil (server.in ())) ACE_ERROR_RETURN ((LM_ERROR, "Object reference is nil\n"), 1); - + server->method (0); - server->shutdown (ACE_TRY_ENV); - + server->shutdown (TAO_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; } ACE_CATCHANY @@ -97,7 +97,7 @@ run_test (CORBA::ORB_ptr orb_ptr, "Client-side exception:"); } ACE_ENDTRY; -return 0; +return 0; } int @@ -108,13 +108,13 @@ main (int argc, char *argv[]) CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, - "", - ACE_TRY_ENV); + "" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (parse_args (argc, argv) != 0) return 1; - + // To use the smart proxy it is necessary to allocate the // user-defined smart factory on the heap as the smart proxy // generated classes take care of destroying the object. This @@ -126,14 +126,14 @@ main (int argc, char *argv[]) // this interface) but if there is a need for flexibility per // object instance then needs to be set to 0. Smart_Test_Factory *test_factory = 0; - ACE_NEW_RETURN (test_factory, + ACE_NEW_RETURN (test_factory, Smart_Test_Factory (one_shot_factory), -1); - - // To make KAI Compiler happy as it considers to be + + // To make KAI Compiler happy as it considers to be // an unused variable. ACE_UNUSED_ARG (test_factory); - + run_test (orb.in (), 1); run_test (orb.in (), 2); diff --git a/TAO/tests/Smart_Proxies/Policy/server.cpp b/TAO/tests/Smart_Proxies/Policy/server.cpp index 64260ee25f2..6c1780056d6 100644 --- a/TAO/tests/Smart_Proxies/Policy/server.cpp +++ b/TAO/tests/Smart_Proxies/Policy/server.cpp @@ -28,12 +28,12 @@ class Test_i : public POA_Test public: Test_i (CORBA::ORB_ptr orb); - CORBA::Short method (CORBA::Short boo, - CORBA::Environment &ACE_TRY_ENV) + CORBA::Short method (CORBA::Short boo + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Test::Oops)); - void shutdown (CORBA::Environment &ACE_TRY_ENV) + void shutdown (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); private: @@ -47,8 +47,8 @@ Test_i::Test_i (CORBA::ORB_ptr orb) } CORBA::Short -Test_i :: method (CORBA::Short boo, - CORBA::Environment &ACE_TRY_ENV) +Test_i :: method (CORBA::Short boo + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Test::Oops)) { @@ -62,10 +62,10 @@ Test_i :: method (CORBA::Short boo, } void -Test_i::shutdown (CORBA::Environment &ACE_TRY_ENV) +Test_i::shutdown (TAO_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->orb_->shutdown (0, ACE_TRY_ENV); + this->orb_->shutdown (0 TAO_ENV_ARG_PARAMETER); } static const char *ior_output_file = 0; @@ -98,7 +98,7 @@ parse_args (int argc, char *argv[]) int main (int argc, char *argv[]) { - ACE_DECLARE_NEW_CORBA_ENV; + TAO_ENV_DECLARE_NEW_ENV; ACE_TRY { @@ -107,35 +107,35 @@ main (int argc, char *argv[]) CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, - "", - ACE_TRY_ENV); + "" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; Test_i servant (orb.in ()); // Obtain RootPOA. CORBA::Object_var object = - orb->resolve_initial_references ("RootPOA", - ACE_TRY_ENV); + orb->resolve_initial_references ("RootPOA" + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (object.in (), - ACE_TRY_ENV); + PortableServer::POA::_narrow (object.in () + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Get the POAManager of the RootPOA. PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_TRY_ENV); + root_poa->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; Test_var Test_object = - servant._this (ACE_TRY_ENV); + servant._this (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::String_var ior = - orb->object_to_string (Test_object.in (), - ACE_TRY_ENV); + orb->object_to_string (Test_object.in () + TAO_ENV_ARG_PARAMETER); // If the ior_output_file exists, output the ior to it if (ior_output_file != 0) @@ -155,18 +155,18 @@ main (int argc, char *argv[]) ACE_OS::fclose (output_file); } - poa_manager->activate (ACE_TRY_ENV); + poa_manager->activate (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->run (ACE_TRY_ENV); + orb->run (TAO_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); root_poa->destroy (1, - 1, - ACE_TRY_ENV); + 1 + TAO_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } ACE_CATCHANY -- cgit v1.2.1