diff options
author | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-11-02 08:35:59 +0000 |
---|---|---|
committer | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-11-02 08:35:59 +0000 |
commit | 79b08ad9a985361d2c5bd336c000cbfb71010b12 (patch) | |
tree | 76754c2487a78d132935486bb573c94838e2b311 | |
parent | c6ceb1c3b41d8d97662f696f4cc48de3ad7ad00e (diff) | |
download | ATCD-79b08ad9a985361d2c5bd336c000cbfb71010b12.tar.gz |
Wed Nov 02 08:30:13 UTC 2011 Martin Corino <mcorino@remedy.nl>
Merged changes from Remedy work branch.
125 files changed, 2920 insertions, 597 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 46cff0fd26c..25b74fad4db 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,141 @@ +Wed Nov 02 08:30:13 UTC 2011 Martin Corino <mcorino@remedy.nl> + + Merged changes from Remedy work branch. + + === start changelog === + + Tue Nov 1 09:11:13 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * tests/IDL_Test/Inherited_Component/Extended/Base.mpc: + Layout changes. + + * tests/IDL_Test/Inherited_Component/Extended/Derived.mpc: + Linux link error. + + Tue Nov 1 08:48:41 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * tests/IDL_Test/Inherited_Component/Extended/Derived.idl: + Used module name to identify the supported interface. + + * tests/IDL_Test/Inherited_Component/Extended/Derived.mpc: + Fixed link issue on linux + + Mon Oct 31 13:53:36 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * ciao/Containers/Extension/Extension_Container.h: + * ciao/Containers/Session/Session_Container.h: + * ciao/Contexts/Extension/Extension_Context_T.cpp: + * ciao/Deployment/Handlers/CIAO_Handler_Common.cpp: + * ciao/Deployment/Handlers/CIAO_State.cpp: + * ciao/Deployment/Handlers/Component_Handler.h: + * ciao/Deployment/Handlers/Component_Handler.cpp: + * ciao/Deployment/Handlers/Connection_Handler.cpp: + * ciao/Deployment/Handlers/Container_Handler.cpp: + * ciao/Deployment/Handlers/Home_Handler.h: + * ciao/Deployment/Handlers/Home_Handler.cpp: + * ciao/Deployment/Interceptors/Deployment_Interceptors.cpp: + * ciao/Servants/Connector_Servant_Impl_Base.cpp: + Several improvements regarding thread safety. Also + some minor code layout changes. + + * ciao/Containers/Extension/README: + * ciao/Contexts/Extension/README: + * ciao/Servants/Extension/README: + Added: Extension containers are not ready to use, yet. + + Sat Oct 29 14:25:16 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Base.mpc: + * connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Base_Component.mpc: + * connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Derived_Component.mpc: + * connectors/dds4ccm/tests/IDL_Test/Connector/IDL_Test_Connector.mpc: + Fuzz. + + * connectors/dds4ccm/tests/QueryCondition/DDS/Base/Base.mpc: + * connectors/dds4ccm/tests/QueryCondition/DDS/DDS_Receiver/DDS_Receiver.mpc: + * connectors/dds4ccm/tests/QueryCondition/DDS/DDS_Sender/DDS_Sender.mpc: + Fixed double project names. + + Fri Oct 28 15:55:29 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Interfaces.mpc: + * connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Base_Component.mpc: + * connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Derived_Component.mpc: + Fixed compile and link issues on windows + + Fri Oct 28 15:04:03 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Derived_Component.mpc: + Fixed another link issue. + + Fri Oct 28 15:00:43 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Derived_Component.mpc: + Fixed link issue on windows. + + Fri Oct 28 14:55:18 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Base_Component.mpc: + Fixed compile issues on windows. + + Fri Oct 28 14:52:38 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Interfaces.mpc: + Added libpaths. + + Fri Oct 28 14:49:01 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Base_Component.mpc: + * connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Derived_Component.mpc: + Fixed afters. + + Fri Oct 28 14:18:46 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * connectors/dds4ccm/tests/IDL_Test: + * connectors/dds4ccm/tests/IDL_Test/Base: + * connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Base.idl: + * connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Base.mpc: + * connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Interfaces.idl: + * connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Interfaces.mpc: + * connectors/dds4ccm/tests/IDL_Test/Component: + * connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Base_Component.idl: + * connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Base_Component.mpc: + * connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Derived_Component.idl: + * connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Derived_Component.mpc: + * connectors/dds4ccm/tests/IDL_Test/Connector: + * connectors/dds4ccm/tests/IDL_Test/Connector/IDL_Test_Connector.idl: + * connectors/dds4ccm/tests/IDL_Test/Connector/IDL_Test_Connector.mpc: + Compilation test. + + * tests/IDL_Test/Inherited_Component/IhC_Bar.mpc: + Fixed link issue + + Fri Oct 28 14:17:05 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * tests/IDL_Test/Inherited_Component/Extended: + + * tests/IDL_Test/Inherited_Component/Extended/Base.idl: + * tests/IDL_Test/Inherited_Component/Extended/Base.mpc: + * tests/IDL_Test/Inherited_Component/Extended/Derived.idl: + * tests/IDL_Test/Inherited_Component/Extended/Derived.mpc: + * tests/IDL_Test/Inherited_Component/Extended/Tester.cpp: + Compilation test. + + Thu Oct 27 10:10:00 UTC 2011 Martin Corino <mcorino@remedy.nl> + + * ciao/Deployment/Interceptors/Deployment_Interceptors.h: + * ciao/Deployment/Interceptors/Deployment_Interceptors.cpp: + + Changed basic CIAO_ReferenceLookup_i to attempt handling resolving + externalReference endpoints as CORBA IOR type references. + Added factory method for creating interceptor. + + * tests/DAnCE/ExecutionManager-Deployments/run_test.pl: + + Change to allow overruling CIAO_LOG_LEVEL from commandline. + + === end changelog === + Tue Nov 1 19:23:58 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl> * MPC/config/ccm_svnt.mpb: diff --git a/CIAO/ciao/Containers/Extension/Extension_Container.h b/CIAO/ciao/Containers/Extension/Extension_Container.h index ef7589ab505..657d4241ab4 100644 --- a/CIAO/ciao/Containers/Extension/Extension_Container.h +++ b/CIAO/ciao/Containers/Extension/Extension_Container.h @@ -47,35 +47,6 @@ namespace CIAO ::CIAO::Extension_Container_ptr, const char *); - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - HomeFactory, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> - HOMECREATOR_FUNCPTR_MAP; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - HomeServantFactory, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> - HOMESERVANTCREATOR_FUNCPTR_MAP; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - ComponentFactory, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> - COMPONENTCREATOR_FUNCPTR_MAP; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - ComponentServantFactory, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> - COMPONENTSERVANTCREATOR_FUNCPTR_MAP; - - class EXTENSION_CONTAINER_Export Extension_Container_i : public Container_i < ::CIAO::Extension_Container> { diff --git a/CIAO/ciao/Containers/Extension/README b/CIAO/ciao/Containers/Extension/README new file mode 100644 index 00000000000..04a9ae87a05 --- /dev/null +++ b/CIAO/ciao/Containers/Extension/README @@ -0,0 +1,4 @@ +$Id$ + +CIAO Extension containers are incomplete, experimental and not thread safe. +They may not work as expected. diff --git a/CIAO/ciao/Containers/Session/Session_Container.h b/CIAO/ciao/Containers/Session/Session_Container.h index 72829454b0e..d25d1cd3878 100644 --- a/CIAO/ciao/Containers/Session/Session_Container.h +++ b/CIAO/ciao/Containers/Session/Session_Container.h @@ -40,35 +40,6 @@ namespace CIAO ::CIAO::Session_Container_ptr, const char *); - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - HomeFactory, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> - HOMECREATOR_FUNCPTR_MAP; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - HomeServantFactory, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> - HOMESERVANTCREATOR_FUNCPTR_MAP; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - ComponentFactory, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> - COMPONENTCREATOR_FUNCPTR_MAP; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - ComponentServantFactory, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> - COMPONENTSERVANTCREATOR_FUNCPTR_MAP; - - class SESSION_CONTAINER_Export Session_Container_i : public Container_i < ::CIAO::Session_Container> { diff --git a/CIAO/ciao/Contexts/Extension/Extension_Context_T.cpp b/CIAO/ciao/Contexts/Extension/Extension_Context_T.cpp index f31f3e66770..df2fd3d9eb8 100644 --- a/CIAO/ciao/Contexts/Extension/Extension_Context_T.cpp +++ b/CIAO/ciao/Contexts/Extension/Extension_Context_T.cpp @@ -28,7 +28,9 @@ namespace CIAO ::Components::ContainerPortableInterceptor::ClientContainerInterceptorRegistration_ptr Extension_Context_Impl<BASE_CTX, COMP>::get_client_interceptor_registration (void) { - return this->container_->get_client_interceptor_registration (); + ::CIAO::Extension_Container_var cnt_safe = + ::CIAO::Extension_Container::_duplicate (this->container_.in ()); + return cnt_safe->get_client_interceptor_registration (); } template <typename BASE_CTX, @@ -36,7 +38,9 @@ namespace CIAO ::Components::ContainerPortableInterceptor::ServantContainerInterceptorRegistration_ptr Extension_Context_Impl<BASE_CTX, COMP>::get_servant_interceptor_registration (void) { - return this->container_->get_servant_interceptor_registration (); + ::CIAO::Extension_Container_var cnt_safe = + ::CIAO::Extension_Container::_duplicate (this->container_.in ()); + return cnt_safe->get_servant_interceptor_registration (); } template <typename BASE_CTX, @@ -44,7 +48,9 @@ namespace CIAO ::Components::ContainerPortableInterceptor::ServerContainerInterceptorRegistration_ptr Extension_Context_Impl<BASE_CTX, COMP>::get_server_interceptor_registration (void) { - return this->container_->get_server_interceptor_registration (); + ::CIAO::Extension_Container_var cnt_safe = + ::CIAO::Extension_Container::_duplicate (this->container_.in ()); + return cnt_safe->get_server_interceptor_registration (); } template <typename BASE_CTX, @@ -52,7 +58,9 @@ namespace CIAO ::Components::ContainerPortableInterceptor::StubContainerInterceptorRegistration_ptr Extension_Context_Impl<BASE_CTX, COMP>::get_stub_interceptor_registration (void) { - return this->container_->get_stub_interceptor_registration (); + ::CIAO::Extension_Container_var cnt_safe = + ::CIAO::Extension_Container::_duplicate (this->container_.in ()); + return cnt_safe->get_stub_interceptor_registration (); } template <typename BASE_CTX, @@ -62,8 +70,10 @@ namespace CIAO const char * service_id, ::CORBA::Object_ptr objref) { - return this->container_->install_service_reference (service_id, - objref); + ::CIAO::Extension_Container_var cnt_safe = + ::CIAO::Extension_Container::_duplicate (this->container_.in ()); + return cnt_safe->install_service_reference (service_id, + objref); } template <typename BASE_CTX, @@ -72,7 +82,9 @@ namespace CIAO Extension_Context_Impl<BASE_CTX, COMP>::uninstall_service_reference ( ::Components::Cookie * ck) { - return this->container_->uninstall_service_reference (ck); + ::CIAO::Extension_Container_var cnt_safe = + ::CIAO::Extension_Container::_duplicate (this->container_.in ()); + return cnt_safe->uninstall_service_reference (ck); } } diff --git a/CIAO/ciao/Contexts/Extension/README b/CIAO/ciao/Contexts/Extension/README new file mode 100644 index 00000000000..04a9ae87a05 --- /dev/null +++ b/CIAO/ciao/Contexts/Extension/README @@ -0,0 +1,4 @@ +$Id$ + +CIAO Extension containers are incomplete, experimental and not thread safe. +They may not work as expected. diff --git a/CIAO/ciao/Deployment/Handlers/CIAO_Handler_Common.cpp b/CIAO/ciao/Deployment/Handlers/CIAO_Handler_Common.cpp index 242c5e03045..f1ea6cfc72d 100644 --- a/CIAO/ciao/Deployment/Handlers/CIAO_Handler_Common.cpp +++ b/CIAO/ciao/Deployment/Handlers/CIAO_Handler_Common.cpp @@ -12,8 +12,10 @@ namespace CIAO const ::Deployment::DeploymentPlan &plan) { if (name == 0) - throw ::Deployment::PlanError (name, - "No such artifact"); + { + throw ::Deployment::PlanError (name, + "No such artifact"); + } for (CORBA::ULong i = 0; i < plan.artifact.length (); @@ -24,7 +26,9 @@ namespace CIAO { if (plan.artifact[i].location.length () >= 1 && plan.artifact[i].location[0] != 0) - return plan.artifact[i].location[0].in (); + { + return plan.artifact[i].location[0].in (); + } else { CIAO_ERROR (1, (LM_ERROR, CLINFO diff --git a/CIAO/ciao/Deployment/Handlers/CIAO_State.cpp b/CIAO/ciao/Deployment/Handlers/CIAO_State.cpp index cad4f3049a5..63661bd3285 100644 --- a/CIAO/ciao/Deployment/Handlers/CIAO_State.cpp +++ b/CIAO/ciao/Deployment/Handlers/CIAO_State.cpp @@ -49,7 +49,9 @@ namespace CIAO CONTAINERS::iterator pos = this->containers_.find (id); if (pos != this->containers_.end ()) - this->containers_.erase (pos); + { + this->containers_.erase (pos); + } } CIAO::Container_ptr @@ -65,7 +67,9 @@ namespace CIAO CONTAINERS::iterator pos = this->containers_.find (id); if (pos == this->containers_.end ()) - return CIAO::Container::_nil (); + { + return CIAO::Container::_nil (); + } return CIAO::Container::_duplicate (pos->second.in ()); } @@ -115,7 +119,9 @@ namespace CIAO HOMES::iterator pos = this->homes_.find (id); if (pos != this->homes_.end ()) - this->homes_.erase (pos); + { + this->homes_.erase (pos); + } } { @@ -127,7 +133,9 @@ namespace CIAO this->instance_container_.find (id); if (cont != this->instance_container_.end ()) - this->instance_container_.erase (cont); + { + this->instance_container_.erase (cont); + } } } @@ -144,7 +152,9 @@ namespace CIAO HOMES::iterator pos = this->homes_.find (id); if (pos == this->homes_.end ()) - return Components::CCMHome::_nil (); + { + return Components::CCMHome::_nil (); + } return Components::CCMHome::_duplicate (pos->second.in ()); } @@ -193,7 +203,9 @@ namespace CIAO COMPONENTS::iterator pos = this->components_.find (id); if (pos != this->components_.end ()) - this->components_.erase (pos); + { + this->components_.erase (pos); + } } { @@ -205,7 +217,9 @@ namespace CIAO this->instance_container_.find (id); if (cont != this->instance_container_.end ()) - this->instance_container_.erase (cont); + { + this->instance_container_.erase (cont); + } } } @@ -222,7 +236,9 @@ namespace CIAO COMPONENTS::iterator pos = this->components_.find (id); if (pos == this->components_.end ()) - return Components::CCMObject::_nil (); + { + return Components::CCMObject::_nil (); + } return Components::CCMObject::_duplicate (pos->second.in ()); } @@ -240,7 +256,9 @@ namespace CIAO this->instance_container_.find (id); if (cont != this->instance_container_.end ()) - return cont->second.c_str (); + { + return cont->second.c_str (); + } CIAO_ERROR (1, (LM_ERROR, CLINFO "Deployment_State::instance_to_container - " diff --git a/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp b/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp index 3b378248fdc..6973ffac406 100644 --- a/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp +++ b/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp @@ -24,6 +24,10 @@ namespace CIAO void Component_Handler_i::close (void) { + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + guard, + this->instances_mutex_, + CORBA::NO_RESOURCES ()); this->instances_.clear (); } @@ -257,7 +261,13 @@ namespace CIAO "Container provided nil object reference"); } - this->instances_[idd.name.in ()] = info; + { + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + guard, + this->instances_mutex_, + CORBA::NO_RESOURCES ()); + this->instances_[idd.name.in ()] = info; + } DEPLOYMENT_STATE::instance ()->add_component (idd.name.in (), cont_id, @@ -400,18 +410,24 @@ namespace CIAO CIAO_TRACE ("Component_Handler_i::remove_instance"); const char *name = plan.instance[instanceRef].name.in (); - Deployment_Common::INSTANCES::iterator instance - = this->instances_.find (name); - - if (instance == this->instances_.end ()) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "Component_Handler_i::remove_instance - " - "Instructed to remove unknown component instance <%C>\n", - name)); - throw ::Deployment::StopError (name, - "Wrong instance handler for component instance\n"); - } + Deployment_Common::INSTANCES::iterator instance; + { + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + guard, + this->instances_mutex_, + CORBA::NO_RESOURCES ()); + instance = this->instances_.find (name); + + if (instance == this->instances_.end ()) + { + CIAO_ERROR (1, (LM_ERROR, CLINFO + "Component_Handler_i::remove_instance - " + "Instructed to remove unknown component instance <%C>\n", + name)); + throw ::Deployment::StopError (name, + "Wrong instance handler for component instance\n"); + } + } CIAO_DEBUG (8, (LM_DEBUG, CLINFO "Component_Handler_i::remove_instance - " @@ -477,7 +493,13 @@ namespace CIAO "Unknown C++ exception\n"); } - this->instances_.erase (instance); + { + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + guard, + this->instances_mutex_, + CORBA::NO_RESOURCES ()); + this->instances_.erase (instance); + } DEPLOYMENT_STATE::instance ()->remove_component (name); CIAO_DEBUG (4, (LM_INFO, CLINFO diff --git a/CIAO/ciao/Deployment/Handlers/Component_Handler.h b/CIAO/ciao/Deployment/Handlers/Component_Handler.h index 6e79c725ef9..c47fb7da00a 100644 --- a/CIAO/ciao/Deployment/Handlers/Component_Handler.h +++ b/CIAO/ciao/Deployment/Handlers/Component_Handler.h @@ -88,6 +88,7 @@ namespace CIAO private: Deployment_Common::INSTANCES instances_; + TAO_SYNCH_MUTEX instances_mutex_; }; } diff --git a/CIAO/ciao/Deployment/Handlers/Connection_Handler.cpp b/CIAO/ciao/Deployment/Handlers/Connection_Handler.cpp index a2efc2e6d76..421ba9e9128 100644 --- a/CIAO/ciao/Deployment/Handlers/Connection_Handler.cpp +++ b/CIAO/ciao/Deployment/Handlers/Connection_Handler.cpp @@ -1141,15 +1141,18 @@ namespace CIAO { CIAO_TRACE ("Connection_Handler::insert_cookie"); - ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, - guard, - this->cookies_mutex_, - CORBA::NO_RESOURCES ()); - - std::pair <std::string, CONNECTION_INFO> value_to_insert (connection_name, - conn_info); - std::pair<COOKIES::iterator, bool> ret = this->cookies_.insert (value_to_insert); - if (!ret.second) + std::pair<COOKIES::iterator, bool> result; + { + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + guard, + this->cookies_mutex_, + CORBA::NO_RESOURCES ()); + + std::pair <std::string, CONNECTION_INFO> value_to_insert (connection_name, + conn_info); + result = this->cookies_.insert (value_to_insert); + } + if (!result.second) { CIAO_ERROR (1, (LM_ERROR, CLINFO "Connection_Handler::insert_cookie - " @@ -1229,18 +1232,23 @@ namespace CIAO Connection_Handler::get_ccm_object (const char * connection_name) { CIAO_TRACE ("Connection_Handler::get_ccm_object"); - - COOKIES::iterator it = this->cookies_.find (connection_name); - if (it == this->cookies_.end ()) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "Connection_Handler::get_ccm_object - " - "Cookie for <%C> not found\n", - connection_name)); - throw ::Deployment::InvalidConnection (connection_name, - "Unable to find correct cookie"); - } - + COOKIES::iterator it; + { + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + guard, + this->cookies_mutex_, + CORBA::NO_RESOURCES ()); + it = this->cookies_.find (connection_name); + if (it == this->cookies_.end ()) + { + CIAO_ERROR (1, (LM_ERROR, CLINFO + "Connection_Handler::get_ccm_object - " + "Cookie for <%C> not found\n", + connection_name)); + throw ::Deployment::InvalidConnection (connection_name, + "Unable to find correct cookie"); + } + } ::Components::CCMObject_var ret = it->second.second; if (::CORBA::is_nil (ret.in ())) { @@ -1258,6 +1266,7 @@ namespace CIAO Connection_Handler::retrieve_endpoint (const ::Deployment::PlanConnectionDescription &conn) { CIAO_TRACE ("Connection_Handler::retrieve_endpoint"); + if (conn.internalEndpoint.length () == 0) { CIAO_ERROR (1, (LM_ERROR, CLINFO diff --git a/CIAO/ciao/Deployment/Handlers/Container_Handler.cpp b/CIAO/ciao/Deployment/Handlers/Container_Handler.cpp index dc717247848..7d00837775d 100644 --- a/CIAO/ciao/Deployment/Handlers/Container_Handler.cpp +++ b/CIAO/ciao/Deployment/Handlers/Container_Handler.cpp @@ -280,7 +280,7 @@ namespace CIAO "Unable to locate POA"); } - CIAO::Server_init (orb_); + CIAO::Server_init (this->orb_); // For the time being, we are going to go ahead and construct a container. ::Deployment::DeploymentPlan plan; diff --git a/CIAO/ciao/Deployment/Handlers/Home_Handler.cpp b/CIAO/ciao/Deployment/Handlers/Home_Handler.cpp index d0202ce2e90..2fec16f3e8b 100644 --- a/CIAO/ciao/Deployment/Handlers/Home_Handler.cpp +++ b/CIAO/ciao/Deployment/Handlers/Home_Handler.cpp @@ -22,6 +22,10 @@ namespace CIAO void Home_Handler_i::close (void) { + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + guard, + this->instances_mutex_, + CORBA::NO_RESOURCES ()); this->instances_.clear (); } @@ -253,8 +257,13 @@ namespace CIAO throw ::Deployment::StartError (idd.name.in (), "Container provided nil object reference"); } - - this->instances_[idd.name.in ()] = info; + { + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + guard, + this->instances_mutex_, + CORBA::NO_RESOURCES ()); + this->instances_[idd.name.in ()] = info; + } DEPLOYMENT_STATE::instance ()->add_home (idd.name.in (), cont_id, home_ref.in ()); @@ -289,23 +298,29 @@ namespace CIAO CIAO_TRACE ("Home_Handler_i::remove_instance"); const char *name = plan.instance[instanceRef].name.in (); - Deployment_Common::INSTANCES::iterator instance - = this->instances_.find (name); - - if (instance == this->instances_.end ()) - { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "Home_Handler_i::remove_instance - " - "Instructed to remove unknown home instance <%C>\n", - name)); - throw ::Deployment::StopError (name, - "Wrong instance handler for home instance\n"); - } - - CIAO_DEBUG (8, (LM_DEBUG, CLINFO - "Home_Handler_i::remove_instance - " - "Attempting removal of home instance <%C>\n", - name)); + Deployment_Common::INSTANCES::iterator instance; + { + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + guard, + this->instances_mutex_, + CORBA::NO_RESOURCES ()); + instance = this->instances_.find (name); + + if (instance == this->instances_.end ()) + { + CIAO_ERROR (1, (LM_ERROR, CLINFO + "Home_Handler_i::remove_instance - " + "Instructed to remove unknown home instance <%C>\n", + name)); + throw ::Deployment::StopError (name, + "Wrong instance handler for home instance\n"); + } + + CIAO_DEBUG (8, (LM_DEBUG, CLINFO + "Home_Handler_i::remove_instance - " + "Attempting removal of home instance <%C>\n", + name)); + } CORBA::Any val; const char *cont_id = 0; @@ -364,7 +379,13 @@ namespace CIAO "Unknown C++ exception\n"); } - this->instances_.erase (instance); + { + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + guard, + this->instances_mutex_, + CORBA::NO_RESOURCES ()); + this->instances_.erase (instance); + } CIAO_DEBUG (4, (LM_INFO, CLINFO "Home_Handler_i::remove_instance - " diff --git a/CIAO/ciao/Deployment/Handlers/Home_Handler.h b/CIAO/ciao/Deployment/Handlers/Home_Handler.h index eb3eff5f5a4..c0fb632c29f 100644 --- a/CIAO/ciao/Deployment/Handlers/Home_Handler.h +++ b/CIAO/ciao/Deployment/Handlers/Home_Handler.h @@ -87,6 +87,7 @@ namespace CIAO private: Deployment_Common::INSTANCES instances_; + TAO_SYNCH_MUTEX instances_mutex_; }; } diff --git a/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp b/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp index e4297665533..149a96d2327 100644 --- a/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp +++ b/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp @@ -85,9 +85,11 @@ namespace CIAO name, plan.instance[index].name.in ())); + ::CosNaming::NamingContext_var ctx_safe = + ::CosNaming::NamingContext::_duplicate (this->ctx_.in ()); Name_Utilities::bind_object (name, obj.in (), - this->ctx_.in ()); + ctx_safe.in ()); } else if (ACE_OS::strcmp (inst.configProperty[i].name.in (), DAnCE::INSTANCE_IOR_FILE) == 0) @@ -98,7 +100,9 @@ namespace CIAO const char * name = 0; inst.configProperty[i].value >>= CORBA::Any::to_string (name, 0); - CORBA::String_var ior = this->orb_->object_to_string (obj.in ()); + ::CORBA::ORB_var orb_safe = + ::CORBA::ORB::_duplicate(this->orb_.in ()); + CORBA::String_var ior = orb_safe->object_to_string (obj.in ()); CIAO::Name_Utilities::write_ior (ACE_TEXT_CHAR_TO_TCHAR (name), ior.in ()); } diff --git a/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.h b/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.h index 71d67171ee9..4318a511b2e 100644 --- a/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.h +++ b/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.h @@ -69,7 +69,7 @@ namespace CIAO virtual void configure(const Deployment::Properties&); - private: + protected: CORBA::ORB_var orb_; }; } @@ -81,6 +81,9 @@ extern "C" ::DAnCE::DeploymentInterceptor_ptr CIAO_Deployment_Interceptors_Export create_CIAO_StoreReferences (void); + + ::DAnCE::DeploymentInterceptor_ptr + CIAO_Deployment_Interceptors_Export create_CIAO_ReferenceLookup (void); } #endif diff --git a/CIAO/ciao/Servants/Connector_Servant_Impl_Base.cpp b/CIAO/ciao/Servants/Connector_Servant_Impl_Base.cpp index 9f7ad54e96e..bbb297ee48a 100644 --- a/CIAO/ciao/Servants/Connector_Servant_Impl_Base.cpp +++ b/CIAO/ciao/Servants/Connector_Servant_Impl_Base.cpp @@ -56,10 +56,9 @@ namespace CIAO this->ccm_remove (); PortableServer::ObjectId_var oid; - this->container_->uninstall_servant ( - this, - Container_Types::COMPONENT_t, - oid.out ()); + cnt_safe->uninstall_servant (this, + Container_Types::COMPONENT_t, + oid.out ()); if (this->home_servant_) { @@ -481,7 +480,10 @@ namespace CIAO Connector_Servant_Impl_Base::_default_POA (void) { CIAO_TRACE("Connector_Servant_Impl_Base::_default_POA (void)"); - return container_->the_POA (); + + Container_var cnt_safe = + Container::_duplicate(this->container_.in ()); + return cnt_safe->the_POA (); } ::CORBA::Object_ptr @@ -544,6 +546,7 @@ namespace CIAO const char * receptacle_name) { CIAO_TRACE ("Connector_Servant_Impl_Base::lookup_receptacle_description"); + ::Components::ReceptacleDescriptions_var all_receptacles = this->get_all_receptacles (); diff --git a/CIAO/ciao/Servants/Extension/README b/CIAO/ciao/Servants/Extension/README new file mode 100644 index 00000000000..04a9ae87a05 --- /dev/null +++ b/CIAO/ciao/Servants/Extension/README @@ -0,0 +1,4 @@ +$Id$ + +CIAO Extension containers are incomplete, experimental and not thread safe. +They may not work as expected. diff --git a/CIAO/connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Base.idl b/CIAO/connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Base.idl new file mode 100644 index 00000000000..ee11c24c27c --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Base.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file IDL_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef IDL_TEST_BASE_IDL +#define IDL_TEST_BASE_IDL + +#pragma ndds typesupport "Base/IDL_Test_BaseSupport.h" +#pragma opendds typesupport "Base/IDL_Test_BaseTypeSupportImpl.h" + +#pragma DCPS_DATA_TYPE "IDL_Test" +#pragma DCPS_DATA_KEY "IDL_Test key" + +struct IDL_Test { + string key; //@key + long iteration; +}; + +typedef sequence<IDL_Test> IDL_TestSeq; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Base.mpc b/CIAO/connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Base.mpc new file mode 100644 index 00000000000..357f9f68406 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (IDL_Test_Base_stub) : taoidldefaults, dds4ccm_ts_default { + sharedname = IDL_Test_Base_stub + dynamicflags += IDL_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=IDL_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=IDL_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + IDL_Test_Base.idl + } + + opendds_ts_flags += --export=IDL_TEST_BASE_STUB_Export + + DDSGenerator_Files { + IDL_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/CIAO/connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Interfaces.idl b/CIAO/connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Interfaces.idl new file mode 100644 index 00000000000..516f88a3fce --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Interfaces.idl @@ -0,0 +1,18 @@ +// $Id$ + +#ifndef IDL_TEST_INTERFACES_IDL +#define IDL_TEST_INTERFACES_IDL + +#pragma ciao lem "Base/IDL_Test_InterfacesE.idl" + +interface idl_test_base_interface { + void do_something_base (); + readonly attribute string base_string_attr; +}; + +interface idl_test_derived_interface : idl_test_base_interface { + void do_something_derived (); + attribute string derived_string_attr; +}; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Interfaces.mpc b/CIAO/connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Interfaces.mpc new file mode 100644 index 00000000000..d25d6d97ef2 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/IDL_Test/Base/IDL_Test_Interfaces.mpc @@ -0,0 +1,107 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl IDL_Test_Interfaces" + +project(IDL_Test_Interfaces_idl_gen) : componentidldefaults { + custom_only = 1 + idlflags += -Wb,stub_export_macro=IDL_TEST_INTERFACES_STUB_Export \ + -Wb,stub_export_include=IDL_Test_Interfaces_stub_export.h \ + -Wb,skel_export_macro=IDL_TEST_INTERFACES_SVNT_Export \ + -Wb,skel_export_include=IDL_Test_Interfaces_svnt_export.h \ + -Wb,exec_export_macro=IDL_TEST_INTERFACES_EXEC_Export \ + -Wb,exec_export_include=IDL_Test_Interfaces_exec_export.h + + IDL_Files { + IDL_Test_Interfaces.idl + } +} + +project(IDL_Test_Interfaces_lem_gen) : ciaoidldefaults { + after += IDL_Test_Interfaces_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=IDL_TEST_INTERFACES_LEM_STUB_Export \ + -Wb,stub_export_include=IDL_Test_Interfaces_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + IDL_Test_InterfacesE.idl + } +} + +project(IDL_Test_Interfaces_lem_stub) : ccm_svnt { + after += IDL_Test_Interfaces_lem_gen \ + IDL_Test_Interfaces_stub + libs += IDL_Test_Interfaces_stub + libout = ../lib + libpaths += ../lib + + sharedname = IDL_Test_Interfaces_lem_stub + dynamicflags += IDL_TEST_INTERFACES_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_InterfacesEC.cpp + } + + Header_Files { + IDL_Test_InterfacesEC.h + IDL_Test_Interfaces_lem_stub_export.h + } + + Inline_Files { + IDL_Test_InterfacesEC.inl + } +} + +project(IDL_Test_Interfaces_stub) : ccm_stub { + after += IDL_Test_Interfaces_idl_gen + libs += + libout = ../lib + libpaths += ../lib + + sharedname = IDL_Test_Interfaces_stub + dynamicflags += IDL_TEST_INTERFACES_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_InterfacesC.cpp + } + + Header_Files { + IDL_Test_InterfacesC.h + IDL_Test_Interfaces_stub_export.h + } + + Inline_Files { + IDL_Test_InterfacesC.inl + } +} + +project(IDL_Test_Interfaces_svnt) : ccm_svnt { + after += IDL_Test_Interfaces_idl_gen IDL_Test_Interfaces_stub + libs += IDL_Test_Interfaces_stub + libout = ../lib + libpaths += ../lib + + sharedname = IDL_Test_Interfaces_svnt + dynamicflags += IDL_TEST_INTERFACES_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_InterfacesS.cpp + } + + Header_Files { + IDL_Test_InterfacesS.h + IDL_Test_Interfaces_svnt_export.h + } + + Inline_Files { + IDL_Test_InterfacesS.inl + } +} diff --git a/CIAO/connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Base_Component.idl b/CIAO/connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Base_Component.idl new file mode 100644 index 00000000000..07cab5ba2e7 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Base_Component.idl @@ -0,0 +1,34 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef BASE_COMPONENT_IDL +#define BASE_COMPONENT_IDL + +#include "Connector/IDL_Test_Connector.idl" +#include "Base/IDL_Test_Interfaces.idl" + +#pragma ciao lem "IDL_Test_Base_ComponentE.idl" +// #pragma ciao lem "Base/IDL_Test_BaseE.idl" + +component IDL_Test_Base_Component +{ + port IDL_Connector::DDS_Update info_base_update; + port IDL_Connector::DDS_Read info_base_read; + port IDL_Connector::DDS_Get info_base_get; + port IDL_Connector::DDS_Listen info_base_listen; + port IDL_Connector::DDS_StateListen info_base_state_listen; + port IDL_Connector::DDS_Write info_base_write; + + provides CCM_DDS::ConnectorStatusListener base_status_listener; + + attribute long base_attr; + + uses idl_test_derived_interface uses_derived_interface; + provides idl_test_base_interface prov_base_interface; +}; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Base_Component.mpc b/CIAO/connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Base_Component.mpc new file mode 100644 index 00000000000..02225917db1 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Base_Component.mpc @@ -0,0 +1,178 @@ +// $Id$ + +project(IDL_Test_Base_Component_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += IDL_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=BASE_COMPONENT_STUB_Export \ + -Wb,stub_export_include=Base_Component_stub_export.h \ + -Wb,skel_export_macro=BASE_COMPONENT_SVNT_Export \ + -Wb,skel_export_include=Base_Component_svnt_export.h \ + -Wb,svnt_export_macro=BASE_COMPONENT_SVNT_Export \ + -Wb,svnt_export_include=Base_Component_svnt_export.h \ + -Wb,exec_export_macro=BASE_COMPONENT_EXEC_Export \ + -Wb,exec_export_include=Base_Component_exec_export.h \ + -I.. -Gex + + IDL_Files { + IDL_Test_Base_Component.idl + } +} + +project(IDL_Test_Base_Component_lem_gen) : ciaoidldefaults, dds4ccm { + after += IDL_Test_Base_Component_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=BASE_COMPONENT_LEM_STUB_Export \ + -Wb,stub_export_include=Base_Component_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + IDL_Test_Base_ComponentE.idl + } +} + +project(IDL_Test_Base_Component_lem_stub) : ccm_svnt, dds4ccm_base { + after += IDL_Test_Base_Component_lem_gen \ + IDL_Test_Base_Component_stub \ + IDL_Test_Connector_stub \ + IDL_Test_Interfaces_stub \ + IDL_Test_Interfaces_lem_stub + libs += Base_Component_stub \ + IDL_Test_Connector_stub \ + IDL_Test_Interfaces_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Base_Component_lem_stub + dynamicflags += BASE_COMPONENT_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_Base_ComponentEC.cpp + } + + Header_Files { + IDL_Test_Base_ComponentEC.h + Base_Component_lem_stub_export.h + } + + Inline_Files { + IDL_Test_Base_ComponentEC.inl + } +} + +project(IDL_Test_Base_Component_stub) : ccm_stub, dds4ccm_base { + after += IDL_Test_Base_Component_idl_gen \ + IDL_Test_Connector_stub \ + IDL_Test_Base_stub \ + IDL_Test_Connector_lem_gen + libs += IDL_Test_Connector_stub \ + IDL_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Base_Component_stub + dynamicflags += BASE_COMPONENT_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_Base_ComponentC.cpp + } + + Header_Files { + IDL_Test_Base_ComponentC.h + Base_Component_stub_export.h + } + + Inline_Files { + IDL_Test_Base_ComponentC.inl + } +} + +project(IDL_Test_Base_Component_exec) : ciao_executor, dds4ccm_lem_stub { + after += IDL_Test_Base_Component_lem_stub \ + IDL_Test_Base_Component_stub \ + IDL_Test_Base_stub \ + IDL_Test_Connector_stub \ + IDL_Test_Connector_lem_stub \ + IDL_Test_Interfaces_stub \ + IDL_Test_Interfaces_lem_stub + sharedname = Base_Component_exec + libs += Base_Component_stub \ + Base_Component_lem_stub \ + IDL_Test_Base_stub \ + IDL_Test_Connector_stub \ + IDL_Test_Connector_lem_stub \ + IDL_Test_Interfaces_stub \ + IDL_Test_Interfaces_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags += BASE_COMPONENT_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_Base_Component_exec.cpp + } + + Header_Files { + IDL_Test_Base_Component_exec.h + Base_Component_exec_export.h + } + + Inline_Files { + } +} + + +project(IDL_Test_Base_Component_svnt) : ciao_servant, dds4ccm_lem_stub, dds4ccm_skel { + after += IDL_Test_Base_Component_lem_stub \ + IDL_Test_Base_stub \ + IDL_Test_Connector_stub \ + IDL_Test_Connector_svnt \ + IDL_Test_Base_Component_exec \ + IDL_Test_Connector_lem_stub \ + IDL_Test_Interfaces_svnt \ + IDL_Test_Interfaces_lem_stub \ + IDL_Test_Interfaces_stub + sharedname = Base_Component_svnt + libs += Base_Component_stub \ + Base_Component_lem_stub \ + IDL_Test_Base_stub \ + IDL_Test_Connector_stub \ + IDL_Test_Connector_svnt \ + Base_Component_exec \ + IDL_Test_Connector_lem_stub \ + IDL_Test_Interfaces_svnt \ + IDL_Test_Interfaces_lem_stub \ + IDL_Test_Interfaces_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags += BASE_COMPONENT_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_Base_ComponentS.cpp + IDL_Test_Base_Component_svnt.cpp + } + + Header_Files { + IDL_Test_Base_ComponentS.h + IDL_Test_Base_Component_svnt.h + Base_Component_svnt_export.h + } + + Inline_Files { + IDL_Test_Base_ComponentS.inl + } +} + + diff --git a/CIAO/connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Derived_Component.idl b/CIAO/connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Derived_Component.idl new file mode 100644 index 00000000000..24b6101f7f1 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Derived_Component.idl @@ -0,0 +1,33 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef DERIVED_COMPONENT_IDL +#define DERIVED_COMPONENT_IDL + +#include "IDL_Test_Base_Component.idl" + +#pragma ciao lem "IDL_Test_Derived_ComponentE.idl" +// #pragma ciao lem "Base/IDL_Test_BaseE.idl" + +component IDL_Test_Derived_Component : IDL_Test_Base_Component +{ + port IDL_Connector::DDS_Update info_derived_update; + port IDL_Connector::DDS_Read info_derived_read; + port IDL_Connector::DDS_Get info_derived_get; + port IDL_Connector::DDS_Listen info_derived_listen; + port IDL_Connector::DDS_StateListen info_derived_state_listen; + port IDL_Connector::DDS_Write info_derived_write; + + provides CCM_DDS::ConnectorStatusListener derived_status_listener; + + attribute long derived_attr; + + provides idl_test_derived_interface prov_derived_interface; + uses idl_test_base_interface uses_base_interface; +}; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Derived_Component.mpc b/CIAO/connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Derived_Component.mpc new file mode 100644 index 00000000000..c3ee2ecfce0 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/IDL_Test/Component/IDL_Test_Derived_Component.mpc @@ -0,0 +1,197 @@ +// $Id$ + +project(IDL_Test_Derived_Component_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += IDL_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=DERIVED_COMPONENT_STUB_Export \ + -Wb,stub_export_include=Derived_Component_stub_export.h \ + -Wb,skel_export_macro=DERIVED_COMPONENT_SVNT_Export \ + -Wb,skel_export_include=Derived_Component_svnt_export.h \ + -Wb,svnt_export_macro=DERIVED_COMPONENT_SVNT_Export \ + -Wb,svnt_export_include=Derived_Component_svnt_export.h \ + -Wb,exec_export_macro=DERIVED_COMPONENT_EXEC_Export \ + -Wb,exec_export_include=Derived_Component_exec_export.h \ + -I.. -Gex + + IDL_Files { + IDL_Test_Derived_Component.idl + } +} + +project(IDL_Test_Derived_Component_lem_gen) : ciaoidldefaults, dds4ccm { + after += IDL_Test_Derived_Component_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=DERIVED_COMPONENT_LEM_STUB_Export \ + -Wb,stub_export_include=Derived_Component_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + IDL_Test_Derived_ComponentE.idl + } +} + +project(IDL_Test_Derived_Component_lem_stub) : ccm_svnt, dds4ccm_base { + after += IDL_Test_Derived_Component_lem_gen \ + IDL_Test_Derived_Component_stub \ + IDL_Test_Connector_stub \ + IDL_Test_Base_stub \ + IDL_Test_Interfaces_stub \ + IDL_Test_Interfaces_lem_stub \ + IDL_Test_Base_Component_lem_stub + libs += Derived_Component_stub \ + IDL_Test_Connector_stub \ + IDL_Test_Base_stub \ + IDL_Test_Interfaces_stub \ + Base_Component_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Derived_Component_lem_stub + dynamicflags += DERIVED_COMPONENT_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_Derived_ComponentEC.cpp + } + + Header_Files { + IDL_Test_Derived_ComponentEC.h + Derived_Component_lem_stub_export.h + } + + Inline_Files { + IDL_Test_Derived_ComponentEC.inl + } +} + +project(IDL_Test_Derived_Component_stub) : ccm_stub, dds4ccm_base { + after += IDL_Test_Derived_Component_idl_gen \ + IDL_Test_Connector_stub \ + IDL_Test_Base_stub \ + IDL_Test_Connector_lem_gen \ + IDL_Test_Base_Component_stub \ + IDL_Test_Base_Component_lem_stub + libs += IDL_Test_Connector_stub \ + IDL_Test_Base_stub \ + Base_Component_stub \ + Base_Component_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Derived_Component_stub + dynamicflags += DERIVED_COMPONENT_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_Derived_ComponentC.cpp + } + + Header_Files { + IDL_Test_Derived_ComponentC.h + Derived_Component_stub_export.h + } + + Inline_Files { + IDL_Test_Derived_ComponentC.inl + } +} + +project(IDL_Test_Derived_Component_exec) : ciao_executor, dds4ccm_lem_stub { + after += IDL_Test_Derived_Component_lem_stub \ + IDL_Test_Derived_Component_stub \ + IDL_Test_Base_stub \ + IDL_Test_Connector_stub \ + IDL_Test_Connector_lem_stub \ + IDL_Test_Base_Component_exec \ + IDL_Test_Base_Component_lem_stub \ + IDL_Test_Interfaces_lem_stub \ + IDL_Test_Interfaces_lem + sharedname = Derived_Component_exec + libs += Derived_Component_stub \ + Derived_Component_lem_stub \ + IDL_Test_Base_stub \ + IDL_Test_Connector_stub \ + IDL_Test_Connector_lem_stub \ + Base_Component_exec \ + Base_Component_lem_stub \ + IDL_Test_Interfaces_lem_stub \ + IDL_Test_Interfaces_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags += DERIVED_COMPONENT_EXEC_BUILD_DLL BASE_COMPONENT_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_Derived_Component_exec.cpp + } + + Header_Files { + IDL_Test_Derived_Component_exec.h + Derived_Component_exec_export.h + } + + Inline_Files { + } +} + + +project(IDL_Test_Derived_Component_svnt) : ciao_servant, dds4ccm_lem_stub, dds4ccm_skel { + after += IDL_Test_Derived_Component_lem_stub \ + IDL_Test_Base_stub \ + IDL_Test_Connector_stub \ + IDL_Test_Connector_svnt \ + IDL_Test_Derived_Component_exec \ + IDL_Test_Connector_lem_stub \ + IDL_Test_Interfaces_stub \ + IDL_Test_Interfaces_lem_stub \ + IDL_Test_Interfaces_svnt \ + IDL_Test_Base_Component_svnt \ + IDL_Test_Base_Component_lem_stub \ + IDL_Test_Base_Component_stub + sharedname = Derived_Component_svnt + libs += Derived_Component_stub \ + Derived_Component_lem_stub \ + IDL_Test_Base_stub \ + IDL_Test_Connector_stub \ + IDL_Test_Connector_svnt \ + Derived_Component_exec \ + IDL_Test_Connector_lem_stub \ + IDL_Test_Interfaces_stub \ + IDL_Test_Interfaces_lem_stub \ + IDL_Test_Interfaces_svnt \ + Base_Component_svnt \ + Base_Component_lem_stub \ + Base_Component_stub + + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags += DERIVED_COMPONENT_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_Derived_ComponentS.cpp + IDL_Test_Derived_Component_svnt.cpp + } + + Header_Files { + IDL_Test_Derived_ComponentS.h + IDL_Test_Derived_Component_svnt.h + Derived_Component_svnt_export.h + } + + Inline_Files { + IDL_Test_Derived_ComponentS.inl + } +} + + diff --git a/CIAO/connectors/dds4ccm/tests/IDL_Test/Connector/IDL_Test_Connector.idl b/CIAO/connectors/dds4ccm/tests/IDL_Test/Connector/IDL_Test_Connector.idl new file mode 100644 index 00000000000..6e16c944627 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/IDL_Test/Connector/IDL_Test_Connector.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file IDL_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef IDL_TEST_CONNECTOR_IDL_ +#define IDL_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include <ccm_dds.idl> + +#include "Base/IDL_Test_Base.idl" + +#pragma ciao lem "Connector/IDL_Test_ConnectorE.idl" + +module ::CCM_DDS::Typed < ::IDL_Test, ::IDL_TestSeq> IDL_Connector; + +#endif /* IDL_Test_CONNECTOR_IDL_ */ diff --git a/CIAO/connectors/dds4ccm/tests/IDL_Test/Connector/IDL_Test_Connector.mpc b/CIAO/connectors/dds4ccm/tests/IDL_Test/Connector/IDL_Test_Connector.mpc new file mode 100644 index 00000000000..7d8aa1f4fb1 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/IDL_Test/Connector/IDL_Test_Connector.mpc @@ -0,0 +1,144 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p IDL_Test_Base -l .. -o ../lib -u DDS IDL_Test_Connector" + +project(IDL_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=EVENT_MEMLEAKDETECTION_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=IDL_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=EVENT_MEMLEAKDETECTION_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=IDL_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=EVENT_MEMLEAKDETECTION_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=IDL_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=EVENT_MEMLEAKDETECTION_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=IDL_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + IDL_Test_Connector.idl + } +} + +project(IDL_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += IDL_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=EVENT_MEMLEAKDETECTION_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=IDL_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + IDL_Test_ConnectorE.idl + } +} + +project(IDL_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_lem_stub { + after += IDL_Test_Connector_lem_gen IDL_Test_Connector_stub IDL_Test_Base_stub + libs += IDL_Test_Base_stub IDL_Test_Connector_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = IDL_Test_Connector_lem_stub + dynamicflags += EVENT_MEMLEAKDETECTION_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_ConnectorEC.cpp + } + + Header_Files { + IDL_Test_ConnectorEC.h + IDL_Test_Connector_lem_stub_export.h + } + + Inline_Files { + IDL_Test_ConnectorEC.inl + } +} + +project(IDL_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += IDL_Test_Connector_idl_gen IDL_Test_Base_stub + libs += IDL_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = IDL_Test_Connector_stub + dynamicflags += EVENT_MEMLEAKDETECTION_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_ConnectorC.cpp + } + + Header_Files { + IDL_Test_ConnectorC.h + IDL_Test_Connector_stub_export.h + } + + Inline_Files { + IDL_Test_ConnectorC.inl + } +} + +project(IDL_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += IDL_Test_Connector_lem_stub IDL_Test_Connector_stub + sharedname = IDL_Test_Connector_exec + libs += IDL_Test_Connector_stub IDL_Test_Connector_lem_stub IDL_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags += EVENT_MEMLEAKDETECTION_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_Connector_conn.cpp + } + + Header_Files { + IDL_Test_Connector_conn.h + IDL_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(IDL_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += IDL_Test_Connector_lem_stub IDL_Test_Connector_exec IDL_Test_Connector_stub + sharedname = IDL_Test_Connector_svnt + libs += IDL_Test_Connector_stub \ + IDL_Test_Connector_lem_stub \ + IDL_Test_Base_stub \ + IDL_Test_Connector_exec + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags += EVENT_MEMLEAKDETECTION_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + IDL_Test_ConnectorS.cpp + IDL_Test_Connector_svnt.cpp + } + + Header_Files { + IDL_Test_ConnectorS.h + IDL_Test_Connector_svnt.h + IDL_Test_Connector_svnt_export.h + } + + Inline_Files { + IDL_Test_ConnectorS.inl + } +} + + diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/DDS/Base/Base.mpc b/CIAO/connectors/dds4ccm/tests/QueryCondition/DDS/Base/Base.mpc index 1390b8ab990..7f7f0e89155 100755 --- a/CIAO/connectors/dds4ccm/tests/QueryCondition/DDS/Base/Base.mpc +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/DDS/Base/Base.mpc @@ -1,7 +1,7 @@ // $Id$ -project(Base_stub) : ndds_ts_defaults, nddslib { - sharedname = Base_stub +project(QC_Base_stub) : ndds_ts_defaults, nddslib { + sharedname = QC_Base_stub dynamicflags += NDDS_USER_DLL_EXPORT libout = ../descriptors diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/DDS/DDS_Receiver/DDS_Receiver.mpc b/CIAO/connectors/dds4ccm/tests/QueryCondition/DDS/DDS_Receiver/DDS_Receiver.mpc index 920505cdd81..f9ef365f6be 100644 --- a/CIAO/connectors/dds4ccm/tests/QueryCondition/DDS/DDS_Receiver/DDS_Receiver.mpc +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/DDS/DDS_Receiver/DDS_Receiver.mpc @@ -2,11 +2,11 @@ project(*qc_receiver) : aceexe, nddslib, ndds_ts_defaults { exename = DDS_receiver - after += Base_stub + after += QC_Base_stub includes += ../Base - libs += Base_stub + libs += QC_Base_stub libpaths += ../descriptors exeout += ../descriptors diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/DDS/DDS_Sender/DDS_Sender.mpc b/CIAO/connectors/dds4ccm/tests/QueryCondition/DDS/DDS_Sender/DDS_Sender.mpc index 72aa1a8c62a..0b7106f40f7 100644 --- a/CIAO/connectors/dds4ccm/tests/QueryCondition/DDS/DDS_Sender/DDS_Sender.mpc +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/DDS/DDS_Sender/DDS_Sender.mpc @@ -2,12 +2,12 @@ project(*qc_sender) : aceexe, nddslib, ndds_ts_defaults { exename = DDS_Sender - after += Base_stub + after += QC_Base_stub includes += ../Base exeout += ../descriptors - libs += Base_stub + libs += QC_Base_stub libpaths += ../descriptors Source_Files { diff --git a/CIAO/tests/IDL_Test/Inherited_Component/Extended/Base.idl b/CIAO/tests/IDL_Test/Inherited_Component/Extended/Base.idl new file mode 100644 index 00000000000..7eaae4f5743 --- /dev/null +++ b/CIAO/tests/IDL_Test/Inherited_Component/Extended/Base.idl @@ -0,0 +1,37 @@ +// $Id$ + +#ifndef BASE_IDL +#define BASE_IDL + +#include <Components.idl> + +#pragma ciao lem "BaseE.idl" + +module Inherited +{ + interface base_interface { + void do_base (); + + attribute string str_base_interface; + }; + + // TODO: derive this interface from a base interface... + interface derived_interface { + void do_derived (); + + readonly attribute string str_derived_interface; + }; +}; + +module Inherited +{ + component Base_comp + { + provides Inherited::base_interface prov_base; + uses Inherited::base_interface uses_base; + + attribute long base; + }; +}; + +#endif diff --git a/CIAO/tests/IDL_Test/Inherited_Component/Extended/Base.mpc b/CIAO/tests/IDL_Test/Inherited_Component/Extended/Base.mpc new file mode 100644 index 00000000000..f61c1cff337 --- /dev/null +++ b/CIAO/tests/IDL_Test/Inherited_Component/Extended/Base.mpc @@ -0,0 +1,127 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl Base" + +project(Base_idl_gen) : componentidldefaults { + custom_only = 1 + idlflags += -Wb,stub_export_macro=BASE_STUB_Export \ + -Wb,stub_export_include=Base_stub_export.h \ + -Wb,skel_export_macro=BASE_SVNT_Export \ + -Wb,skel_export_include=Base_svnt_export.h \ + -Wb,exec_export_macro=BASE_EXEC_Export \ + -Wb,exec_export_include=Base_exec_export.h \ + -Gex + + IDL_Files { + Base.idl + } +} + +project(Base_lem_gen) : ciaoidldefaults { + after += Base_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=BASE_LEM_STUB_Export \ + -Wb,stub_export_include=Base_lem_stub_export.h \ + -SS -Gxhst + + IDL_Files { + BaseE.idl + } +} + +project(Base_lem_stub) : ccm_svnt { + after += Base_lem_gen Base_stub + libs += Base_stub + + sharedname = Base_lem_stub + dynamicflags += BASE_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + BaseEC.cpp + } + + Header_Files { + BaseEC.h + Base_lem_stub_export.h + } + + Inline_Files { + BaseEC.inl + } +} + +project(Base_stub) : ccm_stub { + after += Base_idl_gen + libs += + + sharedname = Base_stub + dynamicflags += BASE_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + BaseC.cpp + } + + Header_Files { + BaseC.h + Base_stub_export.h + } + + Inline_Files { + BaseC.inl + } +} + +project(Base_exec) : ciao_executor { + after += Base_lem_stub Base_stub + sharedname = Base_exec + libs += Base_stub Base_lem_stub + + dynamicflags += BASE_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Base_exec.cpp + } + + Header_Files { + Base_exec.h + Base_exec_export.h + } + + Inline_Files { + } +} + + +project(Base_svnt) : ciao_servant { + after += Base_lem_stub + sharedname = Base_svnt + libs += Base_stub Base_lem_stub + + dynamicflags += BASE_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + BaseS.cpp + Base_svnt.cpp + } + + Header_Files { + BaseS.h + Base_svnt.h + Base_svnt_export.h + } + + Inline_Files { + BaseS.inl + } +} diff --git a/CIAO/tests/IDL_Test/Inherited_Component/Extended/Derived.idl b/CIAO/tests/IDL_Test/Inherited_Component/Extended/Derived.idl new file mode 100644 index 00000000000..e409001b64a --- /dev/null +++ b/CIAO/tests/IDL_Test/Inherited_Component/Extended/Derived.idl @@ -0,0 +1,32 @@ +// $Id$ + +#ifndef DERIVED_IDL +#define DERIVED_IDL + +#include <Components.idl> + +#include "Base.idl" + +#pragma ciao lem "DerivedE.idl" + +module Inherited +{ + interface Tester + { + void set_long_base (in long base); + long get_long_base (); + + void set_long_derived (in long derived); + long get_long_derived (); + }; + + component Derived_comp : Inherited::Base_comp supports Inherited::Tester + { + provides Inherited::derived_interface prov_derived; + uses Inherited::derived_interface uses_derived; + + attribute long derived; + }; +}; + +#endif diff --git a/CIAO/tests/IDL_Test/Inherited_Component/Extended/Derived.mpc b/CIAO/tests/IDL_Test/Inherited_Component/Extended/Derived.mpc new file mode 100644 index 00000000000..6d4d8337d77 --- /dev/null +++ b/CIAO/tests/IDL_Test/Inherited_Component/Extended/Derived.mpc @@ -0,0 +1,162 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p IhC_Foo Derived" + +project(Base_Derived_idl_gen) : componentidldefaults { + custom_only = 1 + after += Base_idl_gen + idlflags += -Wb,stub_export_macro=DERIVED_STUB_Export \ + -Wb,stub_export_include=Derived_stub_export.h \ + -Wb,skel_export_macro=DERIVED_SVNT_Export \ + -Wb,skel_export_include=Derived_svnt_export.h \ + -Wb,exec_export_macro=DERIVED_EXEC_Export \ + -Wb,exec_export_include=Derived_exec_export.h \ + -Gex + + IDL_Files { + Derived.idl + } +} + +project(Base_Derived_lem_gen) : ciaoidldefaults { + after += Base_Derived_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=DERIVED_LEM_STUB_Export \ + -Wb,stub_export_include=Derived_lem_stub_export.h \ + -SS -Gxhst + + IDL_Files { + DerivedE.idl + } +} + +project(Base_Derived_lem_stub) : ccm_svnt { + after += Base_Derived_lem_gen \ + Base_Derived_stub \ + Base_stub \ + Base_lem_stub + libs += Base_stub \ + Base_lem_stub \ + Derived_stub + + sharedname = Derived_lem_stub + dynamicflags += DERIVED_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + DerivedEC.cpp + } + + Header_Files { + DerivedEC.h + Derived_lem_stub_export.h + } + + Inline_Files { + DerivedEC.inl + } +} + +project(Base_Derived_stub) : ccm_stub { + after += Base_Derived_idl_gen Base_stub + libs += Base_stub + + sharedname = Derived_stub + dynamicflags += DERIVED_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + DerivedC.cpp + } + + Header_Files { + DerivedC.h + Derived_stub_export.h + } + + Inline_Files { + DerivedC.inl + } +} + +project(Base_Derived_exec) : ciao_executor { + after += Base_Derived_lem_stub \ + Base_Derived_stub \ + Base_exec + sharedname = Derived_exec + libs += Derived_stub \ + Derived_lem_stub \ + Base_stub \ + Base_lem_stub \ + Base_exec + + dynamicflags += DERIVED_EXEC_BUILD_DLL BASE_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Derived_exec.cpp + } + + Header_Files { + Derived_exec.h + Derived_exec_export.h + } + + Inline_Files { + } +} + + +project(Base_Derived_svnt) : ciao_servant { + after += Base_svnt Base_Derived_lem_stub + sharedname = Derived_svnt + libs += Derived_stub \ + Derived_lem_stub \ + Base_stub \ + Base_lem_stub \ + Base_svnt + + dynamicflags += DERIVED_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + DerivedS.cpp + Derived_svnt.cpp + } + + Header_Files { + DerivedS.h + Derived_svnt.h + Derived_svnt_export.h + } + + Inline_Files { + DerivedS.inl + } +} + +project (Derived_Tester) : ccm_stub, valuetype { + exename = Tester + after += Base_Derived_stub + libs += Derived_stub Base_stub + + IDL_Files { + } + + Source_Files { + Tester.cpp + } + + Header_Files { + } + + Inline_Files { + } +} diff --git a/CIAO/tests/IDL_Test/Inherited_Component/Extended/Tester.cpp b/CIAO/tests/IDL_Test/Inherited_Component/Extended/Tester.cpp new file mode 100644 index 00000000000..cfde3670c43 --- /dev/null +++ b/CIAO/tests/IDL_Test/Inherited_Component/Extended/Tester.cpp @@ -0,0 +1,81 @@ +//$Id$ +/* + * @file Tester.cpp + * + * @author Marcel Smit + */ + + +#include "DerivedC.h" +#include "ace/streams.h" +#include "ace/Get_Opt.h" + +const ACE_TCHAR *tester_ior = ACE_TEXT ("file://Derived.ior"); + +int +parse_args (int argc, ACE_TCHAR *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("ek:n:")); + int c; + + while ((c = get_opts ()) != -1) + { + switch (c) + { + case 'k': + tester_ior = get_opts.opt_arg (); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s\n" + "-k <Derived IOR> (default is file://Derived.ior)\n" + "\n", + argv [0]), + -1); + } + } + + return 0; +} + + +int ACE_TMAIN (int argc, ACE_TCHAR* argv[]) +{ + try + { + // initialize the ORB + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv); + if (parse_args (argc, argv) != 0) + { + return -1; + } + + // create the factory object reference, + CORBA::Object_var tester_obj = + orb->string_to_object (tester_ior); + + // downcast the object reference to the appropriate type + ::Inherited::Tester_var tester = + ::Inherited::Tester::_narrow (tester_obj.in ()); + + if (CORBA::is_nil (tester.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Unable to acquire 'Tester' objref\n"), + -1); + } + + orb->destroy (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Who is the culprit in the Tester?\n"); + ACE_ERROR_RETURN ((LM_ERROR, + "Uncaught CORBA exception\n"), + 1); + } + return 0; +} diff --git a/CIAO/tests/IDL_Test/Inherited_Component/IhC_Bar.mpc b/CIAO/tests/IDL_Test/Inherited_Component/IhC_Bar.mpc index c314053ebd6..e6223176d1b 100644 --- a/CIAO/tests/IDL_Test/Inherited_Component/IhC_Bar.mpc +++ b/CIAO/tests/IDL_Test/Inherited_Component/IhC_Bar.mpc @@ -60,7 +60,7 @@ project(IhC_Foo_IhC_Bar_lem_stub) : ccm_svnt { project(IhC_Foo_IhC_Bar_stub) : ccm_stub { after += IhC_Foo_IhC_Bar_idl_gen IhC_Foo_stub - libs += IhC_Foo_stub + libs += IhC_Foo_stub sharedname = IhC_Bar_stub dynamicflags += IHC_BAR_STUB_BUILD_DLL @@ -93,7 +93,7 @@ project(IhC_Foo_IhC_Bar_exec) : ciao_executor { IhC_Foo_lem_stub \ IhC_Foo_exec - dynamicflags += IHC_BAR_EXEC_BUILD_DLL + dynamicflags += IHC_BAR_EXEC_BUILD_DLL IHC_FOO_EXEC_BUILD_DLL IDL_Files { } diff --git a/DAnCE/ChangeLog b/DAnCE/ChangeLog index 0725b36ccfe..0e4921f8072 100644 --- a/DAnCE/ChangeLog +++ b/DAnCE/ChangeLog @@ -1,3 +1,43 @@ +Wed Nov 02 08:30:13 UTC 2011 Martin Corino <mcorino@remedy.nl> + + Merged changes from Remedy work branch. + + === start changelog === + + Thu Oct 27 10:10:00 UTC 2011 Martin Corino <mcorino@remedy.nl> + + * bin/ciao.localityconfig: + + Added CIAO_ReferenceLookup interceptor. + + * dance/LocalityManager/Daemon/Locality_Manager_Impl.cpp: + + Added collection of connections with exernalReference endpoints + to LocalityManager_i::collect_references (without resolving). + Resolving the references is deferred to be handled in a + deployment interceptor. This allows for more control in the + exact setup of external references without the overhead of + unnecessary/unwanted resolution attempts based on (incorrect) + assumptions of the nature of the external references. + + * dance/Plan_Launcher/Plan_Launcher_Base.h: + * dance/Plan_Launcher/Plan_Launcher_Base_Impl_T.h: + * dance/Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp: + + Removed create_external_connections() method. + + Wed Oct 26 10:13:47 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * tools/Domain_Validator/CORBA/CORBA_Domain_Validator.mpc: + Using the correct dynamic flag now. + + Wed Oct 26 09:44:25 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * tools/Domain_Validator/CORBA/CORBA_Domain_Validator.mpc: + Merged Will's solution for compile issues on windows. + + === end changelog === + Tue Nov 1 13:18:21 UTC 2011 William R. Otte <wotte@dre.vanderbilt.edu> * dance/LocalityManager/Daemon/Locality_Manager_Impl.cpp: diff --git a/DAnCE/dance/Plan_Launcher/Plan_Launcher_Base.h b/DAnCE/dance/Plan_Launcher/Plan_Launcher_Base.h index a06cc62433c..ccad13bd487 100644 --- a/DAnCE/dance/Plan_Launcher/Plan_Launcher_Base.h +++ b/DAnCE/dance/Plan_Launcher/Plan_Launcher_Base.h @@ -51,6 +51,7 @@ namespace DAnCE /// Instructs the Manager to destroy the ApplicationManager. virtual void destroy_app_manager (CORBA::Object_ptr app_mgr) = 0; + }; } diff --git a/DAnCE/tools/Domain_Validator/CORBA/CORBA_Domain_Validator.mpc b/DAnCE/tools/Domain_Validator/CORBA/CORBA_Domain_Validator.mpc index a49d9969717..7ccb9c8551a 100644 --- a/DAnCE/tools/Domain_Validator/CORBA/CORBA_Domain_Validator.mpc +++ b/DAnCE/tools/Domain_Validator/CORBA/CORBA_Domain_Validator.mpc @@ -5,7 +5,6 @@ project(DAnCE_CORBA_Domain_Validator) : dance_config_handlers, dance_deployment_ after += DAnCE_Domain_Validator_Base libs += DAnCE_Domain_Validator_Base - dynamicflags += CORBA_DOMAIN_VALIDATOR_BUILD_DLL Header_Files { diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 59601c63f34..901d48cd6ca 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,221 @@ +Wed Nov 02 08:30:13 UTC 2011 Martin Corino <mcorino@remedy.nl> + + Merged changes from Remedy work branch. + + === start changelog === + + Tue Nov 1 14:29:07 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * TAO_IDL/be/be_visitor_component/executor_exs.cpp: + Fixed link issues on windows. + + Tue Nov 1 12:52:03 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * TAO_IDL/be/be_visitor_component/component_ex_idl.cpp: + * TAO_IDL/be/be_visitor_component/component_exh.cpp: + * TAO_IDL/be/be_visitor_component/executor_exh.cpp: + * TAO_IDL/be/be_visitor_component/executor_exs.cpp: + Reverted a few of my last changes. An derived executor + is not directly derived from its base anymore (on + executor IDL level as well as on implementation level). + + Mon Oct 31 15:14:05 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * TAO_IDL/be/be_type.cpp: + Fixed new line. + + Fri Oct 28 11:22:03 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * tests/Bug_3768_Regression/TestCallback.cpp: + * tests/Bug_3768_Regression/TestServer.cpp: + * tests/Bug_3768_Regression/client.cpp: + * tests/Bug_3768_Regression/server.cpp: + Fuzz. + + Fri Oct 28 10:35:06 UTC 2011 Martin Corino <mcorino@remedy.nl> + + * tests/Bug_3531b_Regression/server.cpp: + + Fix for Windoze runtime problem with TSS. + + Fri Oct 28 10:22:48 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * TAO_IDL/be/be_array.cpp: + * TAO_IDL/be/be_codegen.cpp: + * TAO_IDL/be/be_component.cpp: + * TAO_IDL/be/be_interface.cpp: + * TAO_IDL/be/be_type.cpp: + * TAO_IDL/be/be_visitor_array/any_op_cs.cpp: + * TAO_IDL/be/be_visitor_array/array_ch.cpp: + * TAO_IDL/be/be_visitor_array/array_cs.cpp: + * TAO_IDL/be/be_visitor_component/servant_svh.cpp: + * TAO_IDL/be/be_visitor_component/servant_svs.cpp: + * TAO_IDL/be/be_visitor_connector/facet_ami_exs.cpp: + * TAO_IDL/be/be_visitor_exception/any_op_cs.cpp: + * TAO_IDL/be/be_visitor_exception/exception_ch.cpp: + * TAO_IDL/be/be_visitor_exception/exception_cs.cpp: + * TAO_IDL/be/be_visitor_interface/amh_rh_ss.cpp: + * TAO_IDL/be/be_visitor_interface/amh_ss.cpp: + * TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp: + * TAO_IDL/be/be_visitor_interface/interface_cs.cpp: + * TAO_IDL/be/be_visitor_interface/interface_ih.cpp: + * TAO_IDL/be/be_visitor_interface/interface_ss.cpp: + * TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp: + * TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp: + * TAO_IDL/be/be_visitor_operation/amh_sh.cpp: + * TAO_IDL/be/be_visitor_operation/amh_ss.cpp: + * TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp: + * TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp: + * TAO_IDL/be/be_visitor_operation/operation_ch.cpp: + * TAO_IDL/be/be_visitor_operation/operation_ss.cpp: + * TAO_IDL/be/be_visitor_operation/tie_ss.cpp: + * TAO_IDL/be/be_visitor_root/root_ch.cpp: + * TAO_IDL/be/be_visitor_root/root_sth.cpp: + * TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp: + * TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp: + * TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp: + * TAO_IDL/be/be_visitor_structure/any_op_cs.cpp: + * TAO_IDL/be/be_visitor_structure/structure_cs.cpp: + * TAO_IDL/be/be_visitor_template_export.cpp: + * TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp: + * TAO_IDL/be/be_visitor_union/any_op_cs.cpp: + * TAO_IDL/be/be_visitor_union/discriminant_ci.cpp: + * TAO_IDL/be/be_visitor_union_branch/public_ci.cpp: + * TAO_IDL/be/be_visitor_valuebox/cdr_op_cs.cpp: + * TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp: + * TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp: + * TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp: + * TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp: + * TAO_IDL/be/be_visitor_valuetype/field_cs.cpp: + * TAO_IDL/be/be_visitor_valuetype/valuetype.cpp: + * TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp: + * TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp: + * TAO_IDL/be/be_visitor_valuetype/valuetype_init_cs.cpp: + * TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp: + Reduced whitespaces in generated code. + + * TAO_IDL/be/be_visitor_interface/tie_ss.cpp: + Removed tabs from generated code. + + + Fri Oct 28 09:23:52 UTC 2011 Martin Corino <mcorino@remedy.nl> + + * tests/Bug_3531b_Regression/server.cpp: + + Fix for Windoze compile problem. + + Fri Oct 28 07:36:43 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * TAO_IDL/be/be_visitor_component/executor_exh.cpp: + * TAO_IDL/be/be_visitor_component/executor_exs.cpp: + * TAO_IDL/be/be_visitor_component/executor_private_exh.cpp: + * TAO_IDL/be/be_visitor_component/facet_exh.cpp: + * TAO_IDL/be/be_visitor_component/facet_exs.cpp: + Fixed compile issues. + + Thu Oct 27 08:05:28 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * TAO_IDL/be/be_visitor_component/executor_exh.cpp: + * TAO_IDL/be/be_visitor_component/executor_exs.cpp: + Removed the overrides of _is_a, marshal and _repository_id since + these methods are not needed anymore. + + Wed Oct 26 13:38:02 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * TAO_IDL/be/be_visitor_component/component_ex_idl.cpp: + * TAO_IDL/be/be_visitor_component/component_exh.cpp: + * TAO_IDL/be/be_visitor_component/component_exs.cpp: + * TAO_IDL/be/be_visitor_component/executor_exh.cpp: + * TAO_IDL/be/be_visitor_component/executor_exs.cpp: + * TAO_IDL/be/be_visitor_component/executor_exs_attr_init.cpp: + * TAO_IDL/be/be_visitor_component/executor_private_exh.cpp: + * TAO_IDL/be/be_visitor_component/facet_exh.cpp: + * TAO_IDL/be/be_visitor_component/facet_exs.cpp: + Fixed issues regarding derived components. Derived component + were not derived from the base implementation. Instead of deriving + from the base implementation, a whole new base executor was + generated and still wasn't derived from this. Now there's + one base implementation where the derived executor is derived from. + + * TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp: + Fixed compile issues when a derived interface supports + another interface. + + Mon Oct 24 11:50:33 UTC 2011 Martin Corino <mcorino@remedy.nl> + + * tao/Connection_Handler.cpp: + * tao/Leader_Follower.h: + * tao/Leader_Follower.inl: + * tao/Leader_Follower.cpp: + * tao/Wait_On_LF_No_Upcall.h: + * tao/Wait_On_LF_No_Upcall.cpp: + * tao/Wait_On_Leader_Follower.h: + * tao/Wait_Strategy.h: + * tao/Wait_Strategy.cpp: + + Implemented a solution for two known problems: + a) deadlocking possibility because of upcall handling + in client leader threads without abdicating + leadership + b) inefficient handling of nested upcalls in + client leader threads in case MT_NOUPCALL + strategy + This solution implements leadership abdication + (as also proposed by Russell Mora in Bugzilla #3531 + and David Kinder in Bugzilla #3768) when a client + leader thread receives an upcall (triggering a + call to Leader_Follower::set_upcall_thread) so + any waiting (regular) leader thread could now + take over. Futhermore leader abdication for client + leader threads is also implemented in case an event + causes a client leader thread to wake up and it detects + leader threads waiting which are capable to take over + leadership. + With this out of the way the solution for MT_NOUPCALL + could now be optimized with a 'handle deferring' + mechanism which allows a client leader thread to + temporarily defer an upcall until the client leader + thread has abdicated and leadership switches (which + should happen almost immediately after the client + leader thread deferred the upcall handle(r)). + + * tao/Resume_Handle_Deferred.h: + * tao/Resume_Handle_Deferred.cpp: + + Removed these files. Part of previous, non-optimal, + MT_NOUPCALL solution. + + * tao/tao.mpc: + + Removed Resume_Handle_Deferred.{h,cpp} + + * tests/Bug_3531b_Regression/Bug_3531b_Regression.mpc: + * tests/Bug_3531b_Regression/server.cpp: + + Fixed compile problems due to TAO version + incompatibilities and removed dummy_label + restriction. + + * tests/Bug_3768_Regression: + * tests/Bug_3768_Regression/Bug_3768_Test.mpc: + * tests/Bug_3768_Regression/Test.idl: + * tests/Bug_3768_Regression/TestCallback.h: + * tests/Bug_3768_Regression/TestCallback.cpp: + * tests/Bug_3768_Regression/TestServer.h: + * tests/Bug_3768_Regression/TestServer.cpp: + * tests/Bug_3768_Regression/client.cpp: + * tests/Bug_3768_Regression/run_test.pl: + * tests/Bug_3768_Regression/server.cpp: + + Added new test for Bugzilla #3768. + + * bin/tao_orb_tests.lst + + Added Bug_3531_Regression, Bug_3531b_Regression and + Bug_3768_Regression to regular test runs. + + === end changelog === + Tue Nov 01 14:34:13 UTC 2011 Marijke Hengstmengel <mhengstmengel@remedy.nl> * On_Demand_Act_Direct_Coll/Collocated_Test.cpp: * On_Demand_Act_Direct_Coll/test_i.cpp: @@ -5,7 +223,7 @@ Tue Nov 01 14:34:13 UTC 2011 Marijke Hengstmengel <mhengstmengel@remedy.nl> * On_Demand_Act_Direct_Coll/Client_Task.cpp: * On_Demand_Act_Direct_Coll/test.idl: Clean up test. - + Tue Nov 01 10:54:13 UTC 2011 Martin Corino <mcorino@remedy.nl> diff --git a/TAO/TAO_IDL/be/be_array.cpp b/TAO/TAO_IDL/be/be_array.cpp index 67bc226edf6..90d82b9226e 100644 --- a/TAO/TAO_IDL/be/be_array.cpp +++ b/TAO/TAO_IDL/be/be_array.cpp @@ -254,7 +254,7 @@ be_array::gen_ostream_operator (TAO_OutStream *os, // automatically converting back to xxx_slice *. *os << be_nl << "std::ostream& operator<< (" << be_idt << be_idt_nl - << "std::ostream &strm, " << be_nl + << "std::ostream &strm," << be_nl << "const " << arg_name.c_str () << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp index 052936f6589..856b20614c4 100644 --- a/TAO/TAO_IDL/be/be_codegen.cpp +++ b/TAO/TAO_IDL/be/be_codegen.cpp @@ -647,7 +647,7 @@ TAO_CodeGen::start_server_skeletons (const char *fname) return -1; } - *this->server_skeletons_ << be_nl_2 << "// TAO_IDL - Generated from " + *this->server_skeletons_ << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; @@ -721,7 +721,7 @@ TAO_CodeGen::start_server_template_skeletons (const char *fname) return -1; } - *this->server_template_skeletons_ << be_nl << "// TAO_IDL - Generated from " + *this->server_template_skeletons_ << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; @@ -1489,7 +1489,7 @@ TAO_CodeGen::start_implementation_header (const char *fname) return -1; } - *this->implementation_header_ << be_nl << "// TAO_IDL - Generated from " + *this->implementation_header_ << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; @@ -1546,7 +1546,7 @@ TAO_CodeGen::start_implementation_skeleton (const char *fname) return -1; } - *this->implementation_skeleton_ << be_nl << "// TAO_IDL - Generated from " + *this->implementation_skeleton_ << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; @@ -1743,7 +1743,7 @@ TAO_CodeGen::end_implementation_header (const char *fname) int TAO_CodeGen::end_server_template_header (void) { - *this->server_template_header_ << be_nl_2 << "// TAO_IDL - Generated from " + *this->server_template_header_ << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << "\n"; diff --git a/TAO/TAO_IDL/be/be_component.cpp b/TAO/TAO_IDL/be/be_component.cpp index 68a612fb86f..1c3b3c455b6 100644 --- a/TAO/TAO_IDL/be/be_component.cpp +++ b/TAO/TAO_IDL/be/be_component.cpp @@ -302,7 +302,7 @@ be_component::gen_stub_inheritance (TAO_OutStream *os) for (long i = 0; i < nsupports; ++i) { - *os << ", " << be_nl + *os << "," << be_nl << "public virtual ::" << supp_list[i]->name (); } diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp index dca37dd5cf7..b0028396a15 100644 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ b/TAO/TAO_IDL/be/be_interface.cpp @@ -2189,7 +2189,7 @@ be_interface::gen_skel_helper (be_interface *derived, *os << "static void" << be_nl << d->local_name () << "_skel (" << be_idt << be_idt_nl - << "TAO_ServerRequest & server_request, " << be_nl + << "TAO_ServerRequest & server_request," << be_nl << "void * servant_upcall," << be_nl << "void * servant);" << be_uidt << be_uidt; diff --git a/TAO/TAO_IDL/be/be_type.cpp b/TAO/TAO_IDL/be/be_type.cpp index 4f8547ad54b..6ba88d65d0f 100644 --- a/TAO/TAO_IDL/be/be_type.cpp +++ b/TAO/TAO_IDL/be/be_type.cpp @@ -28,6 +28,7 @@ #include "utl_identifier.h" #include "idl_defines.h" #include "nr_extern.h" +#include <TAO_IDL/be_include/be_helper.h> be_type::be_type (AST_Decl::NodeType nt, UTL_ScopedName *n) @@ -274,7 +275,7 @@ be_type::gen_common_varout (TAO_OutStream *os) << be_idt << be_idt_nl << this->local_name () << be_uidt_nl << ">" << be_uidt_nl - << this->local_name () << "_var;" << be_uidt_nl << be_nl; + << this->local_name () << "_var;" << be_uidt << be_nl_2; if (st == AST_Type::FIXED) { @@ -304,17 +305,14 @@ be_type::gen_stub_decls (TAO_OutStream *os) *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__; - - *os << be_nl; + << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; AST_Interface *i = AST_Interface::narrow_from_decl (this); AST_ValueType *v = AST_ValueType::narrow_from_decl (this); if (i != 0) { - *os << be_nl - << "typedef " << this->local_name () + *os << "typedef " << this->local_name () << (v == 0 ? "_ptr" : " *") << " _ptr_type;"; } diff --git a/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp index 79dbcaaad22..05d999bc283 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp @@ -41,7 +41,7 @@ be_visitor_array_any_op_cs::visit_array (be_array *node) TAO_OutStream *os = this->ctx_->stream (); *os << be_nl_2 - << "// TAO_IDL - Generated from " << be_nl + << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; *os << be_global->core_versioning_begin () << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp index 47c6384e8f8..498d8cccb1f 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp @@ -52,7 +52,7 @@ int be_visitor_array_ch::visit_array (be_array *node) AST_Decl::NodeType nt = bt->node_type (); - *os << be_nl_2 << "// TAO_IDL - Generated from " << be_nl + *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " __FILE__ << ":" << __LINE__; // If we contain an anonymous sequence, diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp index 70bcfd15cbb..f6c3eeb1137 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp @@ -154,7 +154,7 @@ int be_visitor_array_cs::visit_array (be_array *node) *os << "}" << be_nl_2; // copy method. - *os << "void " << be_nl; + *os << "void" << be_nl; *os << fname << "_copy (" << be_idt << be_idt_nl << fname << "_slice * _tao_to," << be_nl << "const " << fname << "_slice *_tao_from)" << be_uidt diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp index 0a6d0a0e3cc..1d401a243f7 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp @@ -89,10 +89,12 @@ be_visitor_component_ex_idl::visit_component ( os_ << "local interface " << lname << "_Exec" << be_idt_nl << ": " << global << sname << "::CCM_" << lname - << "," << be_idt_nl - << "::Components::" << be_global->ciao_container_type () - << "Component" << be_uidt << be_uidt_nl - << "{" << be_nl + << "," << be_idt_nl; + + os_ << "::Components::" << be_global->ciao_container_type () + << "Component" << be_uidt << be_uidt_nl; + + os_ << "{" << be_nl << "};"; os_ << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp index 9b652118d59..b89e9cb106b 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp @@ -30,6 +30,11 @@ be_visitor_component_exh::~be_visitor_component_exh (void) int be_visitor_component_exh::visit_component (be_component *node) { + if (node->imported ()) + { + return 0; + } + this->node_ = node; /// CIDL-generated namespace used 'CIDL_' + composition name. diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp index 38b2f4ed57f..d48f2e0cc2e 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp @@ -30,6 +30,12 @@ be_visitor_component_exs::~be_visitor_component_exs (void) int be_visitor_component_exs::visit_component (be_component *node) { + + if (node->imported ()) + { + return 0; + } + node_ = node; /// CIDL-generated namespace used 'CIDL_' + composition name. diff --git a/TAO/TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp b/TAO/TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp index afe0d6f703d..c614714265e 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp @@ -41,8 +41,6 @@ be_visitor_executor_ex_idl::visit_component ( if (base == 0) { os_ << "::Components::EnterpriseComponent"; - - this->gen_supported (); } else { @@ -57,6 +55,8 @@ be_visitor_executor_ex_idl::visit_component ( << base->original_local_name ()->get_string (); } + this->gen_supported (); + os_ << be_uidt_nl << "{" << be_idt; diff --git a/TAO/TAO_IDL/be/be_visitor_component/executor_exh.cpp b/TAO/TAO_IDL/be/be_visitor_component/executor_exh.cpp index fe294044a14..287ee04e09d 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/executor_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/executor_exh.cpp @@ -11,6 +11,7 @@ * @author Jeff Parsons */ //============================================================================= +#include <TAO_IDL/be_include/be_helper.h> be_visitor_executor_exh::be_visitor_executor_exh ( be_visitor_context *ctx) @@ -49,6 +50,10 @@ be_visitor_executor_exh::visit_attribute (be_attribute *node) int be_visitor_executor_exh::visit_component (be_component *node) { + if (node->imported ()) + { + return 0; + } this->node_ = node; AST_Decl *scope = ScopeAsDecl (node->defined_in ()); ACE_CString sname_str (scope->full_name ()); @@ -67,11 +72,15 @@ be_visitor_executor_exh::visit_component (be_component *node) << comment_end_border_; os_ << be_nl_2 - << "class " << lname + << "class "; + + os_ << lname << "_exec_i" << be_idt_nl - << ": public virtual " << lname << "_Exec," << be_idt_nl - << "public virtual ::CORBA::LocalObject" - << be_uidt << be_uidt_nl + << ": public virtual " << lname << "_Exec," << be_idt_nl; + + os_ << "public virtual ::CORBA::LocalObject"; + + os_ << be_uidt << be_uidt_nl << "{" << be_nl << "public:" << be_idt_nl; @@ -120,8 +129,7 @@ be_visitor_executor_exh::visit_component (be_component *node) -1); } - os_ - << "/** @name Operations from Components::" << be_global->ciao_container_type () + os_ << "/** @name Operations from Components::" << be_global->ciao_container_type () << "Component. */" << be_nl << "//@{"; diff --git a/TAO/TAO_IDL/be/be_visitor_component/executor_exs.cpp b/TAO/TAO_IDL/be/be_visitor_component/executor_exs.cpp index 602e197d672..c5715a76d7f 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/executor_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/executor_exs.cpp @@ -140,6 +140,10 @@ be_visitor_executor_exs::visit_attribute (be_attribute *node) int be_visitor_executor_exs::visit_component (be_component *node) { + if (node->imported ()) + { + return 0; + } node_ = node; const char *lname = node->local_name (); @@ -184,6 +188,10 @@ be_visitor_executor_exs::visit_component (be_component *node) { os_ << be_uidt << be_uidt_nl; } + else + { + os_ << be_nl; + } os_ << "{" << be_nl << "}"; diff --git a/TAO/TAO_IDL/be/be_visitor_component/executor_exs_attr_init.cpp b/TAO/TAO_IDL/be/be_visitor_component/executor_exs_attr_init.cpp index b6a6277fff5..c723bf9a61d 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/executor_exs_attr_init.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/executor_exs_attr_init.cpp @@ -28,6 +28,11 @@ int be_visitor_executor_exs_attr_init::visit_attribute ( be_attribute *node) { + if (node->imported ()) + { + return 0; + } + AST_Decl::NodeType nt = this->node_->node_type (); // Executor attribute code generated for porttype attributes @@ -63,6 +68,10 @@ be_visitor_executor_exs_attr_init::visit_attribute ( int be_visitor_executor_exs_attr_init::pre_process (be_decl *node) { + if (node->imported ()) + { + return 0; + } AST_Decl::NodeType nt = this->node_->node_type (); // Executor attribute code generated for porttype attributes diff --git a/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp b/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp index 24115152589..0709be18cd0 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp @@ -389,7 +389,7 @@ be_visitor_servant_svh::gen_non_type_specific (void) << "connect (const char * name, ::CORBA::Object_ptr connection);"; os_ << be_nl_2 - << "virtual ::CORBA::Object_ptr " << be_nl + << "virtual ::CORBA::Object_ptr" << be_nl << "disconnect (const char * name, ::Components::Cookie * ck);"; } diff --git a/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp b/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp index c42972aa91f..f099df71945 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp @@ -1283,7 +1283,7 @@ be_visitor_receptacle_desc::visit_uses (be_uses *node) os_ << "\"" << port_name << "\"," << be_nl << "\"" << obj->repoID () << "\"," << be_nl; - os_ << "ciao_" << port_name << ".in (), " << be_nl; + os_ << "ciao_" << port_name << ".in ()," << be_nl; os_ << "safe_retval," << be_nl << slot_++ << "UL);" << be_uidt << be_uidt; diff --git a/TAO/TAO_IDL/be/be_visitor_connector/facet_ami_exs.cpp b/TAO/TAO_IDL/be/be_visitor_connector/facet_ami_exs.cpp index 5cf4cf3bbb3..a47895645a0 100644 --- a/TAO/TAO_IDL/be/be_visitor_connector/facet_ami_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_connector/facet_ami_exs.cpp @@ -433,7 +433,7 @@ be_visitor_facet_ami_exs::gen_facet_executor_op (be_operation *node) << "::PortableServer::POA::_narrow (objvar.in ());" << be_uidt_nl << this->iface_->local_name () << "_reply_handler *handler = 0;" << be_nl - << "ACE_NEW (handler, " << be_nl + << "ACE_NEW (handler," << be_nl << " " << this->iface_->local_name () << "_reply_handler (ami_handler, poa));" << be_nl << "::PortableServer::ServantBase_var owner_transfer (handler);" diff --git a/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp index f19f1a6d63d..6c2dbd5b4ae 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp @@ -41,7 +41,7 @@ be_visitor_exception_any_op_cs::visit_exception (be_exception *node) TAO_OutStream *os = this->ctx_->stream (); *os << be_nl_2 - << "// TAO_IDL - Generated from " << be_nl + << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__; *os << be_global->core_versioning_begin () << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp index 3d1b21a4671..dd3694b94b4 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp @@ -46,7 +46,7 @@ int be_visitor_exception_ch::visit_exception (be_exception *node) << " " << node->local_name () << " : public ::CORBA::UserException" << be_nl; *os << "{" << be_nl - << "public:" << be_idt_nl; + << "public:" << be_idt; // Generate code for field members. if (this->visit_scope (node) == -1) @@ -58,10 +58,9 @@ int be_visitor_exception_ch::visit_exception (be_exception *node) -1); } - *os << be_nl; - // Constructors and destructor. - *os << node->local_name () << " (void);" << be_nl + *os << be_nl_2 + << node->local_name () << " (void);" << be_nl << node->local_name () << " (const " << node->local_name () << " &);" << be_nl << "~" << node->local_name () << " (void);\n" << be_nl; @@ -86,7 +85,7 @@ int be_visitor_exception_ch::visit_exception (be_exception *node) << "_tao_duplicate (void) const;\n" << be_nl << "virtual void _raise (void) const;\n" << be_nl << "virtual void _tao_encode (TAO_OutputCDR &cdr) const;" << be_nl - << "virtual void _tao_decode (TAO_InputCDR &cdr);" << be_nl; + << "virtual void _tao_decode (TAO_InputCDR &cdr);"; // Generate constructor that takes each member as a parameter. We need a // new state. Such a constructor exists if we have members. diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp index 039d043b689..ed83ceca8a5 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp @@ -97,7 +97,7 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) *os << be_uidt_nl << "}" << be_nl_2; } - *os << be_nl_2 << "// TAO_IDL - Generated from " << be_nl + *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; // Default constructor. diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_ss.cpp index 5a7bb54567f..275605b14c0 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_ss.cpp @@ -65,7 +65,7 @@ be_visitor_amh_rh_interface_ss::visit_interface (be_interface *node) ACE_CString rh_skel_class_name (rh_skel_class_name_prefix); rh_skel_class_name += node->local_name (); - *os << be_nl_2 << "// TAO_IDL - Generated from " << be_nl + *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; *os << rh_skel_full_scope_name.c_str () diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp index 2822f200472..bba533b2f72 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp @@ -62,7 +62,7 @@ be_visitor_amh_interface_ss::this_method (be_interface *node) this->generate_full_skel_name (node); const char *full_skel_name = full_skel_name_holder.c_str (); - *os << be_nl_2 << "// TAO_IDL - Generated from " << be_nl + *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; *os << non_amh_name.c_str () << "*" << be_nl @@ -113,7 +113,7 @@ be_visitor_amh_interface_ss::dispatch_method (be_interface *node) this->generate_full_skel_name (node); const char *full_skel_name = full_skel_name_holder.c_str (); - *os << be_nl_2 << "// TAO_IDL - Generated from " << be_nl + *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; *os << "void" << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp index f3ccdce64c5..6426205be58 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp @@ -23,7 +23,7 @@ be_visitor_interface_direct_proxy_impl_sh::visit_interface ( TAO_OutStream *os = this->ctx_->stream (); *os << be_nl_2 - << "// TAO_IDL - Generated from " << be_nl + << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__; *os << be_nl_2 diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp index 3dbb0b43fbf..0680d6e970b 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp @@ -190,7 +190,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) if (gen_any_destructor) { - *os << "void " << be_nl + *os << "void" << be_nl << node->name () << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl << "{" << be_idt_nl @@ -249,7 +249,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) << "if (! ::CORBA::is_nil (obj))" << be_idt_nl << "{" << be_idt_nl << "obj->_add_ref ();" << be_uidt_nl - << "}" << be_uidt_nl << be_nl + << "}" << be_uidt_nl << "return obj;" << be_uidt_nl << "}" << be_nl_2; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp index 0e2e2990c0a..0effcf0bf15 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp @@ -77,7 +77,7 @@ be_visitor_interface_ih::visit_interface (be_interface *node) *os << be_uidt_nl << "{" << be_nl << "public:" << be_idt_nl - << "// Constructor " << be_nl + << "// Constructor" << be_nl << be_global->impl_class_prefix () << namebuf << be_global->impl_class_suffix () << " (void);" << be_nl_2; @@ -100,7 +100,7 @@ be_visitor_interface_ih::visit_interface (be_interface *node) } - *os << "// Destructor " << be_nl + *os << "// Destructor" << be_nl << "virtual " << "~" << be_global->impl_class_prefix () << namebuf << be_global->impl_class_suffix () << " (void);"; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp index e5b50920af8..4298c71e52f 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp @@ -93,7 +93,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << be_nl_2; - *os << "// TAO_IDL - Generated from " << be_nl + *os << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__; *os << be_nl_2; @@ -166,7 +166,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << be_nl_2; - *os << "// TAO_IDL - Generated from " << be_nl + *os << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__; *os << be_nl_2; @@ -213,7 +213,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << be_nl_2 << "void " << full_skel_name << "::_is_a_skel (" << be_idt << be_idt_nl - << "TAO_ServerRequest & server_request, " << be_nl + << "TAO_ServerRequest & server_request," << be_nl << "void * TAO_INTERCEPTOR (servant_upcall)," << be_nl << "void * servant)" << be_uidt << be_uidt_nl << "{" << be_idt; @@ -323,7 +323,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << be_nl_2 << "void " << full_skel_name << "::_non_existent_skel (" << be_idt << be_idt_nl - << "TAO_ServerRequest & server_request, " << be_nl + << "TAO_ServerRequest & server_request," << be_nl << "void * TAO_INTERCEPTOR (servant_upcall)," << be_nl << "void * servant)" << be_uidt << be_uidt_nl << "{" << be_idt; @@ -437,7 +437,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << be_nl_2 << "void " << full_skel_name << "::_repository_id_skel (" << be_idt << be_idt_nl - << "TAO_ServerRequest & server_request, " << be_nl + << "TAO_ServerRequest & server_request," << be_nl << "void * TAO_INTERCEPTOR (servant_upcall)," << be_nl << "void * servant)" << be_uidt << be_uidt_nl << "{" << be_idt; @@ -521,13 +521,13 @@ be_visitor_interface_ss::visit_interface (be_interface *node) { *os << be_nl_2; - *os << "// TAO_IDL - Generated from " << be_nl + *os << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__; *os << be_nl_2 << "void " << full_skel_name << "::_interface_skel (" << be_idt << be_idt_nl - << "TAO_ServerRequest & server_request, " << be_nl + << "TAO_ServerRequest & server_request," << be_nl << "void * /* servant_upcall */," << be_nl << "void * servant)" << be_uidt << be_uidt_nl; *os << "{" << be_idt_nl; @@ -603,7 +603,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << be_nl_2 << "void " << full_skel_name << "::_component_skel (" << be_idt << be_idt_nl - << "TAO_ServerRequest & server_request, " << be_nl + << "TAO_ServerRequest & server_request," << be_nl << "void * TAO_INTERCEPTOR (servant_upcall)," << be_nl << "void * servant" << be_uidt_nl << ")" << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp index 38ff9db58bd..8b9d22c767d 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp @@ -216,7 +216,7 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node) << "ACE_MT (ACE_GUARD_RETURN (" << "TAO_SYNCH_RECURSIVE_MUTEX, ace_mon," << be_idt_nl << "this->lock_, 0));" << be_uidt_nl << be_nl - << "// To take care of those <unchecked_narrow> methods where we " << be_nl + << "// To take care of those <unchecked_narrow> methods where we" << be_nl << "// want to override the smart proxy factory if there exists one." << be_nl << "if (this->disable_factory_)" << be_idt_nl << "{" << be_idt_nl @@ -229,7 +229,7 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node) << "ACE_NEW_RETURN (" << "this->proxy_factory_," << be_idt << be_idt_nl << "TAO_" << node->flat_name () - << "_Default_Proxy_Factory (0), " << be_nl + << "_Default_Proxy_Factory (0)," << be_nl << " 0);" << be_uidt_nl << be_uidt_nl << be_uidt_nl << "return " << "this->proxy_factory_->create_proxy (proxy);" diff --git a/TAO/TAO_IDL/be/be_visitor_interface/tie_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/tie_ss.cpp index 041bc2101d8..24e2d765a07 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/tie_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/tie_ss.cpp @@ -86,35 +86,35 @@ be_visitor_interface_tie_ss::visit_interface (be_interface *node) << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; *os << "template <class T>" << be_nl - << fulltiename << "<T>::" << localtiename << " (T &t)" << be_nl - << "\t: ptr_ (&t)," << be_nl - << "\t poa_ ( ::PortableServer::POA::_nil ())," << be_nl - << "\t rel_ (false)" << be_nl + << fulltiename << "<T>::" << localtiename << " (T &t)" << be_idt_nl + << ": ptr_ (&t)," << be_idt_nl + << "poa_ ( ::PortableServer::POA::_nil ())," << be_nl + << "rel_ (false)" << be_uidt << be_uidt_nl << "{}" << be_nl_2; - *os << "template <class T> " << be_nl + *os << "template <class T>" << be_nl << fulltiename << "<T>::" << localtiename - << " (T &t, ::PortableServer::POA_ptr poa)" << be_nl - << "\t: ptr_ (&t)," << be_nl - << "\t poa_ ( ::PortableServer::POA::_duplicate (poa))," << be_nl - << "\t rel_ (false)" << be_nl + << " (T &t, ::PortableServer::POA_ptr poa)" << be_idt_nl + << ": ptr_ (&t)," << be_idt_nl + << "poa_ ( ::PortableServer::POA::_duplicate (poa))," << be_nl + << "rel_ (false)" << be_uidt << be_uidt_nl << "{}" << be_nl_2; *os << "template <class T>" << be_nl << fulltiename << "<T>::" << localtiename - << " (T *tp, ::CORBA::Boolean release)" << be_nl - << "\t: ptr_ (tp)," << be_nl - << "\t poa_ ( ::PortableServer::POA::_nil ())," << be_nl - << "\t rel_ (release)" << be_nl + << " (T *tp, ::CORBA::Boolean release)" << be_idt_nl + << ": ptr_ (tp)," << be_idt_nl + << "poa_ ( ::PortableServer::POA::_nil ())," << be_nl + << "rel_ (release)" << be_uidt << be_uidt_nl << "{}" << be_nl_2; *os << "template <class T>" << be_nl << fulltiename << "<T>::" << localtiename << " (T *tp, ::PortableServer::POA_ptr poa, ::CORBA::Boolean release)" - << be_nl - << "\t: ptr_ (tp)," << be_nl - << "\t poa_ ( ::PortableServer::POA::_duplicate (poa))," << be_nl - << "\t rel_ (release)" << be_nl + << be_idt_nl + << ": ptr_ (tp)," << be_idt_nl + << "poa_ ( ::PortableServer::POA::_duplicate (poa))," << be_nl + << "rel_ (release)" << be_uidt << be_uidt_nl << "{}" << be_nl_2; *os << "template <class T>" << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp index 28e70e58e7c..f503eff6c6e 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp @@ -74,7 +74,7 @@ be_visitor_amh_rh_operation_ss::visit_operation (be_operation *node) buf = 0; // Step 1 : Generate return type: always void - *os << be_nl_2 << "// TAO_IDL - Generated from " << be_nl + *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; *os << "void" << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp index d5269a02b8d..58125600147 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp @@ -130,7 +130,7 @@ be_visitor_amh_operation_sh::generate_shared_prologue ( const char *skel_prefix ) { - *os << be_nl_2 << "// TAO_IDL - Generated from " << be_nl + *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; *os << "static void " << skel_prefix diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp index da66afebb59..da9362998b9 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp @@ -302,7 +302,7 @@ be_visitor_amh_operation_ss::generate_shared_prologue (be_decl *node, TAO_OutStream *os, const char *skel_prefix) { - *os << be_nl_2 << "// TAO_IDL - Generated from " << be_nl + *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; // We need the interface node in which this operation was defined. However, diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp index 09cbabefdf2..7323f35f509 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp @@ -100,7 +100,7 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_operation ( *os << this->ctx_->port_prefix ().c_str () << node->local_name () << "_reply_stub (" << be_idt_nl - << "TAO_InputCDR &_tao_in, " << be_nl + << "TAO_InputCDR &_tao_in," << be_nl << "::Messaging::ReplyHandler_ptr _tao_reply_handler," << be_nl << "::CORBA::ULong reply_status" << ")" << be_uidt << be_uidt_nl @@ -156,7 +156,7 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_operation ( // Don't do anything if the exception list is empty. if (node->exceptions ()) { - *os << be_nl << "static TAO::Exception_Data " << "exceptions_data [] = " << be_nl; + *os << be_nl << "static TAO::Exception_Data " << "exceptions_data [] =" << be_nl; *os << "{" << be_idt_nl; int excep_count = 0; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp index e9c60885335..c69901bbc09 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp @@ -53,7 +53,7 @@ be_visitor_operation_direct_proxy_impl_ss::visit_operation ( } } - *os << "// TAO_IDL - Generated from " << be_nl + *os << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl; *os << "void" << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp index 769362a8d7f..965d7c0418a 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp @@ -97,7 +97,7 @@ be_visitor_operation_ch::visit_operation (be_operation *node) && !node->has_native ()) { *os << be_nl_2 - << "static void " << be_nl + << "static void" << be_nl << node->local_name () << "_reply_stub (" << be_idt_nl << "TAO_InputCDR &_tao_reply_cdr," << be_nl << "::Messaging::ReplyHandler_ptr _tao_reply_handler," diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp index 54363971d8b..2903992ecba 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp @@ -169,7 +169,7 @@ be_visitor_operation_ss::gen_skel_operation_body (be_operation * node, intf->full_skel_name (), upcall_command_name.c_str ()); - *os << be_nl_2 << "// TAO_IDL - Generated from " << be_nl + *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; *os << "void " << intf->full_skel_name () << "::"; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/tie_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/tie_ss.cpp index 597475cbe94..964921a0797 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/tie_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/tie_ss.cpp @@ -94,7 +94,7 @@ int be_visitor_operation_tie_ss::visit_operation (be_operation *node) } } - *os << be_nl_2 << "// TAO_IDL - Generated from " << be_nl + *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; *os << "template <class " << template_name.c_str () << ">" << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp index d02650ec314..bd821693e32 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp @@ -154,7 +154,7 @@ be_visitor_root_ch::gen_fwd_decls (void) if (idl_global->non_local_iface_seen_) { *o_ << be_nl_2 - << "// TAO_IDL - Generated from " << be_nl + << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__; *o_ << be_global->core_versioning_begin () << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp index e5f4588ef89..b6127ffc509 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp @@ -66,7 +66,7 @@ be_visitor_root_sth::visit_module (be_module *node) // Generate the skeleton class name. - *os << be_nl_2 << "// TAO_IDL - Generated from " << be_nl + *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " __FILE__ << ":" << __LINE__ << be_nl_2; // Now generate the class definition. The prefix POA_ is prepended to our diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp index dc695cb2c7f..7ba6d4d7885 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp @@ -42,7 +42,7 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node) TAO_OutStream *os = this->ctx_->stream (); *os << be_nl_2 - << "// TAO_IDL - Generated from " << be_nl + << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; *os << be_global->core_versioning_begin () << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp index e30ec8af9a8..d725973763d 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp @@ -208,7 +208,7 @@ int be_visitor_sequence_ch::visit_sequence (be_sequence *node) -1); } - *os << "* buffer, " << be_nl + *os << "* buffer," << be_nl << "::CORBA::Boolean release = false);" << be_uidt; } diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp index db044c11ea0..655fdfcedba 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp @@ -61,7 +61,7 @@ int be_visitor_sequence_cs::visit_sequence (be_sequence *node) *os << be_nl_2; - *os << "// TAO_IDL - Generated from " << be_nl + *os << "// TAO_IDL - Generated from" << be_nl << "// "__FILE__ << ":" << __LINE__; os->gen_ifdef_macro (node->flat_name ()); diff --git a/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp index f5becf9ca44..65732497637 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp @@ -41,7 +41,7 @@ be_visitor_structure_any_op_cs::visit_structure (be_structure *node) TAO_OutStream *os = this->ctx_->stream (); *os << be_nl_2 - << "// TAO_IDL - Generated from " << be_nl + << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; // Since we don't generate CDR stream operators for types that diff --git a/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp index 2e8723d799c..652ea6ac139 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp @@ -54,10 +54,10 @@ be_visitor_structure_cs::visit_structure (be_structure *node) TAO_OutStream *os = this->ctx_->stream (); *os << be_nl_2; - *os << "// TAO_IDL - Generated from " << be_nl + *os << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; - *os << "void " << be_nl + *os << "void" << be_nl << node->name () << "::_tao_any_destructor (" << be_idt << be_idt_nl << "void *_tao_void_pointer)" << be_uidt diff --git a/TAO/TAO_IDL/be/be_visitor_template_export.cpp b/TAO/TAO_IDL/be/be_visitor_template_export.cpp index bee0c3db328..f0f9229c053 100644 --- a/TAO/TAO_IDL/be/be_visitor_template_export.cpp +++ b/TAO/TAO_IDL/be/be_visitor_template_export.cpp @@ -36,7 +36,7 @@ be_visitor_template_export::visit_root (be_root *node) { TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from " << be_nl + *os << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; *os << "#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT"; diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp index d7965f5ddee..97631bd0f08 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp @@ -170,7 +170,7 @@ be_visitor_typedef_ci::visit_array (be_array *node) // alloc method *os << be_nl - << "ACE_INLINE " << be_nl + << "ACE_INLINE" << be_nl << tdef->name () << "_slice *" << be_nl; *os << tdef->name () << "_alloc (void)" << be_nl; *os << "{" << be_idt_nl; @@ -178,7 +178,7 @@ be_visitor_typedef_ci::visit_array (be_array *node) *os << "}" << be_nl_2; // dup method - *os << "ACE_INLINE " << be_nl + *os << "ACE_INLINE" << be_nl << tdef->name () << "_slice *" << be_nl; *os << tdef->name () << "_dup (" << be_idt << be_idt_nl << "const " << tdef->name () diff --git a/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp index 48c76f9ee74..ddfc261bf6b 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp @@ -41,7 +41,7 @@ be_visitor_union_any_op_cs::visit_union (be_union *node) TAO_OutStream *os = this->ctx_->stream (); *os << be_nl_2 - << "// TAO_IDL - Generated from " << be_nl + << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; *os << be_global->core_versioning_begin () << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp index 171d016df82..c7d97c83456 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp @@ -65,7 +65,7 @@ be_visitor_union_discriminant_ci::visit_enum (be_enum *node) // Only if all cases are not covered AND there is no explicit // default, we get the _default () method. *os << "ACE_INLINE" << be_nl - << "void " << be_nl + << "void" << be_nl << bu->name () << "::_default ()" << be_nl << "{" << be_idt_nl << "this->_reset ();" << be_nl @@ -156,7 +156,7 @@ be_visitor_union_discriminant_ci::visit_predefined_type ( // default, we get the _default () method. *os << "ACE_INLINE" << be_nl - << "void " << be_nl + << "void" << be_nl << bu->name () << "::_default ()" << be_nl << "{" << be_idt_nl << "this->_reset ();" << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp index 04e9d050ed5..db9d86d3770 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp @@ -347,7 +347,7 @@ be_visitor_union_branch_public_ci::visit_interface (be_interface *node) // Get method. *os << "/// Retrieve the member." << be_nl << "ACE_INLINE" << be_nl - << bt->name () << "_ptr " << be_nl + << bt->name () << "_ptr" << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl << "return this->u_." << ub->local_name () << "_->in ();" << be_uidt_nl @@ -437,7 +437,7 @@ be_visitor_union_branch_public_ci::visit_interface_fwd (be_interface_fwd *node) // Get method. *os << "/// Retrieve the member." << be_nl << "ACE_INLINE" << be_nl - << bt->name () << "_ptr " << be_nl + << bt->name () << "_ptr" << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl << "return this->u_." << ub->local_name () << "_->in ();" << be_uidt_nl @@ -532,7 +532,7 @@ be_visitor_union_branch_public_ci::emit_valuetype_common (be_type *node) // Get method. *os << "/// Retrieve the member." << be_nl << "ACE_INLINE" << be_nl - << bt->name () << "* " << be_nl + << bt->name () << "*" << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl << "return this->u_." << ub->local_name () << "_->in ();" << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/cdr_op_cs.cpp index a01faeb9dab..a4906eab431 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuebox/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuebox/cdr_op_cs.cpp @@ -49,7 +49,7 @@ be_visitor_valuebox_cdr_op_cs::visit_valuebox (be_valuebox *node) *os << "::CORBA::Boolean" << be_nl << "operator<< (" << be_idt << be_idt_nl - << "TAO_OutputCDR &strm, " << be_nl + << "TAO_OutputCDR &strm," << be_nl << "const " << node->full_name () << " *_tao_valuebox" << be_uidt_nl << ")" << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp index 748e9bba6c1..d7df831d39e 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp @@ -50,7 +50,7 @@ be_visitor_valuebox_ci::visit_valuebox (be_valuebox *node) *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl; - *os << "ACE_INLINE const char* " << be_nl + *os << "ACE_INLINE const char*" << be_nl << node->name () << "::_tao_obv_static_repository_id ()" << be_nl << "{" << be_idt_nl << "return \"" << node->repoID () << "\";" << be_uidt_nl @@ -229,21 +229,21 @@ be_visitor_valuebox_ci::visit_sequence (be_sequence *node) this->emit_boxed_access(node, "*"); // Generate maximum() accessor - *os << "ACE_INLINE ::CORBA::ULong " << be_nl + *os << "ACE_INLINE ::CORBA::ULong" << be_nl << vb_node->name () << "::maximum (void) const" << be_nl << "{" << be_idt_nl << "return this->_pd_value->maximum ();" << be_uidt_nl << "}" << be_nl_2; // Generate length() accessor - *os << "ACE_INLINE ::CORBA::ULong " << be_nl + *os << "ACE_INLINE ::CORBA::ULong" << be_nl << vb_node->name () << "::length (void) const" << be_nl << "{" << be_idt_nl << "return this->_pd_value->length ();" << be_uidt_nl << "}" << be_nl_2; // Generate length() setter - *os << "ACE_INLINE void " << be_nl + *os << "ACE_INLINE void" << be_nl << vb_node->name () << "::length ( ::CORBA::ULong length)" << be_nl << "{" << be_idt_nl << "this->_pd_value->length (length);" << be_uidt_nl @@ -289,7 +289,7 @@ be_visitor_valuebox_ci::visit_string (be_string *node) this->emit_assignment (node, ""); // Public constructor with one const argument of underlying type - *os << "ACE_INLINE " << be_nl + *os << "ACE_INLINE" << be_nl << vb_node->name () << "::" << vb_node->local_name () << " (const " << node->full_name () << " val)" << be_nl << "{" << be_idt_nl @@ -549,7 +549,7 @@ be_visitor_valuebox_ci::visit_union (be_union *node) // Generate modifier and accessor for discriminant - *os << "ACE_INLINE void " << be_nl + *os << "ACE_INLINE void" << be_nl << vb_node->name () << "::_d (" << bt->nested_type_name (node) << " val)" << be_nl << "{" << be_idt_nl @@ -662,7 +662,7 @@ be_visitor_valuebox_ci::emit_default_constructor_alloc (be_decl *node) be_type::narrow_from_decl (node)->size_type () == AST_Type::VARIABLE; // Public default constructor - *os << "ACE_INLINE " << be_nl + *os << "ACE_INLINE" << be_nl << vb_node->name () << "::" << vb_node->local_name () << " (void)" << be_nl << "{" << be_idt_nl << node->full_name () << "* p = 0;" << be_nl @@ -684,7 +684,7 @@ be_visitor_valuebox_ci::emit_constructor_one_arg (be_decl *node, be_decl * vb_node = this->ctx_->node (); // Public constructor with one argument of underlying type - *os << "ACE_INLINE " << be_nl + *os << "ACE_INLINE" << be_nl << vb_node->name () << "::" << vb_node->local_name () << " (" << node->full_name () << type_suffix << " val)" << be_nl << "{" << be_idt_nl @@ -701,7 +701,7 @@ be_visitor_valuebox_ci::emit_constructor_one_arg_alloc (be_decl *node) be_decl * vb_node = this->ctx_->node (); // Public constructor with single argument of type const T& - *os << "ACE_INLINE " << be_nl + *os << "ACE_INLINE" << be_nl << vb_node->name () << "::" << vb_node->local_name () << " (const " << node->full_name () << "& value)" << be_nl << "{" << be_idt_nl @@ -722,7 +722,7 @@ be_visitor_valuebox_ci::emit_copy_constructor (void) be_decl * vb_node = this->ctx_->node (); // Public Copy constructor - *os << "ACE_INLINE " << be_nl + *os << "ACE_INLINE" << be_nl << vb_node->name () << "::" << vb_node->local_name () << " (const " << vb_node->full_name () << "& val)" << be_idt_nl << ": ::CORBA::ValueBase (val)," << be_nl @@ -742,7 +742,7 @@ be_visitor_valuebox_ci::emit_copy_constructor_alloc (be_decl *node) be_decl * vb_node = this->ctx_->node (); // Public copy constructor - *os << "ACE_INLINE " << be_nl + *os << "ACE_INLINE" << be_nl << vb_node->name () << "::" << vb_node->local_name () << " (const " << vb_node->full_name () << "& val)" << be_idt_nl << ": ::CORBA::ValueBase (val)," << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp index 9e7f86080e6..bf581441f95 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp @@ -125,7 +125,7 @@ be_visitor_valuebox_cs::visit_valuebox (be_valuebox *node) // _tao_match_formal_type method. Generated because ValueBase interface // requires it. Since value boxes do not support inheritence, this can // simply return true. - *os << "::CORBA::Boolean " << be_nl + *os << "::CORBA::Boolean" << be_nl << node->name () << "::_tao_match_formal_type (ptrdiff_t ) const" << be_nl << "{" << be_idt_nl @@ -227,7 +227,7 @@ be_visitor_valuebox_cs::visit_valuebox (be_valuebox *node) } // The _tao_unmarshal method. - *os << "::CORBA::Boolean " << be_nl + *os << "::CORBA::Boolean" << be_nl << node->name () << "::_tao_unmarshal (" << be_idt << be_idt_nl << "TAO_InputCDR &strm," << be_nl << node->local_name () << " *&vb_object" << be_uidt_nl @@ -238,7 +238,7 @@ be_visitor_valuebox_cs::visit_valuebox (be_valuebox *node) << "TAO_InputCDR indrected_strm ((size_t) 0);" << be_nl << "if ( ::CORBA::ValueBase::_tao_validate_box_type (" << be_idt << be_idt << be_idt_nl - << "strm, indrected_strm, " << be_nl + << "strm, indrected_strm," << be_nl << node->local_name () << "::_tao_obv_static_repository_id ()," << be_nl << "is_null_object, is_indirected" @@ -300,7 +300,7 @@ be_visitor_valuebox_cs::visit_valuebox (be_valuebox *node) // _tao_unmarshal_v method. Generated because ValueBase interface // requires it. But there is nothing for it to do in the valuebox // case. - *os << "::CORBA::Boolean " << be_nl + *os << "::CORBA::Boolean" << be_nl << node->name () << "::_tao_unmarshal_v (TAO_InputCDR &)" << be_nl << "{" << be_idt_nl @@ -337,7 +337,7 @@ be_visitor_valuebox_cs::visit_array (be_array * node) this->emit_destructor (); // _tao_marshal_v method - os << "::CORBA::Boolean " << be_nl + os << "::CORBA::Boolean" << be_nl << vb_node->name () << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl << "{" << be_idt_nl @@ -365,7 +365,7 @@ be_visitor_valuebox_cs::visit_enum (be_enum *) static char const marshal_arg[] = "this->_pd_value"; // _tao_marshal_v method - os << "::CORBA::Boolean " << be_nl + os << "::CORBA::Boolean" << be_nl << vb_node->name () << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl << "{" << be_idt_nl @@ -490,7 +490,7 @@ be_visitor_valuebox_cs::visit_sequence (be_sequence *node) *os << be_nl << "::CORBA::ULong max,"; } - *os << be_nl << "::CORBA::ULong length, " << be_nl; + *os << be_nl << "::CORBA::ULong length," << be_nl; if (bt->accept (&bt_visitor) == -1) @@ -533,7 +533,7 @@ be_visitor_valuebox_cs::visit_sequence (be_sequence *node) -1); } - *os << " & " << be_nl + *os << " &" << be_nl << vb_node->name () << "::operator[] ( ::CORBA::ULong index)" << be_nl << "{" << be_idt_nl @@ -572,13 +572,13 @@ be_visitor_valuebox_cs::visit_sequence (be_sequence *node) { case AST_Decl::NT_wstring: *os << "TAO_SeqElem_WString_Manager mgr = this->_pd_value->operator[] " - "(index); " << be_nl + "(index);" << be_nl << "return mgr._retn ();" << be_uidt_nl; break; case AST_Decl::NT_string: *os << "TAO_SeqElem_String_Manager mgr = this->_pd_value->operator[] " - "(index); " << be_nl + "(index);" << be_nl << "return mgr._retn ();" << be_uidt_nl; break; @@ -600,7 +600,7 @@ be_visitor_valuebox_cs::visit_sequence (be_sequence *node) *os << "}" << be_nl_2; // _tao_marshal_v method - *os << "::CORBA::Boolean " << be_nl + *os << "::CORBA::Boolean" << be_nl << vb_node->name () << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl << "{" << be_idt_nl @@ -624,7 +624,7 @@ be_visitor_valuebox_cs::visit_string (be_string *str) this->emit_destructor (); // _tao_marshal_v method - os << "::CORBA::Boolean " << be_nl + os << "::CORBA::Boolean" << be_nl << vb_node->name () << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl << "{" << be_idt_nl @@ -670,7 +670,7 @@ be_visitor_valuebox_cs::visit_structure (be_structure *) this->emit_destructor (); // _tao_marshal_v method - os << "::CORBA::Boolean " << be_nl + os << "::CORBA::Boolean" << be_nl << vb_node->name () << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl << "{" << be_idt_nl @@ -712,7 +712,7 @@ be_visitor_valuebox_cs::visit_union (be_union *) this->emit_destructor (); // _tao_marshal_v method - os << "::CORBA::Boolean " << be_nl + os << "::CORBA::Boolean" << be_nl << vb_node->name () << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl << "{" << be_idt_nl @@ -749,7 +749,7 @@ be_visitor_valuebox_cs::emit_for_predef_enum (char const * marshal_arg) this->emit_destructor (); // _tao_marshal_v method - os << "::CORBA::Boolean " << be_nl + os << "::CORBA::Boolean" << be_nl << vb_node->name () << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl << "{" << be_idt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp index e2c6ce33998..5ba2439fe90 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp @@ -68,7 +68,7 @@ be_visitor_valuetype_cdr_op_cs::visit_valuetype (be_valuetype *node) *os << "::CORBA::Boolean" << be_nl << "operator<< (" << be_idt << be_idt_nl - << "TAO_OutputCDR &strm, " << be_nl + << "TAO_OutputCDR &strm," << be_nl << "const " << node->full_name () << " *_tao_valuetype" << be_uidt_nl << ")" << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp index 3e977050961..145e054099c 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp @@ -255,7 +255,7 @@ be_visitor_valuetype_field_cdr_cs::visit_interface (be_interface *node) *os << "TAO::Objref_Traits< ::" << node->name () << ">::marshal (" << be_idt << be_idt_nl << this->pre_ << f->local_name () - << this->post_ << ".in (), " << be_nl + << this->post_ << ".in ()," << be_nl << "strm" << be_uidt_nl << ")" << be_uidt; break; @@ -305,7 +305,7 @@ be_visitor_valuetype_field_cdr_cs::visit_interface_fwd (be_interface_fwd *node) *os << "TAO::Objref_Traits< ::" << node->name () << ">::marshal (" << be_idt << be_idt_nl << this->pre_ << f->local_name () - << this->post_ << ".in (), " << be_nl + << this->post_ << ".in ()," << be_nl << "strm" << be_uidt_nl << ")" << be_uidt; break; diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp index dac42b42556..5c78a4feb29 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp @@ -307,7 +307,7 @@ be_visitor_valuetype_field_cs::visit_interface (be_interface *node) *os << "}" << be_nl_2; *os << "/// Retrieve the member." << be_nl - << this->pre_op () << bt->name () << "_ptr " << be_nl; + << this->pre_op () << bt->name () << "_ptr" << be_nl; this->op_name (bu, os); @@ -375,7 +375,7 @@ be_visitor_valuetype_field_cs::visit_interface_fwd (be_interface_fwd *node) *os << "}" << be_nl_2; *os << "/// Retrieve the member" << be_nl - << this->pre_op () << bt->name () << "_ptr " << be_nl; + << this->pre_op () << bt->name () << "_ptr" << be_nl; this->op_name (bu, os); diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp index 370f72e5712..09db8aea597 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp @@ -879,7 +879,7 @@ be_visitor_valuetype::gen_init_impl (be_valuetype *node) *os << fname << "::~" << lname << " (void)" << be_nl << "{" << be_nl << "}\n\n"; - *os << "const char* " << be_nl + *os << "const char*" << be_nl << fname << "::tao_repository_id (void)" << be_nl << "{" << be_idt_nl << "return " << node->local_name () diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp index e8a581f08a5..41e89cc2e49 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp @@ -42,7 +42,7 @@ be_visitor_valuetype_ci::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl_2 << "// TAO_IDL - Generated from " << be_nl + *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; *os << "ACE_INLINE" << be_nl; @@ -65,7 +65,7 @@ be_visitor_valuetype_ci::visit_valuetype (be_valuetype *node) } - *os << "ACE_INLINE const char* " << be_nl + *os << "ACE_INLINE const char*" << be_nl << node->name () << "::_tao_obv_static_repository_id ()" << be_nl << "{" << be_idt_nl << "return \"" << node->repoID () << "\";" << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp index 2183de6ee02..5a2e38ac9c7 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp @@ -174,7 +174,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) if (!node->is_abstract () && !is_an_amh_exception_holder) { // The virtual _tao_marshal_v method. - *os << "::CORBA::Boolean " << be_nl + *os << "::CORBA::Boolean" << be_nl << node->name () << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl << "{" << be_idt_nl @@ -200,7 +200,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) *os << "}" << be_nl_2; // The virtual _tao_unmarshal_v method. - *os << "::CORBA::Boolean " << be_nl + *os << "::CORBA::Boolean" << be_nl << node->name () << "::_tao_unmarshal_v (TAO_InputCDR & strm)" << be_nl @@ -226,7 +226,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) *os << "}" << be_nl_2; - *os << "::CORBA::Boolean " << be_nl + *os << "::CORBA::Boolean" << be_nl << node->name () << "::_tao_match_formal_type (ptrdiff_t formal_type_id) const" << be_nl @@ -260,7 +260,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) << "}" << be_nl_2; // The virtual _tao_match_formal_type method. - *os << "::CORBA::Boolean " << be_nl + *os << "::CORBA::Boolean" << be_nl << node->name () << "::_tao_match_formal_type (ptrdiff_t ) const" << be_nl @@ -306,7 +306,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) // The static T::_tao_unmarshal method - *os << "::CORBA::Boolean " << be_nl << node->name() + *os << "::CORBA::Boolean" << be_nl << node->name() << "::_tao_unmarshal (" << be_idt << be_idt_nl << "TAO_InputCDR &strm," << be_nl << node->local_name () << " *&new_object" << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_cs.cpp index 0e7cb2a5d37..2c98b145e2f 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_cs.cpp @@ -95,7 +95,7 @@ be_visitor_valuetype_init_cs::visit_valuetype (be_valuetype *node) // tao_repository_id *os << be_nl_2 - << "const char* " << be_nl + << "const char*" << be_nl << fname << "::tao_repository_id (void)" << be_nl << "{" << be_idt_nl << "return ::" << node->full_name () diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp index e813b7b2190..788c4c58bb1 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp @@ -58,7 +58,7 @@ be_visitor_valuetype_ss::visit_valuetype (be_valuetype *node) ACE_CString flat_name_holder = this->generate_flat_name (node); - *os << be_nl << "// TAO_IDL - Generated from " << be_nl + *os << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl_2; // Find if we are at the top scope or inside some module, diff --git a/TAO/bin/tao_orb_tests.lst b/TAO/bin/tao_orb_tests.lst index 2021797303f..260dbb7cd5f 100644 --- a/TAO/bin/tao_orb_tests.lst +++ b/TAO/bin/tao_orb_tests.lst @@ -151,8 +151,8 @@ TAO/tests/Bug_3481_Regression/run_test.pl: !FIXED_BUGS_ONLY TAO/tests/Bug_3499_Regression/run_test.pl: !STATIC TAO/tests/Bug_3506_Regression/run_test.pl: TAO/tests/Bug_3524_Regression/run_test.pl: !CORBA_E_MICRO -TAO/tests/Bug_3531_Regression/run_test.pl: !ST !NO_MESSAGING !CORBA_E_MICRO !FIXED_BUGS_ONLY -TAO/tests/Bug_3531b_Regression/run_test.pl: !ST !FIXED_BUGS_ONLY +TAO/tests/Bug_3531_Regression/run_test.pl: !ST !NO_MESSAGING !CORBA_E_MICRO +TAO/tests/Bug_3531b_Regression/run_test.pl: !ST TAO/tests/Bug_3542_Regression/run_test.pl: !STATIC !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO #TAO/tests/Bug_3543_Regression/run_test.pl: !ST TAO/tests/Bug_3548_Regression/run_test.pl: @@ -191,6 +191,7 @@ TAO/tests/Bug_3755_Ext_Regression/run_test.pl -messaging: !STATIC !NO_MESSAGING TAO/tests/Bug_3755_Ext_Regression/run_test.pl -csd: !STATIC !ST !CORBA_E_MICRO !LynxOS TAO/tests/Bug_3755_Ext_Regression/run_test.pl -ziop: !STATIC ZIOP ZLIB !LynxOS TAO/tests/Bug_3766_Regression/run_test.pl: +TAO/tests/Bug_3768_Regression/run_test.pl: !ST !NO_MESSAGING !CORBA_E_MICRO TAO/tests/Bug_3790_Regression/run_test.pl: TAO/tests/Bug_3821_Regression/run_test.pl: TAO/tests/Bug_3826_Regression/run_test.pl: diff --git a/TAO/tao/Connection_Handler.cpp b/TAO/tao/Connection_Handler.cpp index d0f9cebefcb..ff9fbfb745a 100644 --- a/TAO/tao/Connection_Handler.cpp +++ b/TAO/tao/Connection_Handler.cpp @@ -5,7 +5,6 @@ #include "tao/ORB_Core.h" #include "tao/debug.h" #include "tao/Resume_Handle.h" -#include "tao/Resume_Handle_Deferred.h" #include "tao/Transport.h" #include "tao/Wait_Strategy.h" @@ -214,8 +213,6 @@ TAO_Connection_Handler::handle_input_eh (ACE_HANDLE h, ACE_Event_Handler *eh) // If we can't process upcalls just return if (!this->transport ()->wait_strategy ()->can_process_upcalls ()) { - ACE_Time_Value suspend_delay (0, 2000); - if (TAO_debug_level > 6) ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - Connection_Handler[%d]::handle_input_eh, " @@ -223,33 +220,17 @@ TAO_Connection_Handler::handle_input_eh (ACE_HANDLE h, ACE_Event_Handler *eh) "because upcalls temporarily suspended on this thread\n", this->transport()->id())); - if (TAO_debug_level > 5) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - Connection_Handler[%d]::handle_input_eh, " - "scheduled to resume in %#T sec\n", - eh->get_handle(), - &suspend_delay)); - - // Using the heap to create the timeout handler, since we do not know - // which handle we will have to try to resume. - TAO_Resume_Handle_Deferred* prhd = 0; - ACE_NEW_RETURN (prhd, - TAO_Resume_Handle_Deferred (this->orb_core_, eh), - -1); - ACE_Event_Handler_var safe_handler (prhd); - - int const retval = this->orb_core_->reactor()->schedule_timer (prhd, 0, suspend_delay); - if (retval == -1) + // defer upcall at leader_follower + if (this->transport ()->wait_strategy ()->defer_upcall (eh) != 0) { if (TAO_debug_level > 5) ACE_ERROR ((LM_ERROR, "TAO (%P|%t) - Connection_Handler[%d]::handle_input_eh, " - "Error scheduling timer in %#T sec\n", - eh->get_handle(), - &suspend_delay)); + "Error deferring upcall handler[%d]\n", + this->transport ()->id (), + eh->get_handle ())); return -1; } - // Returning 0 causes the wait strategy to exit and the leader thread // to enter the reactor's select() call. return 0; diff --git a/TAO/tao/Leader_Follower.cpp b/TAO/tao/Leader_Follower.cpp index 9bf50ba6fa3..427374ee726 100644 --- a/TAO/tao/Leader_Follower.cpp +++ b/TAO/tao/Leader_Follower.cpp @@ -3,6 +3,7 @@ #include "ace/Countdown_Time.h" #include "ace/OS_NS_sys_time.h" #include "ace/Reactor.h" +#include "ace/Auto_Ptr.h" #include "tao/Leader_Follower.h" #include "tao/LF_Follower_Auto_Ptr.h" @@ -19,8 +20,25 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL +TAO_Leader_Follower::Deferred_Event::Deferred_Event (ACE_Event_Handler* h) +: eh_ (h) +{ + h->add_reference (); +} + + +ACE_Event_Handler* TAO_Leader_Follower::Deferred_Event::handler () const +{ + return this->eh_.handler (); +} + TAO_Leader_Follower::~TAO_Leader_Follower (void) { + while (!this->deferred_event_set_.is_empty ()) + { + Deferred_Event *event = this->deferred_event_set_.pop_front (); + delete event; + } while (!this->follower_free_list_.is_empty ()) { TAO_LF_Follower *follower = this->follower_free_list_.pop_front (); @@ -185,6 +203,49 @@ TAO_Leader_Follower::reset_client_thread (void) } int +TAO_Leader_Follower::defer_event (ACE_Event_Handler* eh) +{ + // Obtain the lock. + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock (), -1); + + if (TAO_debug_level > 7) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - TAO_Leader_Follower::defer_event, " + "deferring event handler[%d]\n", + eh->get_handle ())); + Deferred_Event* ptr = 0; + ACE_NEW_RETURN (ptr, + Deferred_Event (eh), + -1); + this->deferred_event_set_.push_back (ptr); + return 0; +} + +void +TAO_Leader_Follower::resume_events () +{ + // not need to obtain the lock, only called when holding the lock + while (!this->deferred_event_set_.is_empty ()) + { + ACE_Auto_Ptr<Deferred_Event> event (this->deferred_event_set_.pop_front ()); + // Send a notification to the reactor to cause the awakening of a new + // follower, if there is one already available. + ACE_Reactor *reactor = this->orb_core_->reactor (); + int const retval = reactor->notify (event->handler (), ACE_Event_Handler::READ_MASK); + if (TAO_debug_level > 2) + { + // @@todo: need to think about what is the action that + // we can take when we get here with an error?! + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) - TAO_Leader_Follower::resume_events, ") + ACE_TEXT ("an event handler[%d] has been resumed, ") + ACE_TEXT ("notified the reactor, retval=%d.\n"), + event->handler ()->get_handle (), retval)); + } + } +} + +int TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, TAO_Transport *transport, ACE_Time_Value *max_wait_time) @@ -207,20 +268,32 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, size_t t_id = 0; if (TAO_debug_level && transport != 0) - { - t_id = transport->id (); - } - { + t_id = transport->id (); + } + + { // Scope #1: All threads inside here are client threads // Calls this->set_client_thread () on construction and // this->reset_client_thread () on destruction. TAO_LF_Client_Thread_Helper client_thread_helper (*this); ACE_UNUSED_ARG (client_thread_helper); - // Check if there is a leader. Note that it cannot be us since we - // gave up our leadership when we became a client. - if (this->leader_available ()) - { + // The loop here is for when we get elected (client) leader and + // then later relinquish the leader position and our event has + // still not completed (and we haven't run out of time). + // All the conditions below are basically the various ways the + // leader loop below can end, other than the event being complete + while (event->keep_waiting () + && !(result == 0 && + max_wait_time != 0 && + *max_wait_time == ACE_Time_Value::zero) + && result != -1) + { // Scope #2: threads here alternate between being leader/followers + + // Check if there is a leader. Note that it cannot be us since we + // gave up our leadership when we became a client. + if (this->leader_available ()) + { // Scope #3: threads here are followers // = Wait as a follower. // Grab a follower: @@ -240,101 +313,101 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, while (event->keep_waiting () && this->leader_available ()) + { // Scope #4: this loop handles spurious wake-ups + // Add ourselves to the list, do it everytime we wake up + // from the CV loop. Because: + // + // - The leader thread could have elected us as the new + // leader. + // - Before we can assume the role another thread becomes + // the leader + // - But our condition variable could have been removed + // already, if we don't add it again we will never wake + // up. + // + // Notice that we can have spurious wake ups, in that case + // adding the leader results in an error, that must be + // ignored. + // You may be thinking of not removing the condition + // variable in the code that sends the signal, but + // removing it here, that does not work either, in that + // case the condition variable may be used twice: + // + // - Wake up because its reply arrived + // - Wake up because it must become the leader + // + // but only the first one has any effect, so the leader is + // lost. + TAO_LF_Follower_Auto_Adder auto_adder (*this, follower); + + if (max_wait_time == 0) { - // Add ourselves to the list, do it everytime we wake up - // from the CV loop. Because: - // - // - The leader thread could have elected us as the new - // leader. - // - Before we can assume the role another thread becomes - // the leader - // - But our condition variable could have been removed - // already, if we don't add it again we will never wake - // up. - // - // Notice that we can have spurious wake ups, in that case - // adding the leader results in an error, that must be - // ignored. - // You may be thinking of not removing the condition - // variable in the code that sends the signal, but - // removing it here, that does not work either, in that - // case the condition variable may be used twice: - // - // - Wake up because its reply arrived - // - Wake up because it must become the leader - // - // but only the first one has any effect, so the leader is - // lost. - TAO_LF_Follower_Auto_Adder auto_adder (*this, follower); - - if (max_wait_time == 0) + if (follower->wait (max_wait_time) == -1) { - if (follower->wait (max_wait_time) == -1) - { - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event, " - " (follower) [no timer, cond failed]\n", - t_id)); - - // @@ Michael: What is our error handling in this case? - // We could be elected as leader and - // no leader would come in? - return -1; - } + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event, " + " (follower) [no timer, cond failed]\n", + t_id)); + + // @@ Michael: What is our error handling in this case? + // We could be elected as leader and + // no leader would come in? + return -1; } - else + } + else + { + countdown.update (); + ACE_Time_Value tv = ACE_OS::gettimeofday (); + tv += *max_wait_time; + if (follower->wait (&tv) == -1) { - countdown.update (); - ACE_Time_Value tv = ACE_OS::gettimeofday (); - tv += *max_wait_time; - if (follower->wait (&tv) == -1) + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Leader_Follower[%d]::wait, " + "(follower) [has timer, follower failed]\n", + t_id )); + + // If we have timedout set the state in the + // LF_Event. We call the non-locking, + // no-signalling method on LF_Event. + if (errno == ETIME) + // We have timedout + event->set_state (TAO_LF_Event::LFS_TIMEOUT); + + if (!event->successful ()) + { + // Remove follower can fail because either + // 1) the condition was satisfied (i.e. reply + // received or queue drained), or + // 2) somebody elected us as leader, or + // 3) the connection got closed. + // + // Therefore: + // If remove_follower fails and the condition + // was not satisfied, we know that we got + // elected as a leader. + // But we got a timeout, so we cannot become + // the leader, therefore, we have to select a + // new leader. + // + + if (this->elect_new_leader () == -1 + && TAO_debug_level > 0) { - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - Leader_Follower[%d]::wait, " - "(follower) [has timer, follower failed]\n", - t_id )); - - // If we have timedout set the state in the - // LF_Event. We call the non-locking, - // no-signalling method on LF_Event. - if (errno == ETIME) - // We have timedout - event->set_state (TAO_LF_Event::LFS_TIMEOUT); - - if (!event->successful ()) - { - // Remove follower can fail because either - // 1) the condition was satisfied (i.e. reply - // received or queue drained), or - // 2) somebody elected us as leader, or - // 3) the connection got closed. - // - // Therefore: - // If remove_follower fails and the condition - // was not satisfied, we know that we got - // elected as a leader. - // But we got a timeout, so we cannot become - // the leader, therefore, we have to select a - // new leader. - // - - if (this->elect_new_leader () == -1 - && TAO_debug_level > 0) - { - ACE_ERROR ((LM_ERROR, - "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event, " - "elect_new_leader failed\n", - t_id )); - } - } - - - return -1; + ACE_ERROR ((LM_ERROR, + "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event, " + "elect_new_leader failed\n", + t_id )); } - } + } + + + return -1; + } } + } // End Scope #4: loop to handle spurious wakeups countdown.update (); @@ -364,69 +437,118 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, // We only get here if we woke up but the reply is not // complete yet, time to assume the leader role.... // i.e. ACE_ASSERT (event->successful () == 0); - } + } // End Scope #3: we are no longer a follower + + // = Leader Code. + + // The only way to reach this point is if we must become the + // leader, because there is no leader or we have to update to a + // leader or we are doing nested upcalls in this case we do + // increase the refcount on the leader in TAO_ORB_Core. + + // Calls this->set_client_leader_thread () on + // construction and this->reset_client_leader_thread () + // on destruction. Note that this may increase the refcount of + // the leader. + { // Scope #5: We are now the client-leader + TAO_LF_Client_Leader_Thread_Helper client_leader_thread_helper (*this); + ACE_UNUSED_ARG (client_leader_thread_helper); + + { // Scope #6: release the lock via a reverse lock + ACE_GUARD_RETURN (ACE_Reverse_Lock<TAO_SYNCH_MUTEX>, rev_mon, + this->reverse_lock (), -1); + + // Become owner of the reactor. + ACE_Reactor *reactor = this->reactor_; + reactor->owner (ACE_Thread::self ()); + + // Run the reactor event loop. + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event," + " (leader) enter reactor event loop\n", + t_id)); + + // If we got our event, no need to run the event loop any + // further. + while (event->keep_waiting ()) + { + // Run the event loop. + result = reactor->handle_events (max_wait_time); + + // Did we timeout? If so, stop running the loop. + if (result == 0 && + max_wait_time != 0 && + *max_wait_time == ACE_Time_Value::zero) + break; + + // Other errors? If so, stop running the loop. + if (result == -1) + break; + + // Has an event loop thread become available to take over? + // Yes, we are checking this without the lock, however, if + // we get a false reading we'll just circle around and + // become leader again... + if (this->event_loop_threads_waiting_) + break; + // Did we give up leadership? + if (!this->is_client_leader_thread ()) + break; + // Otherwise, keep going... + } - // = Leader Code. + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event," + " (leader) exit reactor event loop\n", + t_id)); + } // End Scope #6: we should now hold the lock again - // The only way to reach this point is if we must become the - // leader, because there is no leader or we have to update to a - // leader or we are doing nested upcalls in this case we do - // increase the refcount on the leader in TAO_ORB_Core. + // End artificial scope for auto_ptr like helpers calling: + // this->reset_client_leader_thread (). - // Calls this->set_client_leader_thread () on - // construction and this->reset_client_leader_thread () - // on destruction. Note that this may increase the refcount of - // the leader. - TAO_LF_Client_Leader_Thread_Helper client_leader_thread_helper (*this); - ACE_UNUSED_ARG (client_leader_thread_helper); + } // End Scope #5: we are no longer a client-leader + // We only get here if we were the client leader and either our + // event completed or an event loop thread has become available to + // become leader. - { - ACE_GUARD_RETURN (ACE_Reverse_Lock<TAO_SYNCH_MUTEX>, rev_mon, - this->reverse_lock (), -1); - - // Become owner of the reactor. - ACE_Reactor *reactor = this->reactor_; - reactor->owner (ACE_Thread::self ()); - - // Run the reactor event loop. - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event," - " (leader) enter reactor event loop\n", - t_id)); - - // If we got our event, no need to run the event loop any - // further. - while (event->keep_waiting ()) - { - // Run the event loop. - result = reactor->handle_events (max_wait_time); + // resume any deferred events before we switch to a new leader thread + this->resume_events (); - // Did we timeout? If so, stop running the loop. - if (result == 0 && - max_wait_time != 0 && - *max_wait_time == ACE_Time_Value::zero) - break; + // Wake and yield to any event loop threads that may be waiting to + // take leadership - otherwise we will just loop around and take + // leadership again (because we hold the lock). + if (this->event_loop_threads_waiting_ && !this->leader_available ()) + { + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event," + " (client) waking and yielding to allow event thread leadership\n", + t_id)); + + // Wake up the next leader (in case not yet done) + if (this->elect_new_leader () == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event," + " failed to elect new leader\n", + t_id), + -1); + + // Yield, providing the event thread some time to grab leadership + ACE_GUARD_RETURN (ACE_Reverse_Lock<TAO_SYNCH_MUTEX>, rev_mon, + this->reverse_lock (), -1); + ACE_OS::thr_yield (); + } - // Other errors? If so, stop running the loop. - if (result == -1) - break; + } // End Scope #2: we loop here if our event is incomplete - // Otherwise, keep going... - } - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - Leader_Follower[%d]::wait_for_event," - " (leader) exit reactor event loop\n", - t_id)); - } - } - // // End artificial scope for auto_ptr like helpers calling: - // this->reset_client_thread () and (maybe) - // this->reset_client_leader_thread (). - // + // this->reset_client_thread () + + // We should only get here when our event is complete or timed-out + } // End Scope #1 // Wake up the next leader, we cannot do that in handle_input, // because the woken up thread would try to get into handle_events, diff --git a/TAO/tao/Leader_Follower.h b/TAO/tao/Leader_Follower.h index 1cf90a9675a..36291bea902 100644 --- a/TAO/tao/Leader_Follower.h +++ b/TAO/tao/Leader_Follower.h @@ -27,6 +27,7 @@ #include "ace/Intrusive_List.h" #include "ace/Intrusive_List_Node.h" #include "ace/OS_NS_Thread.h" +#include "ace/Event_Handler.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Reactor; @@ -187,6 +188,11 @@ public: /// Set the new leader generator. void set_new_leader_generator(TAO_New_Leader_Generator *new_leader_generator); + /// Method to support deffering an event till later (f.i. in + /// cases where transport()->wait_strategy()->can_process_upcalls() + /// returns false). + int defer_event (ACE_Event_Handler*); + private: /// Shortcut to obtain the TSS resources of the orb core. TAO_ORB_Core_TSS_Resources *get_tss_resources (void) const; @@ -216,6 +222,10 @@ private: //@} + /// Method to allow the Leader_Follower to resume deferred events + /// when it is opportune to do so. + void resume_events (); + private: /// The orb core TAO_ORB_Core *orb_core_; @@ -261,6 +271,22 @@ private: /// Leader/Follower class uses this method to notify the system that /// we are out of leaders. TAO_New_Leader_Generator *new_leader_generator_; + + /// Class used to register deferred event handlers. + class Deferred_Event + : public ACE_Intrusive_List_Node<Deferred_Event> + { + public: + Deferred_Event (ACE_Event_Handler* h); + + ACE_Event_Handler* handler () const; + private: + ACE_Event_Handler_var eh_; + }; + + /// The set of deferred event handlers. + typedef ACE_Intrusive_List<Deferred_Event> Deferred_Event_Set; + Deferred_Event_Set deferred_event_set_; }; class TAO_Export TAO_LF_Client_Thread_Helper diff --git a/TAO/tao/Leader_Follower.inl b/TAO/tao/Leader_Follower.inl index 95d3f89fdc1..258c4dda450 100644 --- a/TAO/tao/Leader_Follower.inl +++ b/TAO/tao/Leader_Follower.inl @@ -139,6 +139,17 @@ TAO_Leader_Follower::set_upcall_thread (void) this->elect_new_leader (); } + else if (tss->client_leader_thread_ == 1) + { // We are client leader thread going to handle upcall. + // When we're only leading one level (which should + // now always be the case since we implement leadership + // abdication here) we can now give up leadership to allow a + // waiting event thread to take over leaderpship + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock ()); + this->reset_client_leader_thread (); + + this->elect_new_leader (); + } } ACE_INLINE bool @@ -160,9 +171,15 @@ ACE_INLINE void TAO_Leader_Follower::reset_client_leader_thread (void) { TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources (); - --tss->client_leader_thread_; - --this->leaders_; - --this->client_thread_is_leader_; + // We may be called twice when we gave up leadership from + // set_upcall_thread () if so tss->client_leader_thread_ may + // already have been decremented to 0 + if (tss->client_leader_thread_ > 0) + { + --tss->client_leader_thread_; + --this->leaders_; + --this->client_thread_is_leader_; + } } ACE_INLINE bool diff --git a/TAO/tao/Resume_Handle_Deferred.cpp b/TAO/tao/Resume_Handle_Deferred.cpp deleted file mode 100644 index c668f515a2d..00000000000 --- a/TAO/tao/Resume_Handle_Deferred.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// $Id$ - -#include "tao/Resume_Handle_Deferred.h" -#include "tao/Resume_Handle.h" -#include "tao/ORB_Core.h" -#include "ace/Reactor.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_Resume_Handle_Deferred::TAO_Resume_Handle_Deferred ( - TAO_ORB_Core* orbc, - ACE_Event_Handler* h) : - ACE_Event_Handler (orbc->reactor()) - , h_ (h) - , orbc_ (orbc) -{ - h->add_reference (); - this->reference_counting_policy ().value - (ACE_Event_Handler::Reference_Counting_Policy::ENABLED); -} - -TAO_Resume_Handle_Deferred::~TAO_Resume_Handle_Deferred (void) -{ -} - -int -TAO_Resume_Handle_Deferred:: handle_timeout (const ACE_Time_Value &, const void *) -{ - // Send a notification to the reactor to cause the awakening of a new - // follower, if there is one already available. - ACE_Reactor *reactor = this->orbc_->reactor (); - int const retval = reactor->notify (this->h_.handler (), ACE_Event_Handler::READ_MASK); - if (TAO_debug_level > 2) - { - // @@todo: need to think about what is the action that - // we can take when we get here with an error?! - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - TAO_Resume_Handle_Deferred[%d]::handle_timeout, ") - ACE_TEXT ("a connection_handler has been resumed, ") - ACE_TEXT ("notified the reactor, retval=%d.\n"), h_->get_handle (), retval)); - } - return -1; // -1 will cause the reactor to call handle_close() and dispose of the instance -} - -TAO_END_VERSIONED_NAMESPACE_DECL - diff --git a/TAO/tao/Resume_Handle_Deferred.h b/TAO/tao/Resume_Handle_Deferred.h deleted file mode 100644 index ce1c00bc977..00000000000 --- a/TAO/tao/Resume_Handle_Deferred.h +++ /dev/null @@ -1,61 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Resume_Handle_Deferred.h - * - * $Id$ - * - * @author Iliyan Jeliazkov <jeliazkov_i@ociweb.com> - */ -//============================================================================= - -#ifndef TAO_RESUME_HANDLE_DEFERRED_H -#define TAO_RESUME_HANDLE_DEFERRED_H - -#include /**/ "ace/pre.h" - -#include "TAO_Export.h" -#include "ace/Event_Handler.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include /**/ "tao/Versioned_Namespace.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_ORB_Core; - -/** - * @class TAO_Resume_Handle_Deferred - * - * @brief A utility class that helps in resuming handlers if TAO uses - * a TP Reactor from ACE. In contrast with the Resume_Handle class - * however, the resumption is performed at the expiration of a timer, - * previously registered with the reactor. TAO_Resume_Handle_Deferred - * will also notify the reactor (reactor->notify()) - */ -class TAO_Export TAO_Resume_Handle_Deferred : public ACE_Event_Handler -{ -public: - /// Ctor - TAO_Resume_Handle_Deferred (TAO_ORB_Core* orbc, ACE_Event_Handler* h); - - /// Destructor - ~TAO_Resume_Handle_Deferred (void); - - /// Handles the timeout event by resuming the handle and - /// calling the reactor->notify() - virtual int handle_timeout (const ACE_Time_Value &, const void * = 0); - -private: - ACE_Event_Handler_var h_; - TAO_ORB_Core * orbc_; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /*TAO_RESUME_HANDLE_DEFERRED_H*/ diff --git a/TAO/tao/Wait_On_LF_No_Upcall.cpp b/TAO/tao/Wait_On_LF_No_Upcall.cpp index 7396c2d1e7a..e8fe993ae51 100644 --- a/TAO/tao/Wait_On_LF_No_Upcall.cpp +++ b/TAO/tao/Wait_On_LF_No_Upcall.cpp @@ -6,6 +6,7 @@ #include "tao/ORB_Core.h" #include "tao/ORB_Core_TSS_Resources.h" #include "tao/debug.h" +#include "tao/Leader_Follower.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -103,6 +104,19 @@ namespace TAO return true; } + + int + Wait_On_LF_No_Upcall::defer_upcall (ACE_Event_Handler* eh) + { + if (TAO_debug_level > 6) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Wait_On_LF_No_Upcall[%d]::defer_upcall, " + "deferring upcall on transport " + "because upcalls temporarily suspended on this thread\n", + this->transport_->id())); + return this->transport_->orb_core ()->leader_follower ().defer_event (eh); + } + } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Wait_On_LF_No_Upcall.h b/TAO/tao/Wait_On_LF_No_Upcall.h index b058132529d..7bba7139470 100644 --- a/TAO/tao/Wait_On_LF_No_Upcall.h +++ b/TAO/tao/Wait_On_LF_No_Upcall.h @@ -54,6 +54,10 @@ namespace TAO /*! @copydoc TAO_Wait_Strategy::can_process_upcalls() */ virtual bool can_process_upcalls (void) const; + + /*! @copydoc TAO_Wait_Strategy::defer_upcall() */ + virtual int defer_upcall (ACE_Event_Handler*); + }; } diff --git a/TAO/tao/Wait_On_Leader_Follower.h b/TAO/tao/Wait_On_Leader_Follower.h index b34255be862..c10247bb8d9 100644 --- a/TAO/tao/Wait_On_Leader_Follower.h +++ b/TAO/tao/Wait_On_Leader_Follower.h @@ -62,6 +62,7 @@ public: /*! @copydoc TAO_Wait_Strategy::can_process_upcalls() */ virtual bool can_process_upcalls (void) const; + }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Wait_Strategy.cpp b/TAO/tao/Wait_Strategy.cpp index c310221b7ad..cff977b9031 100644 --- a/TAO/tao/Wait_Strategy.cpp +++ b/TAO/tao/Wait_Strategy.cpp @@ -22,6 +22,12 @@ TAO_Wait_Strategy::~TAO_Wait_Strategy (void) { } +int +TAO_Wait_Strategy::defer_upcall (ACE_Event_Handler*) +{ + return -1; +} + /* * Hook to comment out this method in the lf wait strategy */ diff --git a/TAO/tao/Wait_Strategy.h b/TAO/tao/Wait_Strategy.h index 4efc22ccaa6..78cf346fce2 100644 --- a/TAO/tao/Wait_Strategy.h +++ b/TAO/tao/Wait_Strategy.h @@ -32,6 +32,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL class TAO_ORB_Core; class TAO_Transport; class TAO_Synch_Reply_Dispatcher; +class ACE_Event_Handler; /** * @class TAO_Wait_Strategy @@ -79,6 +80,14 @@ public: */ virtual bool can_process_upcalls (void) const = 0; + /// Method to support deffering an upcall event till later in + /// cases where can_process_upcalls() returns false. + /// Some wait strategies like Wait_On_LF_No_Upcall allow an + /// event to be deferred at the Leader_Follower which resumes + /// the upcall at an opportune moment (when a new leader thread + /// is activated). + virtual int defer_upcall (ACE_Event_Handler*); + /// Get method for the flag bool is_registered (void) const; diff --git a/TAO/tao/tao.mpc b/TAO/tao/tao.mpc index d431edf9503..e13989706e0 100644 --- a/TAO/tao/tao.mpc +++ b/TAO/tao/tao.mpc @@ -251,7 +251,6 @@ project(TAO) : acelib, install, tao_output, taodefaults, pidl, extra_core, taoid RequestInterceptor_Adapter.cpp Resource_Factory.cpp Resume_Handle.cpp - Resume_Handle_Deferred.cpp Server_Strategy_Factory.cpp ServerRequestInterceptor_Adapter.cpp ServerRequestInterceptor_Adapter_Factory.cpp @@ -553,7 +552,6 @@ project(TAO) : acelib, install, tao_output, taodefaults, pidl, extra_core, taoid RequestInterceptor_Adapter.h Resource_Factory.h Resume_Handle.h - Resume_Handle_Deferred.h Seq_Out_T.h Seq_Var_T.h Sequence_T.h diff --git a/TAO/tests/Bug_3531b_Regression/Bug_3531b_Regression.mpc b/TAO/tests/Bug_3531b_Regression/Bug_3531b_Regression.mpc index d974e26d6c5..fb15d15dda0 100644 --- a/TAO/tests/Bug_3531b_Regression/Bug_3531b_Regression.mpc +++ b/TAO/tests/Bug_3531b_Regression/Bug_3531b_Regression.mpc @@ -1,7 +1,6 @@ // $Id$ project(*Server): taoserver { - requires += dummy_label after += *idl Source_Files { server.cpp diff --git a/TAO/tests/Bug_3531b_Regression/server.cpp b/TAO/tests/Bug_3531b_Regression/server.cpp index 5d5876a6be0..086d101761f 100644 --- a/TAO/tests/Bug_3531b_Regression/server.cpp +++ b/TAO/tests/Bug_3531b_Regression/server.cpp @@ -11,6 +11,7 @@ #include "tao/Transport.h" #include "ace/Task_T.h" #include "tao/TAO_Export.h" +#include "ace/TP_Reactor.h" int nthreads = 4; bool debug = false; @@ -85,7 +86,8 @@ private: bool shutdown_; }; -ACE_TSS<Worker> workers; +ACE_TSS<Worker> *workers_p = 0; +#define workers (*workers_p) int Worker::svc (void) { @@ -143,12 +145,23 @@ bool Worker::shutdown (void) return shutdown_; } -class Test_Reactor: public ACE_Reactor +class Test_Reactor: public ACE_TP_Reactor { public: + Test_Reactor (size_t max_number_of_handles, + bool restart = false, + ACE_Sig_Handler *sh = 0, + ACE_Timer_Queue *tq = 0, + bool mask_signals = true, + int s_queue = ACE_Select_Reactor_Token::FIFO) + : ACE_TP_Reactor(max_number_of_handles, restart, sh, tq, mask_signals, s_queue) {} + + // This is the method that the Leader_Follower object calls. virtual int handle_events (ACE_Time_Value * = 0) { + if (TAO_debug_level > 10) + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Executing Test_Reactor::handle_events\n")); // This is called by client leader threads. Note, the loop here // glosses over the fact that the Leader_Follower code does not // work quite the way we want it to. Namely, this logic: @@ -180,19 +193,34 @@ class Test_Resource_Factory: public TAO_Default_Resource_Factory { public: Test_Resource_Factory () - : test_reactor_ (new Test_Reactor) {} - virtual ACE_Reactor *get_reactor (void) + virtual ACE_Reactor_Impl* allocate_reactor_impl (void) const { - return test_reactor_; + ACE_Reactor_Impl *impl = 0; + /* + * Hook to specialize TAO's reactor implementation. + */ + //@@ TAO_REACTOR_SPL_COMMENT_HOOK_START + ACE_NEW_RETURN (impl, + Test_Reactor (ACE::max_handles (), + 1, + (ACE_Sig_Handler*)0, + (ACE_Timer_Queue*)0, + this->reactor_mask_signals_, + ACE_Select_Reactor_Token::LIFO), + 0); + //@@ TAO_REACTOR_SPL_COMMENT_HOOK_END + return impl; } + private: - // This is allocated in the constructor and deallocated by the ORB_Core. - Test_Reactor* test_reactor_; }; -ACE_FACTORY_DEFINE (TAO, Test_Resource_Factory) +// force export flag otherwise Windoze will complain +#define TAO_Test_Export ACE_Proper_Export_Flag + +ACE_FACTORY_DEFINE (TAO_Test, Test_Resource_Factory) ACE_STATIC_SVC_DEFINE (Test_Resource_Factory, ACE_TEXT ("Resource_Factory"), ACE_SVC_OBJ_T, @@ -202,6 +230,9 @@ ACE_STATIC_SVC_DEFINE (Test_Resource_Factory, 0) ACE_STATIC_SVC_REQUIRE (Test_Resource_Factory); +int load_test_resources = +ACE_Service_Config::process_directive (ace_svc_desc_Test_Resource_Factory); + class Test_LF_Event: public TAO_LF_Event { public: @@ -1023,19 +1054,19 @@ void Test_10 (TAO_ORB_Core* orb_core ) int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { + // scope TSS holder within main scope + // so we're certain it gets destroyed before the + // ACE object manager + ACE_TSS<Worker> workers_; + // provide global access + workers_p = &workers_; + try { CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); if (parse_args (argc, argv) != 0) return 1; - // First we need to replace the resource factory in the ORB_Core - // to our test version, which will return our special test - // reactor to the Leader_Follower object. - ACE_STATIC_SVC_REGISTER (Test_Resource_Factory); - - orb->orb_core ()->set_resource_factory ("Test_Resource_Factory"); - // Make sure the reactor is initialised in the leader_follower ACE_Reactor* reactor = orb->orb_core ()->leader_follower ().reactor (); TEST_ASSERT ((reactor != 0)); diff --git a/TAO/tests/Bug_3768_Regression/Bug_3768_Test.mpc b/TAO/tests/Bug_3768_Regression/Bug_3768_Test.mpc new file mode 100644 index 00000000000..6cd465a8002 --- /dev/null +++ b/TAO/tests/Bug_3768_Regression/Bug_3768_Test.mpc @@ -0,0 +1,41 @@ +// -*- MPC -*- +// $Id: Bug_3768_Test.mpc + +project(*idl): taoidldefaults { + idlflags += -Sp + IDL_Files { + Test.idl + } + custom_only = 1 +} + +project(*Server): taoserver { + after += *idl + exename = server + Source_Files { + TestServer.cpp + server.cpp + } + Source_Files { + TestC.cpp + TestS.cpp + } + IDL_Files { + } +} + +project(*Client): taoserver { + after += *idl + exename = client + Source_Files { + TestCallback.cpp + client.cpp + } + Source_Files { + TestC.cpp + TestS.cpp + } + IDL_Files { + } +} + diff --git a/TAO/tests/Bug_3768_Regression/Test.idl b/TAO/tests/Bug_3768_Regression/Test.idl new file mode 100644 index 00000000000..15043619d8f --- /dev/null +++ b/TAO/tests/Bug_3768_Regression/Test.idl @@ -0,0 +1,28 @@ +// +// $Id: Test.idl +// + +/// Put the interfaces in a module, to avoid global namespace pollution +module Test +{ + /// Interface for the client, which is called back from the server + interface TestCallback + { + /// Called to cause the client to start worker threads to handle + /// further calls: does not return + void start_threads_and_block (); + + /// Called to check that the client is able to perform CORBA work + void test_call (); + + /// A method to stop the client waiting for any more calls + oneway void shutdown (); + }; + + /// Interface for the server, called from the client to start the test + interface TestServer + { + /// Pass the callback object to the server, which the server then calls on + void pass_callback (in TestCallback test); + }; +}; diff --git a/TAO/tests/Bug_3768_Regression/TestCallback.cpp b/TAO/tests/Bug_3768_Regression/TestCallback.cpp new file mode 100644 index 00000000000..9923c07418a --- /dev/null +++ b/TAO/tests/Bug_3768_Regression/TestCallback.cpp @@ -0,0 +1,31 @@ +// +// $Id: TestCallback.cpp +// +#include "TestCallback.h" +#include "ace/OS_NS_unistd.h" + +TestCallback::TestCallback (CORBA::ORB_ptr orb) + : work_ (orb) +{ +} + +void +TestCallback::start_threads_and_block (void) +{ + ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - start_threads_and_block\n")); + work_.activate(0,10); + ACE_OS::sleep(-1); +} + +void +TestCallback::test_call (void) +{ + ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - test_call\n")); +} + +void +TestCallback::shutdown (void) +{ + ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - test completed\n")); + exit (0); +} diff --git a/TAO/tests/Bug_3768_Regression/TestCallback.h b/TAO/tests/Bug_3768_Regression/TestCallback.h new file mode 100644 index 00000000000..7eaef99fdf2 --- /dev/null +++ b/TAO/tests/Bug_3768_Regression/TestCallback.h @@ -0,0 +1,47 @@ +// +// $Id: TestCallback.h +// + +#ifndef TESTCALLBACK_H +#define TESTCALLBACK_H +#include /**/ "ace/pre.h" + +#include "TestS.h" +#include "ace/Task.h" + +class Worker : public ACE_Task_Base +{ +public: + Worker(CORBA::ORB_ptr orb) : orb_(CORBA::ORB::_duplicate(orb)) + { + } + + int svc(void) + { + orb_->run(); + return 0; + } + +private: + CORBA::ORB_var orb_; +}; + +/// Implement the Test::TestCallback interface +class TestCallback + : public virtual POA_Test::TestCallback +{ +public: + /// Constructor + TestCallback (CORBA::ORB_ptr orb); + + // = The skeleton methods + virtual void start_threads_and_block (void); + virtual void test_call (void); + virtual void shutdown (void); + +private: + Worker work_; +}; + +#include /**/ "ace/post.h" +#endif /* TESTCALLBACK_H */ diff --git a/TAO/tests/Bug_3768_Regression/TestServer.cpp b/TAO/tests/Bug_3768_Regression/TestServer.cpp new file mode 100644 index 00000000000..1df313ca1a1 --- /dev/null +++ b/TAO/tests/Bug_3768_Regression/TestServer.cpp @@ -0,0 +1,32 @@ +// +// $Id: TestServer.cpp +// +#include "TestServer.h" + +void +TestServer::pass_callback (Test::TestCallback_ptr test) +{ + // Save the callback object + callback_ = Test::TestCallback::_duplicate(test); + + // Start worker threads on the client: this call won't come back + callback_->start_threads_and_block(); +} + +bool +TestServer::got_callback (void) +{ + return (callback_.in() != 0); +} + +void +TestServer::make_callback (void) +{ + callback_->test_call(); +} + +void +TestServer::shutdown_client (void) +{ + callback_->shutdown(); +} diff --git a/TAO/tests/Bug_3768_Regression/TestServer.h b/TAO/tests/Bug_3768_Regression/TestServer.h new file mode 100644 index 00000000000..197ba735b0a --- /dev/null +++ b/TAO/tests/Bug_3768_Regression/TestServer.h @@ -0,0 +1,28 @@ +// +// $Id: TestServer.h +// + +#ifndef TESTSERVER_H +#define TESTSERVER_H +#include /**/ "ace/pre.h" + +#include "TestS.h" + +/// Implement the Test::TestServer interface +class TestServer + : public virtual POA_Test::TestServer +{ +public: + // = The skeleton methods + virtual void pass_callback (Test::TestCallback_ptr test); + + bool got_callback (void); + void make_callback (void); + void shutdown_client (void); + +private: + Test::TestCallback_var callback_; +}; + +#include /**/ "ace/post.h" +#endif /* TESTSERVER_H */ diff --git a/TAO/tests/Bug_3768_Regression/client.cpp b/TAO/tests/Bug_3768_Regression/client.cpp new file mode 100644 index 00000000000..ec457aaea2f --- /dev/null +++ b/TAO/tests/Bug_3768_Regression/client.cpp @@ -0,0 +1,101 @@ +// $Id: client.cpp + +#include "TestCallback.h" +#include "ace/Get_Opt.h" + +const ACE_TCHAR *ior = ACE_TEXT ("file://test.ior"); + +int +parse_args (int argc, ACE_TCHAR *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:")); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'k': + ior = get_opts.opt_arg (); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-k <ior> " + "\n", + argv [0]), + -1); + } + // Indicates successful parsing of the command line + return 0; +} + +int +ACE_TMAIN(int argc, ACE_TCHAR *argv[]) +{ + try + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + + CORBA::Object_var poa_object = + orb->resolve_initial_references("RootPOA"); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in ()); + + if (CORBA::is_nil (root_poa.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Panic: nil RootPOA\n"), + 1); + + PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (); + + if (parse_args (argc, argv) != 0) + return 1; + + // Create client callback CORBA object + + TestCallback *test_impl = 0; + ACE_NEW_RETURN (test_impl, + TestCallback (orb.in()), + 1); + PortableServer::ServantBase_var owner_transfer(test_impl); + + PortableServer::ObjectId_var id = + root_poa->activate_object (test_impl); + + CORBA::Object_var object = root_poa->id_to_reference (id.in ()); + + Test::TestCallback_var client = Test::TestCallback::_narrow (object.in ()); + + poa_manager->activate (); + + // Get server CORBA object and call it + + CORBA::Object_var tmp = orb->string_to_object(ior); + + Test::TestServer_var server = Test::TestServer::_narrow(tmp.in ()); + + if (CORBA::is_nil (server.in ())) + { + ACE_ERROR_RETURN ((LM_DEBUG, + "Nil Test::TestServer reference <%s>\n", + ior), + 1); + } + + ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - calling server\n")); + server->pass_callback (client.in()); + + ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - call failed to block\n")); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + return 1; + } + + ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - not stopped by server\n")); + return 1; +} diff --git a/TAO/tests/Bug_3768_Regression/run_test.pl b/TAO/tests/Bug_3768_Regression/run_test.pl new file mode 100755 index 00000000000..719974e5c50 --- /dev/null +++ b/TAO/tests/Bug_3768_Regression/run_test.pl @@ -0,0 +1,73 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::TestTarget; + +$status = 0; +$debug_level = '0'; + +foreach $i (@ARGV) { + if ($i eq '-debug') { + $debug_level = '10'; + } +} + +my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; +my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n"; + +my $iorbase = "server.ior"; +my $server_iorfile = $server->LocalFile ($iorbase); +my $client_iorfile = $client->LocalFile ($iorbase); +$server->DeleteFile($iorbase); +$client->DeleteFile($iorbase); + +$SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile"); +$CL = $client->CreateProcess ("client", "-k file://$client_iorfile"); +$server_status = $SV->Spawn (); + +if ($server_status != 0) { + print STDERR "ERROR: server returned $server_status\n"; + exit 1; +} + +if ($server->WaitForFileTimed ($iorbase, + $server->ProcessStartWaitInterval()) == -1) { + print STDERR "ERROR: cannot find file <$server_iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} + +if ($server->GetFile ($iorbase) == -1) { + print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} +if ($client->PutFile ($iorbase) == -1) { + print STDERR "ERROR: cannot set file <$client_iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} + +$client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval()); + +if ($client_status != 0) { + print STDERR "ERROR: client returned $client_status\n"; + $status = 1; +} + +$server_status = $SV->WaitKill ($server->ProcessStopWaitInterval()); + +if ($server_status != 0) { + print STDERR "ERROR: server returned $server_status\n"; + $status = 1; +} + +$server->DeleteFile($iorbase); +$client->DeleteFile($iorbase); + +exit $status; diff --git a/TAO/tests/Bug_3768_Regression/server.cpp b/TAO/tests/Bug_3768_Regression/server.cpp new file mode 100644 index 00000000000..c18aac37313 --- /dev/null +++ b/TAO/tests/Bug_3768_Regression/server.cpp @@ -0,0 +1,137 @@ +// $Id: server.cpp + +#include "TestServer.h" +#include "ace/Get_Opt.h" +#include "ace/OS_NS_unistd.h" +#include "ace/Task.h" + +const ACE_TCHAR *ior_output_file = ACE_TEXT ("test.ior"); + +class Worker : public ACE_Task_Base +{ +public: + Worker(CORBA::ORB_ptr orb) : orb_(CORBA::ORB::_duplicate(orb)) + { + } + + int svc(void) + { + orb_->run(); + return 0; + } + +private: + CORBA::ORB_var orb_; +}; + +int +parse_args (int argc, ACE_TCHAR *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("o:")); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'o': + ior_output_file = get_opts.opt_arg (); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-o <iorfile>" + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} + +int +ACE_TMAIN(int argc, ACE_TCHAR *argv[]) +{ + try + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv); + + CORBA::Object_var poa_object = + orb->resolve_initial_references("RootPOA"); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in ()); + + if (CORBA::is_nil (root_poa.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Panic: nil RootPOA\n"), + 1); + + PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (); + + if (parse_args (argc, argv) != 0) + return 1; + + TestServer *test_impl = 0; + ACE_NEW_RETURN (test_impl, + TestServer (), + 1); + PortableServer::ServantBase_var owner_transfer(test_impl); + + PortableServer::ObjectId_var id = + root_poa->activate_object (test_impl); + + CORBA::Object_var object = root_poa->id_to_reference (id.in ()); + + Test::TestServer_var test = Test::TestServer::_narrow (object.in ()); + + CORBA::String_var ior = orb->object_to_string (test.in ()); + + // Output the IOR to the <ior_output_file> + FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); + if (output_file == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot open output file for writing IOR: %s\n", + ior_output_file), + 1); + ACE_OS::fprintf (output_file, "%s", ior.in ()); + ACE_OS::fclose (output_file); + + poa_manager->activate (); + + // Run a CORBA worker thread + Worker work (orb.in()); + work.activate (0,1); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - waiting for client to call\n")); + ACE_OS::sleep (10); + if (test_impl->got_callback() == false) { + ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - client did not make call\n")); + return 1; + } + + ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - making repeated calls to client\n")); + for (int i = 0; i < 10; i++) + { + ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - calling client attempt %d\n", i)); + test_impl->make_callback(); + } + + ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - stopping client\n")); + test_impl->shutdown_client(); + + ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - test completed\n")); + + root_poa->destroy (1, 1); + + orb->destroy (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + return 1; + } + + return 0; +} |