From 322d0a3e30d2e608108e0d7caf6bdcddbd728081 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 11:42:23 +0100 Subject: Major cleanup in PortableServer library --- .../PortableServer/Active_Policy_Strategies.cpp | 320 +++++++++++---------- TAO/tao/PortableServer/Active_Policy_Strategies.h | 54 ++-- .../PortableServer/Active_Policy_Strategies.inl | 16 +- .../PortableServer/Default_Servant_Dispatcher.h | 6 +- TAO/tao/PortableServer/IdAssignmentPolicy.h | 4 +- TAO/tao/PortableServer/IdAssignmentStrategy.cpp | 10 - TAO/tao/PortableServer/IdAssignmentStrategy.h | 10 +- .../PortableServer/IdAssignmentStrategyFactory.h | 47 --- .../IdAssignmentStrategyFactoryImpl.cpp | 64 ----- .../IdAssignmentStrategyFactoryImpl.h | 49 ---- .../PortableServer/IdAssignmentStrategySystem.cpp | 13 - .../PortableServer/IdAssignmentStrategySystem.h | 15 +- .../PortableServer/IdAssignmentStrategyUser.cpp | 13 - TAO/tao/PortableServer/IdAssignmentStrategyUser.h | 15 +- TAO/tao/PortableServer/IdUniquenessPolicy.cpp | 2 +- TAO/tao/PortableServer/IdUniquenessPolicy.h | 4 +- TAO/tao/PortableServer/IdUniquenessStrategy.cpp | 23 ++ TAO/tao/PortableServer/IdUniquenessStrategy.h | 20 +- .../PortableServer/IdUniquenessStrategyFactory.h | 48 ---- .../IdUniquenessStrategyFactoryImpl.cpp | 93 ------ .../IdUniquenessStrategyFactoryImpl.h | 48 ---- .../IdUniquenessStrategyMultiple.cpp | 20 -- .../PortableServer/IdUniquenessStrategyMultiple.h | 23 +- .../PortableServer/IdUniquenessStrategyUnique.cpp | 27 +- .../PortableServer/IdUniquenessStrategyUnique.h | 27 +- .../IdUniquenessStrategyUniqueFactoryImpl.cpp | 59 ---- .../IdUniquenessStrategyUniqueFactoryImpl.h | 48 ---- .../PortableServer/ImplicitActivationStrategy.cpp | 23 -- .../PortableServer/ImplicitActivationStrategy.h | 8 +- .../ImplicitActivationStrategyExplicit.cpp | 13 - .../ImplicitActivationStrategyExplicit.h | 14 +- .../ImplicitActivationStrategyFactory.h | 47 --- .../ImplicitActivationStrategyFactoryImpl.cpp | 67 ----- .../ImplicitActivationStrategyFactoryImpl.h | 49 ---- .../ImplicitActivationStrategyImplicit.cpp | 13 - .../ImplicitActivationStrategyImplicit.h | 13 +- TAO/tao/PortableServer/LifespanStrategy.cpp | 7 +- TAO/tao/PortableServer/LifespanStrategy.h | 13 +- TAO/tao/PortableServer/LifespanStrategyFactory.h | 48 ---- .../PortableServer/LifespanStrategyFactoryImpl.cpp | 90 ------ .../PortableServer/LifespanStrategyFactoryImpl.h | 50 ---- .../PortableServer/LifespanStrategyPersistent.cpp | 6 - .../PortableServer/LifespanStrategyPersistent.h | 23 +- .../LifespanStrategyPersistentFactoryImpl.cpp | 58 ---- .../LifespanStrategyPersistentFactoryImpl.h | 50 ---- .../PortableServer/LifespanStrategyTransient.cpp | 6 - TAO/tao/PortableServer/LifespanStrategyTransient.h | 25 +- .../LifespanStrategyTransientFactoryImpl.cpp | 59 ---- .../LifespanStrategyTransientFactoryImpl.h | 51 ---- TAO/tao/PortableServer/Object_Adapter.cpp | 19 +- TAO/tao/PortableServer/Object_Adapter.h | 4 +- TAO/tao/PortableServer/Object_Adapter.inl | 4 +- TAO/tao/PortableServer/Policy_Strategy.h | 47 --- TAO/tao/PortableServer/PortableServer.cpp | 141 +-------- TAO/tao/PortableServer/Regular_POA.cpp | 4 - TAO/tao/PortableServer/Regular_POA.h | 10 +- .../PortableServer/RequestProcessingStrategy.cpp | 22 +- TAO/tao/PortableServer/RequestProcessingStrategy.h | 22 +- .../RequestProcessingStrategyAOMOnly.cpp | 15 +- .../RequestProcessingStrategyAOMOnly.h | 47 ++- ...RequestProcessingStrategyAOMOnlyFactoryImpl.cpp | 61 ---- .../RequestProcessingStrategyAOMOnlyFactoryImpl.h | 51 ---- .../RequestProcessingStrategyDefaultServant.cpp | 35 +-- .../RequestProcessingStrategyDefaultServant.h | 46 ++- .../RequestProcessingStrategyDefaultServantFI.cpp | 68 ----- .../RequestProcessingStrategyDefaultServantFI.h | 54 ---- .../RequestProcessingStrategyFactory.h | 50 ---- .../RequestProcessingStrategyFactoryImpl.cpp | 141 --------- .../RequestProcessingStrategyFactoryImpl.h | 50 ---- .../RequestProcessingStrategyServantActivator.cpp | 13 +- .../RequestProcessingStrategyServantActivator.h | 28 +- ...RequestProcessingStrategyServantActivatorFI.cpp | 80 ------ .../RequestProcessingStrategyServantActivatorFI.h | 54 ---- .../RequestProcessingStrategyServantLocator.cpp | 13 +- .../RequestProcessingStrategyServantLocator.h | 26 +- .../RequestProcessingStrategyServantLocatorFI.cpp | 81 ------ .../RequestProcessingStrategyServantLocatorFI.h | 54 ---- .../RequestProcessingStrategyServantManager.cpp | 10 - .../RequestProcessingStrategyServantManager.h | 19 +- TAO/tao/PortableServer/Root_POA.cpp | 12 +- TAO/tao/PortableServer/Root_POA.h | 4 +- .../PortableServer/ServantRetentionStrategy.cpp | 23 ++ TAO/tao/PortableServer/ServantRetentionStrategy.h | 13 +- .../ServantRetentionStrategyFactory.h | 47 --- .../ServantRetentionStrategyFactoryImpl.cpp | 95 ------ .../ServantRetentionStrategyFactoryImpl.h | 48 ---- .../ServantRetentionStrategyNonRetain.cpp | 12 +- .../ServantRetentionStrategyNonRetain.h | 75 +++-- ...ervantRetentionStrategyNonRetainFactoryImpl.cpp | 65 ----- .../ServantRetentionStrategyNonRetainFactoryImpl.h | 52 ---- .../ServantRetentionStrategyRetain.cpp | 20 +- .../ServantRetentionStrategyRetain.h | 78 ++--- .../ServantRetentionStrategyRetainFactoryImpl.cpp | 60 ---- .../ServantRetentionStrategyRetainFactoryImpl.h | 49 ---- TAO/tao/PortableServer/Servant_Location.h | 16 +- TAO/tao/PortableServer/Servant_Upcall.cpp | 2 +- TAO/tao/PortableServer/ThreadStrategy.cpp | 21 -- TAO/tao/PortableServer/ThreadStrategy.h | 13 +- TAO/tao/PortableServer/ThreadStrategyFactory.h | 49 ---- .../PortableServer/ThreadStrategyFactoryImpl.cpp | 95 ------ TAO/tao/PortableServer/ThreadStrategyFactoryImpl.h | 48 ---- .../PortableServer/ThreadStrategyORBControl.cpp | 18 -- TAO/tao/PortableServer/ThreadStrategyORBControl.h | 12 +- TAO/tao/PortableServer/ThreadStrategySingle.cpp | 19 -- TAO/tao/PortableServer/ThreadStrategySingle.h | 8 +- .../ThreadStrategySingleFactoryImpl.cpp | 64 ----- .../ThreadStrategySingleFactoryImpl.h | 52 ---- 107 files changed, 561 insertions(+), 3589 deletions(-) delete mode 100644 TAO/tao/PortableServer/IdAssignmentStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.h create mode 100644 TAO/tao/PortableServer/IdUniquenessStrategy.cpp delete mode 100644 TAO/tao/PortableServer/IdUniquenessStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/ImplicitActivationStrategy.cpp delete mode 100644 TAO/tao/PortableServer/ImplicitActivationStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/LifespanStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/LifespanStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/LifespanStrategyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/Policy_Strategy.h delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.cpp delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.cpp delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.h delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.cpp delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h create mode 100644 TAO/tao/PortableServer/ServantRetentionStrategy.cpp delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/ThreadStrategy.cpp delete mode 100644 TAO/tao/PortableServer/ThreadStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/ThreadStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/ThreadStrategyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.h diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.cpp b/TAO/tao/PortableServer/Active_Policy_Strategies.cpp index cbb9434cf71..b457efcdc4f 100644 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.cpp +++ b/TAO/tao/PortableServer/Active_Policy_Strategies.cpp @@ -2,31 +2,22 @@ #include "tao/PortableServer/Active_Policy_Strategies.h" #include "tao/PortableServer/POA_Cached_Policies.h" -#include "tao/PortableServer/ThreadStrategy.h" -#include "tao/PortableServer/ThreadStrategyFactory.h" -#include "tao/PortableServer/RequestProcessingStrategy.h" -#include "tao/PortableServer/RequestProcessingStrategyFactory.h" -#include "tao/PortableServer/IdAssignmentStrategy.h" -#include "tao/PortableServer/IdAssignmentStrategyFactory.h" -#include "tao/PortableServer/LifespanStrategy.h" -#include "tao/PortableServer/LifespanStrategyFactory.h" -#include "tao/PortableServer/IdUniquenessStrategy.h" -#include "tao/PortableServer/IdUniquenessStrategyFactory.h" -#include "tao/PortableServer/ImplicitActivationStrategy.h" -#include "tao/PortableServer/ImplicitActivationStrategyFactory.h" -#include "tao/PortableServer/ServantRetentionStrategy.h" -#include "tao/PortableServer/ServantRetentionStrategyFactory.h" - -#include "tao/PortableServer/IdAssignmentPolicyC.h" -#include "tao/PortableServer/IdUniquenessPolicyC.h" -#include "tao/PortableServer/ImplicitActivationPolicyC.h" -#include "tao/PortableServer/LifespanPolicyC.h" -#include "tao/PortableServer/RequestProcessingPolicyC.h" -#include "tao/PortableServer/ServantRetentionPolicyC.h" -#include "tao/PortableServer/ThreadPolicyC.h" -#include "tao/PortableServer/ServantRetentionPolicyC.h" - -#include "ace/Dynamic_Service.h" +#include "tao/PortableServer/ThreadStrategySingle.h" +#include "tao/PortableServer/ThreadStrategyORBControl.h" +#include "tao/PortableServer/IdAssignmentStrategySystem.h" +#include "tao/PortableServer/IdAssignmentStrategyUser.h" +#include "tao/PortableServer/IdUniquenessStrategyMultiple.h" +#include "tao/PortableServer/IdUniquenessStrategyUnique.h" +#include "tao/PortableServer/ImplicitActivationStrategyExplicit.h" +#include "tao/PortableServer/ImplicitActivationStrategyImplicit.h" +#include "tao/PortableServer/LifespanStrategyPersistent.h" +#include "tao/PortableServer/LifespanStrategyTransient.h" +#include "tao/PortableServer/RequestProcessingStrategyAOMOnly.h" +#include "tao/PortableServer/RequestProcessingStrategyDefaultServant.h" +#include "tao/PortableServer/RequestProcessingStrategyServantLocator.h" +#include "tao/PortableServer/RequestProcessingStrategyServantActivator.h" +#include "tao/PortableServer/ServantRetentionStrategyNonRetain.h" +#include "tao/PortableServer/ServantRetentionStrategyRetain.h" #if !defined (__ACE_INLINE__) # include "tao/PortableServer/Active_Policy_Strategies.inl" @@ -38,91 +29,19 @@ namespace TAO { namespace Portable_Server { - Active_Policy_Strategies::Active_Policy_Strategies () - : thread_strategy_ (0), - request_processing_strategy_ (0), - id_assignment_strategy_ (0), - lifespan_strategy_ (0), - id_uniqueness_strategy_ (0), - implicit_activation_strategy_ (0), - servant_retention_strategy_ (0), - thread_strategy_factory_ (0), - servant_retention_strategy_factory_ (0), - request_processing_strategy_factory_ (0), - lifespan_strategy_factory_ (0), - implicit_activation_strategy_factory_ (0), - id_uniqueness_strategy_factory_ (0), - id_assignment_strategy_factory_ (0) - { - } - void Active_Policy_Strategies::update (Cached_Policies &policies, ::TAO_Root_POA *poa) { - this->thread_strategy_factory_ = - ACE_Dynamic_Service::instance ("ThreadStrategyFactory"); - - if (this->thread_strategy_factory_ != 0) - this->thread_strategy_ = - this->thread_strategy_factory_->create (policies.thread()); + this->create (policies.thread()); + this->create (policies.id_assignment()); + this->create (policies.id_uniqueness()); + this->create (policies.servant_retention()); + this->create (policies.lifespan()); + this->create (policies.implicit_activation()); + this->create (policies.request_processing(), policies.servant_retention()); /**/ - - this->id_assignment_strategy_factory_ = - ACE_Dynamic_Service::instance ("IdAssignmentStrategyFactory"); - - if (this->id_assignment_strategy_factory_ != 0) - this->id_assignment_strategy_ = - this->id_assignment_strategy_factory_->create (policies.id_assignment()); - - /**/ - - this->id_uniqueness_strategy_factory_ = - ACE_Dynamic_Service::instance ("IdUniquenessStrategyFactory"); - - if (this->id_uniqueness_strategy_factory_ != 0) - this->id_uniqueness_strategy_ = - this->id_uniqueness_strategy_factory_->create (policies.id_uniqueness()); - - /**/ - - this->servant_retention_strategy_factory_ = - ACE_Dynamic_Service::instance ("ServantRetentionStrategyFactory"); - - if (this->servant_retention_strategy_factory_ != 0) - this->servant_retention_strategy_ = - this->servant_retention_strategy_factory_->create (policies.servant_retention()); - - /**/ - - this->request_processing_strategy_factory_ = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyFactory"); - - if (this->request_processing_strategy_factory_ != 0) - this->request_processing_strategy_ = - this->request_processing_strategy_factory_->create (policies.request_processing(), policies.servant_retention()); - - /**/ - - this->lifespan_strategy_factory_ = - ACE_Dynamic_Service::instance ("LifespanStrategyFactory"); - - if (this->lifespan_strategy_factory_ != 0) - this->lifespan_strategy_ = - this->lifespan_strategy_factory_->create (policies.lifespan()); - - /**/ - - this->implicit_activation_strategy_factory_ = - ACE_Dynamic_Service::instance ("ImplicitActivationStrategyFactory"); - - if (this->implicit_activation_strategy_factory_ != 0) - this->implicit_activation_strategy_ = - this->implicit_activation_strategy_factory_->create (policies.implicit_activation()); - - /**/ - if (this->lifespan_strategy_ != 0) { this->lifespan_strategy_->strategy_init (poa); @@ -130,7 +49,7 @@ namespace TAO if (this->request_processing_strategy_ != 0) { - this->request_processing_strategy_->strategy_init (poa, policies.servant_retention()); + this->request_processing_strategy_->strategy_init (poa); } if (this->id_uniqueness_strategy_ != 0) @@ -138,78 +57,189 @@ namespace TAO this->id_uniqueness_strategy_->strategy_init (poa); } - if (this->implicit_activation_strategy_ != 0) + if (this->servant_retention_strategy_ != 0) { - this->implicit_activation_strategy_->strategy_init (poa); + this->servant_retention_strategy_->strategy_init (poa); } + } + + void + Active_Policy_Strategies::cleanup () + { + this->lifespan_strategy_->strategy_cleanup (); + this->lifespan_strategy_.reset (nullptr); + this->request_processing_strategy_->strategy_cleanup (); + this->request_processing_strategy_.reset (nullptr); + this->id_uniqueness_strategy_->strategy_cleanup (); + this->id_uniqueness_strategy_.reset (nullptr); + this->implicit_activation_strategy_.reset (nullptr); + this->thread_strategy_.reset (nullptr); + this->servant_retention_strategy_->strategy_cleanup (); + this->servant_retention_strategy_.reset (nullptr); + this->id_assignment_strategy_.reset (nullptr); + } - if (this->thread_strategy_ != 0) + void + Active_Policy_Strategies::create (::PortableServer::ThreadPolicyValue value) + { + switch (value) + { + case ::PortableServer::SINGLE_THREAD_MODEL : { - this->thread_strategy_->strategy_init (poa); +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) + this->thread_strategy_.reset (new ThreadStrategySingle ()); +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + break; } - - if (this->servant_retention_strategy_ != 0) + case ::PortableServer::ORB_CTRL_MODEL : { - this->servant_retention_strategy_->strategy_init (poa); + this->thread_strategy_.reset (new ThreadStrategyORBControl ()); + break; } + } + } - if (this->id_assignment_strategy_ != 0) + void + Active_Policy_Strategies::create (::PortableServer::IdAssignmentPolicyValue value) + { + switch (value) + { + case ::PortableServer::SYSTEM_ID : + { + this->id_assignment_strategy_.reset (new IdAssignmentStrategySystem ()); + break; + } + case ::PortableServer::USER_ID : { - this->id_assignment_strategy_->strategy_init (poa); +#if !defined (CORBA_E_MICRO) + this->id_assignment_strategy_.reset (new IdAssignmentStrategyUser ()); +#endif /* CORBA_E_MICRO */ + break; } + } } void - Active_Policy_Strategies::cleanup () + Active_Policy_Strategies::create (::PortableServer::IdUniquenessPolicyValue value) { - if (this->lifespan_strategy_ != 0) + switch (value) + { + case ::PortableServer::MULTIPLE_ID : { - this->lifespan_strategy_factory_->destroy (lifespan_strategy_); - - this->lifespan_strategy_ = 0; +#if !defined (CORBA_E_MICRO) + this->id_uniqueness_strategy_.reset (new IdUniquenessStrategyMultiple ()); +#endif /* CORBA_E_MICRO */ + break; } - - if (this->request_processing_strategy_ != 0) + case ::PortableServer::UNIQUE_ID : { - this->request_processing_strategy_factory_->destroy (request_processing_strategy_); - - this->request_processing_strategy_ = 0; + this->id_uniqueness_strategy_.reset (new IdUniquenessStrategyUnique ()); + break; } + } + } - if (this->id_uniqueness_strategy_ != 0) + void + Active_Policy_Strategies::create (::PortableServer::ServantRetentionPolicyValue value) + { + switch (value) + { + case ::PortableServer::RETAIN : { - this->id_uniqueness_strategy_factory_->destroy (id_uniqueness_strategy_); - - this->id_uniqueness_strategy_ = 0; + this->servant_retention_strategy_.reset (new ServantRetentionStrategyRetain ()); + break; } - - if (this->implicit_activation_strategy_ != 0) + case ::PortableServer::NON_RETAIN : { - this->implicit_activation_strategy_factory_->destroy (implicit_activation_strategy_); - - this->implicit_activation_strategy_ = 0; +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) + this->servant_retention_strategy_.reset (new ServantRetentionStrategyNonRetain ()); +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + break; } + } + } - if (this->thread_strategy_ != 0) + void + Active_Policy_Strategies::create (::PortableServer::LifespanPolicyValue value) + { + switch (value) + { + case ::PortableServer::PERSISTENT : { - this->thread_strategy_factory_->destroy (thread_strategy_); - - this->thread_strategy_ = 0; +#if !defined (CORBA_E_MICRO) + this->lifespan_strategy_.reset (new LifespanStrategyPersistent ()); +#endif /* CORBA_E_MICRO */ + break; } - - if (this->servant_retention_strategy_ != 0) + case ::PortableServer::TRANSIENT : { - this->servant_retention_strategy_factory_->destroy (servant_retention_strategy_); - - this->servant_retention_strategy_ = 0; + this->lifespan_strategy_.reset (new LifespanStrategyTransient ()); + break; } + } + } - if (this->id_assignment_strategy_ != 0) + void + Active_Policy_Strategies::create (::PortableServer::ImplicitActivationPolicyValue value) + { + switch (value) + { + case ::PortableServer::IMPLICIT_ACTIVATION : + { +#if !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) + this->implicit_activation_strategy_.reset (new ImplicitActivationStrategyImplicit ()); +#endif /* CORBA_E_MICRO */ + break; + } + case ::PortableServer::NO_IMPLICIT_ACTIVATION : { - this->id_assignment_strategy_factory_->destroy (id_assignment_strategy_); + this->implicit_activation_strategy_.reset (new ImplicitActivationStrategyExplicit ()); + break; + } + } + } - this->id_assignment_strategy_ = 0; + void + Active_Policy_Strategies::create ( + ::PortableServer::RequestProcessingPolicyValue value, + ::PortableServer::ServantRetentionPolicyValue srvalue) + { + switch (value) + { + case ::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY : + { + this->request_processing_strategy_.reset (new RequestProcessingStrategyAOMOnly ()); + break; + } + case ::PortableServer::USE_DEFAULT_SERVANT : + { +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) + this->request_processing_strategy_.reset (new RequestProcessingStrategyDefaultServant ()); +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + break; + } + case ::PortableServer::USE_SERVANT_MANAGER : + { + switch (srvalue) + { + case ::PortableServer::RETAIN : + { +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) + this->request_processing_strategy_.reset (new RequestProcessingStrategyServantActivator ()); +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + break; + } + case ::PortableServer::NON_RETAIN : + { +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) + this->request_processing_strategy_.reset (new RequestProcessingStrategyServantLocator ()); +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + break; + } + } + break; } + } } } } diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.h b/TAO/tao/PortableServer/Active_Policy_Strategies.h index b683ed244eb..f05fbba535c 100644 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.h +++ b/TAO/tao/PortableServer/Active_Policy_Strategies.h @@ -14,11 +14,20 @@ #include /**/ "ace/pre.h" #include "tao/orbconf.h" +#include #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/PortableServer/ThreadPolicyC.h" +#include "tao/PortableServer/IdAssignmentPolicyC.h" +#include "tao/PortableServer/IdUniquenessPolicyC.h" +#include "tao/PortableServer/ServantRetentionPolicyC.h" +#include "tao/PortableServer/LifespanPolicyC.h" +#include "tao/PortableServer/ImplicitActivationPolicyC.h" +#include "tao/PortableServer/RequestProcessingPolicyC.h" + TAO_BEGIN_VERSIONED_NAMESPACE_DECL class TAO_Root_POA; @@ -36,24 +45,15 @@ namespace TAO class ImplicitActivationStrategy; class ServantRetentionStrategy; - class ThreadStrategyFactory; - class ServantRetentionStrategyFactory; - class RequestProcessingStrategyFactory; - class LifespanStrategyFactory; - class ImplicitActivationStrategyFactory; - class IdUniquenessStrategyFactory; - class IdAssignmentStrategyFactory; - /** * This class stores the active policy strategies used for a certain POA. */ class Active_Policy_Strategies { public: - Active_Policy_Strategies (); + Active_Policy_Strategies () = default; - void update (Cached_Policies &policies, - TAO_Root_POA* poa); + void update (Cached_Policies &policies, TAO_Root_POA* poa); void cleanup (); @@ -72,21 +72,22 @@ namespace TAO ServantRetentionStrategy *servant_retention_strategy () const; private: - ThreadStrategy *thread_strategy_; - RequestProcessingStrategy *request_processing_strategy_; - IdAssignmentStrategy *id_assignment_strategy_; - LifespanStrategy *lifespan_strategy_; - IdUniquenessStrategy *id_uniqueness_strategy_; - ImplicitActivationStrategy *implicit_activation_strategy_; - ServantRetentionStrategy *servant_retention_strategy_; - - ThreadStrategyFactory *thread_strategy_factory_; - ServantRetentionStrategyFactory *servant_retention_strategy_factory_; - RequestProcessingStrategyFactory *request_processing_strategy_factory_; - LifespanStrategyFactory *lifespan_strategy_factory_; - ImplicitActivationStrategyFactory *implicit_activation_strategy_factory_; - IdUniquenessStrategyFactory *id_uniqueness_strategy_factory_; - IdAssignmentStrategyFactory *id_assignment_strategy_factory_; + void create (::PortableServer::ThreadPolicyValue value); + void create (::PortableServer::IdAssignmentPolicyValue value); + void create (::PortableServer::IdUniquenessPolicyValue value); + void create (::PortableServer::ServantRetentionPolicyValue value); + void create (::PortableServer::LifespanPolicyValue value); + void create (::PortableServer::ImplicitActivationPolicyValue value); + void create (::PortableServer::RequestProcessingPolicyValue value, ::PortableServer::ServantRetentionPolicyValue srvalue); + + private: + std::unique_ptr thread_strategy_ {}; + std::unique_ptr id_assignment_strategy_ {}; + std::unique_ptr id_uniqueness_strategy_ {}; + std::unique_ptr servant_retention_strategy_ {}; + std::unique_ptr lifespan_strategy_ {}; + std::unique_ptr implicit_activation_strategy_ {}; + std::unique_ptr request_processing_strategy_ {}; }; /** @@ -96,6 +97,7 @@ namespace TAO class Active_Policy_Strategies_Cleanup_Guard { public: + Active_Policy_Strategies_Cleanup_Guard () = delete; Active_Policy_Strategies_Cleanup_Guard (Active_Policy_Strategies *p); ~Active_Policy_Strategies_Cleanup_Guard (); diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.inl b/TAO/tao/PortableServer/Active_Policy_Strategies.inl index b28b53ea4a5..0f1e51fb0eb 100644 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.inl +++ b/TAO/tao/PortableServer/Active_Policy_Strategies.inl @@ -9,49 +9,49 @@ namespace TAO ThreadStrategy* Active_Policy_Strategies::thread_strategy () const { - return this->thread_strategy_; + return this->thread_strategy_.get (); } ACE_INLINE RequestProcessingStrategy* Active_Policy_Strategies::request_processing_strategy () const { - return this->request_processing_strategy_; + return this->request_processing_strategy_.get (); } ACE_INLINE IdAssignmentStrategy * Active_Policy_Strategies::id_assignment_strategy () const { - return this->id_assignment_strategy_; + return this->id_assignment_strategy_. get (); } ACE_INLINE IdUniquenessStrategy * Active_Policy_Strategies::id_uniqueness_strategy () const { - return this->id_uniqueness_strategy_; + return this->id_uniqueness_strategy_.get (); } ACE_INLINE LifespanStrategy* Active_Policy_Strategies::lifespan_strategy () const { - return this->lifespan_strategy_; + return this->lifespan_strategy_. get(); } ACE_INLINE ImplicitActivationStrategy* Active_Policy_Strategies::implicit_activation_strategy () const { - return this->implicit_activation_strategy_; + return this->implicit_activation_strategy_.get (); } ACE_INLINE ServantRetentionStrategy* Active_Policy_Strategies::servant_retention_strategy () const { - return this->servant_retention_strategy_; + return this->servant_retention_strategy_.get (); } ACE_INLINE @@ -76,7 +76,7 @@ namespace TAO Active_Policy_Strategies_Cleanup_Guard::_retn () { Active_Policy_Strategies *temp = this->ptr_; - this->ptr_ = 0; + this->ptr_ = nullptr; return temp; } } diff --git a/TAO/tao/PortableServer/Default_Servant_Dispatcher.h b/TAO/tao/PortableServer/Default_Servant_Dispatcher.h index a77043c28d2..d4d6a333a86 100644 --- a/TAO/tao/PortableServer/Default_Servant_Dispatcher.h +++ b/TAO/tao/PortableServer/Default_Servant_Dispatcher.h @@ -8,8 +8,8 @@ */ //============================================================================= -#ifndef TAO_DEFAULT_SERVANT_DISPATCHER_H -#define TAO_DEFAULT_SERVANT_DISPATCHER_H +#ifndef Default_Servant_DISPATCHER_H +#define Default_Servant_DISPATCHER_H #include /**/ "ace/pre.h" #include "tao/PortableServer/portableserver_export.h" @@ -68,4 +68,4 @@ public: TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" -#endif /* TAO_DEFAULT_SERVANT_DISPATCHER_H */ +#endif /* Default_Servant_DISPATCHER_H */ diff --git a/TAO/tao/PortableServer/IdAssignmentPolicy.h b/TAO/tao/PortableServer/IdAssignmentPolicy.h index 82686e026dc..bef8f68e0b5 100644 --- a/TAO/tao/PortableServer/IdAssignmentPolicy.h +++ b/TAO/tao/PortableServer/IdAssignmentPolicy.h @@ -52,10 +52,10 @@ namespace TAO CORBA::PolicyType policy_type (); /// Return the cached policy type for this policy. - virtual TAO_Cached_Policy_Type _tao_cached_type () const; + TAO_Cached_Policy_Type _tao_cached_type () const override; /// Returns the scope at which this policy can be applied. See orbconf.h. - virtual TAO_Policy_Scope _tao_scope () const; + TAO_Policy_Scope _tao_scope () const override; private: ::PortableServer::IdAssignmentPolicyValue value_; diff --git a/TAO/tao/PortableServer/IdAssignmentStrategy.cpp b/TAO/tao/PortableServer/IdAssignmentStrategy.cpp index 100a129d208..bd03e9693d6 100644 --- a/TAO/tao/PortableServer/IdAssignmentStrategy.cpp +++ b/TAO/tao/PortableServer/IdAssignmentStrategy.cpp @@ -6,16 +6,6 @@ namespace TAO { namespace Portable_Server { - void - IdAssignmentStrategy::strategy_init (TAO_Root_POA * /*poa*/) - { - } - - void - IdAssignmentStrategy::strategy_cleanup() - { - } - char IdAssignmentStrategy::key_type_length () const { diff --git a/TAO/tao/PortableServer/IdAssignmentStrategy.h b/TAO/tao/PortableServer/IdAssignmentStrategy.h index dca18216db1..5f4e1ce6e5f 100644 --- a/TAO/tao/PortableServer/IdAssignmentStrategy.h +++ b/TAO/tao/PortableServer/IdAssignmentStrategy.h @@ -12,14 +12,12 @@ #define TAO_ID_ASSIGNMENT_STRATEGY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/Policy_Strategy.h" +#include "tao/Basic_Types.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/Basic_Types.h" - TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace TAO @@ -27,12 +25,10 @@ namespace TAO namespace Portable_Server { class IdAssignmentStrategy - : public Policy_Strategy { public: - virtual void strategy_init(TAO_Root_POA *poa); - - virtual void strategy_cleanup(); + IdAssignmentStrategy () = default; + virtual ~IdAssignmentStrategy () = default; /** * Returns the key type the says which specific policy we have diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyFactory.h b/TAO/tao/PortableServer/IdAssignmentStrategyFactory.h deleted file mode 100644 index ceab91a8dc7..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategyFactory.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdAssignmentStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IDASSIGNMENTSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_IDASSIGNMENTSTRATEGYFACTORY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/StrategyFactory.h" -#include "tao/PortableServer/IdAssignmentPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class IdAssignmentStrategy; - - class TAO_PortableServer_Export IdAssignmentStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual IdAssignmentStrategy* create (::PortableServer::IdAssignmentPolicyValue value) = 0; - - virtual void destroy (IdAssignmentStrategy *strategy) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IDASSIGNMENTSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.cpp deleted file mode 100644 index e2d04886b10..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "tao/PortableServer/IdAssignmentStrategyFactoryImpl.h" -#include "tao/PortableServer/IdAssignmentStrategy.h" -#include "ace/Dynamic_Service.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - IdAssignmentStrategy * - IdAssignmentStrategyFactoryImpl::create ( - ::PortableServer::IdAssignmentPolicyValue value) - { - IdAssignmentStrategy *strategy = 0; - const char *strategy_name = 0; - - switch (value) - { - case ::PortableServer::SYSTEM_ID : - { - strategy_name = "IdAssignmentStrategySystem"; - break; - } - case ::PortableServer::USER_ID : - { - strategy_name = "IdAssignmentStrategyUser"; - break; - } - } - - strategy = - ACE_Dynamic_Service ::instance (strategy_name); - - if (strategy == 0) - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR, Unable to get %C\n"), - strategy_name)); - - return strategy; - } - - void - IdAssignmentStrategyFactoryImpl::destroy (IdAssignmentStrategy *) - { - // Noop because both types are singletons - } - - } -} - -ACE_STATIC_SVC_DEFINE ( - IdAssignmentStrategyFactoryImpl, - ACE_TEXT ("IdAssignmentStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdAssignmentStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdAssignmentStrategyFactoryImpl, - TAO::Portable_Server::IdAssignmentStrategyFactoryImpl) -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.h b/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.h deleted file mode 100644 index d0f64224202..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdAssignmentStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IDASSIGNMENTSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_IDASSIGNMENTSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/IdAssignmentStrategyFactory.h" -#include "ace/Service_Config.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export IdAssignmentStrategyFactoryImpl - : public IdAssignmentStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual IdAssignmentStrategy* create (::PortableServer::IdAssignmentPolicyValue value); - - virtual void destroy (IdAssignmentStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdAssignmentStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdAssignmentStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_PORTABLESERVER_IDASSIGNMENTSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/IdAssignmentStrategySystem.cpp b/TAO/tao/PortableServer/IdAssignmentStrategySystem.cpp index 30d87e69e9f..49c84bd15b3 100644 --- a/TAO/tao/PortableServer/IdAssignmentStrategySystem.cpp +++ b/TAO/tao/PortableServer/IdAssignmentStrategySystem.cpp @@ -21,18 +21,5 @@ namespace TAO } } -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdAssignmentStrategySystem, - TAO::Portable_Server::IdAssignmentStrategySystem) - -ACE_STATIC_SVC_DEFINE ( - IdAssignmentStrategySystem, - ACE_TEXT ("IdAssignmentStrategySystem"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdAssignmentStrategySystem), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/IdAssignmentStrategySystem.h b/TAO/tao/PortableServer/IdAssignmentStrategySystem.h index 7ee2acb36f4..8b05e5b8eca 100644 --- a/TAO/tao/PortableServer/IdAssignmentStrategySystem.h +++ b/TAO/tao/PortableServer/IdAssignmentStrategySystem.h @@ -12,35 +12,28 @@ #define TAO_IDASSIGNMENTSTRATEGYSYSTEM_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/IdAssignmentStrategy.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/IdAssignmentStrategy.h" -#include "ace/Service_Config.h" - TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace TAO { namespace Portable_Server { - class IdAssignmentStrategySystem - : public IdAssignmentStrategy + class IdAssignmentStrategySystem : public IdAssignmentStrategy { public: - virtual char id_assignment_key_type () const; + char id_assignment_key_type () const override; - virtual bool has_system_id () const; + bool has_system_id () const override; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdAssignmentStrategySystem) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdAssignmentStrategySystem) - TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyUser.cpp b/TAO/tao/PortableServer/IdAssignmentStrategyUser.cpp index 622dbd3f4ef..1b6f8064d42 100644 --- a/TAO/tao/PortableServer/IdAssignmentStrategyUser.cpp +++ b/TAO/tao/PortableServer/IdAssignmentStrategyUser.cpp @@ -20,17 +20,4 @@ namespace TAO } } -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdAssignmentStrategyUser, - TAO::Portable_Server::IdAssignmentStrategyUser) - -ACE_STATIC_SVC_DEFINE ( - IdAssignmentStrategyUser, - ACE_TEXT ("IdAssignmentStrategyUser"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdAssignmentStrategyUser), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyUser.h b/TAO/tao/PortableServer/IdAssignmentStrategyUser.h index c64be097bce..49898a8b581 100644 --- a/TAO/tao/PortableServer/IdAssignmentStrategyUser.h +++ b/TAO/tao/PortableServer/IdAssignmentStrategyUser.h @@ -12,35 +12,28 @@ #define TAO_IDASSIGNMENTSTRATEGYUSER_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/IdAssignmentStrategy.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/IdAssignmentStrategy.h" -#include "ace/Service_Config.h" - TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace TAO { namespace Portable_Server { - class IdAssignmentStrategyUser - : public IdAssignmentStrategy + class IdAssignmentStrategyUser : public IdAssignmentStrategy { public: - virtual char id_assignment_key_type () const; + char id_assignment_key_type () const override; - virtual bool has_system_id () const; + bool has_system_id () const override; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdAssignmentStrategyUser) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdAssignmentStrategyUser) - TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" diff --git a/TAO/tao/PortableServer/IdUniquenessPolicy.cpp b/TAO/tao/PortableServer/IdUniquenessPolicy.cpp index ce0297809b5..97a312289aa 100644 --- a/TAO/tao/PortableServer/IdUniquenessPolicy.cpp +++ b/TAO/tao/PortableServer/IdUniquenessPolicy.cpp @@ -21,7 +21,7 @@ namespace TAO CORBA::Policy_ptr IdUniquenessPolicy::copy () { - IdUniquenessPolicy *copy = 0; + IdUniquenessPolicy *copy = nullptr; ACE_NEW_THROW_EX (copy, IdUniquenessPolicy (this->value_), CORBA::NO_MEMORY ()); diff --git a/TAO/tao/PortableServer/IdUniquenessPolicy.h b/TAO/tao/PortableServer/IdUniquenessPolicy.h index 3ecbf3b3492..3cf26325ac5 100644 --- a/TAO/tao/PortableServer/IdUniquenessPolicy.h +++ b/TAO/tao/PortableServer/IdUniquenessPolicy.h @@ -52,10 +52,10 @@ namespace TAO CORBA::PolicyType policy_type (); /// Return the cached policy type for this policy. - virtual TAO_Cached_Policy_Type _tao_cached_type () const; + TAO_Cached_Policy_Type _tao_cached_type () const override; /// Returns the scope at which this policy can be applied. See orbconf.h. - virtual TAO_Policy_Scope _tao_scope () const; + TAO_Policy_Scope _tao_scope () const override; private: ::PortableServer::IdUniquenessPolicyValue value_; diff --git a/TAO/tao/PortableServer/IdUniquenessStrategy.cpp b/TAO/tao/PortableServer/IdUniquenessStrategy.cpp new file mode 100644 index 00000000000..caa7602057b --- /dev/null +++ b/TAO/tao/PortableServer/IdUniquenessStrategy.cpp @@ -0,0 +1,23 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file IdUniquenessStrategy.cpp + */ +//============================================================================= + +#include "tao/PortableServer/IdUniquenessStrategy.h" + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace TAO +{ + namespace Portable_Server + { + IdUniquenessStrategy::IdUniquenessStrategy () + { + } + } /* namespace Portable_Server */ +} /* namespace TAO */ + +TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/IdUniquenessStrategy.h b/TAO/tao/PortableServer/IdUniquenessStrategy.h index b3372d94343..7098f64e59e 100644 --- a/TAO/tao/PortableServer/IdUniquenessStrategy.h +++ b/TAO/tao/PortableServer/IdUniquenessStrategy.h @@ -12,14 +12,12 @@ #define TAO_ID_UNIQUENESS_STRATEGY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/IdUniquenessPolicyC.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/Policy_Strategy.h" -#include "tao/PortableServer/IdUniquenessPolicyC.h" #include "tao/PortableServer/PS_ForwardC.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -28,22 +26,24 @@ namespace TAO { namespace Portable_Server { - class TAO_PortableServer_Export IdUniquenessStrategy - : public Policy_Strategy + class IdUniquenessStrategy { public: + IdUniquenessStrategy (); + virtual ~IdUniquenessStrategy () = default; + + virtual void strategy_init (TAO_Root_POA *poa); + + virtual void strategy_cleanup (); + /* * Validate if the servant may be activated * @retval true This servant may be activated * @retval false This servant may not be activated */ - virtual bool is_servant_activation_allowed ( - PortableServer::Servant s, - bool &w) = 0; + virtual bool is_servant_activation_allowed (PortableServer::Servant s, bool &w) = 0; virtual bool allow_multiple_activations () const = 0; - - virtual ::PortableServer::IdUniquenessPolicyValue type() const = 0; }; } } diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyFactory.h b/TAO/tao/PortableServer/IdUniquenessStrategyFactory.h deleted file mode 100644 index c01c47fee41..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyFactory.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdUniquenessStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYFACTORY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/StrategyFactory.h" -#include "tao/PortableServer/IdUniquenessPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class IdUniquenessStrategy; - - class TAO_PortableServer_Export IdUniquenessStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual IdUniquenessStrategy* create (::PortableServer::IdUniquenessPolicyValue value) = 0; - - /// Cleanup the given strategy instance - virtual void destroy (IdUniquenessStrategy *strategy) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.cpp deleted file mode 100644 index f215d512ae1..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "tao/PortableServer/IdUniquenessStrategyFactoryImpl.h" -#include "tao/PortableServer/IdUniquenessStrategy.h" -#include "ace/Dynamic_Service.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - IdUniquenessStrategy* - IdUniquenessStrategyFactoryImpl::create ( - ::PortableServer::IdUniquenessPolicyValue value) - { - IdUniquenessStrategy* strategy = 0; - switch (value) - { - case ::PortableServer::MULTIPLE_ID : - { - strategy = - ACE_Dynamic_Service::instance ("IdUniquenessStrategyMultiple"); - - if (strategy == 0) - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) %p\n"), - ACE_TEXT ("ERROR, Unable to get ") - ACE_TEXT ("IdUniquenessStrategyMultiple"))); - - break; - } - case ::PortableServer::UNIQUE_ID : - { - IdUniquenessStrategyFactory *strategy_factory = - ACE_Dynamic_Service::instance ("IdUniquenessStrategyUniqueFactory"); - - if (strategy_factory != 0) - strategy = strategy_factory->create (value); - else - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) %p\n"), - ACE_TEXT ("ERROR, Unable to get ") - ACE_TEXT ("IdUniquenessStrategyUniqueFactory"))); - - break; - } - } - - return strategy; - } - - void - IdUniquenessStrategyFactoryImpl::destroy ( - IdUniquenessStrategy *strategy) - { - switch (strategy->type ()) - { - case ::PortableServer::MULTIPLE_ID : - { - // Noop - break; - } - case ::PortableServer::UNIQUE_ID : - { - IdUniquenessStrategyFactory *strategy_factory = - ACE_Dynamic_Service::instance ("IdUniquenessStrategyUniqueFactory"); - - if (strategy_factory != 0) - { - strategy_factory->destroy (strategy); - } - break; - } - } - } - - } -} - -ACE_STATIC_SVC_DEFINE ( - IdUniquenessStrategyFactoryImpl, - ACE_TEXT ("IdUniquenessStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdUniquenessStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdUniquenessStrategyFactoryImpl, - TAO::Portable_Server::IdUniquenessStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.h b/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.h deleted file mode 100644 index 8c869ab0ab9..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdUniquenessStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/IdUniquenessStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export IdUniquenessStrategyFactoryImpl - : public IdUniquenessStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual IdUniquenessStrategy* create (::PortableServer::IdUniquenessPolicyValue value); - - virtual void destroy (IdUniquenessStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE (IdUniquenessStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdUniquenessStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.cpp b/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.cpp index 170d4a18643..cfcdd9fb672 100644 --- a/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.cpp +++ b/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.cpp @@ -32,27 +32,7 @@ namespace TAO { return true; } - - ::PortableServer::IdUniquenessPolicyValue - IdUniquenessStrategyMultiple::type () const - { - return ::PortableServer::MULTIPLE_ID; - } - } } -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdUniquenessStrategyMultiple, - TAO::Portable_Server::IdUniquenessStrategyMultiple) - -ACE_STATIC_SVC_DEFINE ( - IdUniquenessStrategyMultiple, - ACE_TEXT ("IdUniquenessStrategyMultiple"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdUniquenessStrategyMultiple), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) TAO_END_VERSIONED_NAMESPACE_DECL - diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.h b/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.h index 15e212c64ab..15831b56c31 100644 --- a/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.h +++ b/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.h @@ -12,43 +12,32 @@ #define TAO_ID_UNIQUENESSSTRATEGY_MULITPLE_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/IdUniquenessStrategy.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/IdUniquenessStrategy.h" -#include "ace/Service_Config.h" - TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace TAO { namespace Portable_Server { - class TAO_PortableServer_Export IdUniquenessStrategyMultiple - : public IdUniquenessStrategy + class IdUniquenessStrategyMultiple : public IdUniquenessStrategy { public: - virtual void strategy_init (TAO_Root_POA *poa); + void strategy_init (TAO_Root_POA *poa) override; - virtual void strategy_cleanup (); + void strategy_cleanup () override; - virtual bool is_servant_activation_allowed ( - PortableServer::Servant servant, - bool &w); + bool is_servant_activation_allowed (PortableServer::Servant servant, bool &w) override; - virtual bool allow_multiple_activations () const; - - virtual ::PortableServer::IdUniquenessPolicyValue type() const; + bool allow_multiple_activations () const override; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdUniquenessStrategyMultiple) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdUniquenessStrategyMultiple) - TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyUnique.cpp b/TAO/tao/PortableServer/IdUniquenessStrategyUnique.cpp index c805fabf79d..eb890598218 100644 --- a/TAO/tao/PortableServer/IdUniquenessStrategyUnique.cpp +++ b/TAO/tao/PortableServer/IdUniquenessStrategyUnique.cpp @@ -7,11 +7,6 @@ namespace TAO { namespace Portable_Server { - IdUniquenessStrategyUnique::IdUniquenessStrategyUnique () : - poa_ (0) - { - } - void IdUniquenessStrategyUnique::strategy_init ( TAO_Root_POA *poa) @@ -22,7 +17,7 @@ namespace TAO void IdUniquenessStrategyUnique::strategy_cleanup () { - poa_ = 0; + poa_ = nullptr; } bool @@ -44,28 +39,8 @@ namespace TAO { return false; } - - ::PortableServer::IdUniquenessPolicyValue - IdUniquenessStrategyUnique::type() const - { - return ::PortableServer::UNIQUE_ID; - } - } } -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdUniquenessStrategyUnique, - TAO::Portable_Server::IdUniquenessStrategyUnique) - -ACE_STATIC_SVC_DEFINE ( - IdUniquenessStrategyUnique, - ACE_TEXT ("IdUniquenessStrategyUnique"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdUniquenessStrategyUnique), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyUnique.h b/TAO/tao/PortableServer/IdUniquenessStrategyUnique.h index 26450fc1f6f..37223597713 100644 --- a/TAO/tao/PortableServer/IdUniquenessStrategyUnique.h +++ b/TAO/tao/PortableServer/IdUniquenessStrategyUnique.h @@ -12,48 +12,37 @@ #define TAO_ID_UNIQUENESSSTRATEGYUNIQUE_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/IdUniquenessStrategy.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/IdUniquenessStrategy.h" -#include "ace/Service_Config.h" - TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace TAO { namespace Portable_Server { - class TAO_PortableServer_Export IdUniquenessStrategyUnique - : public IdUniquenessStrategy + class IdUniquenessStrategyUnique : public IdUniquenessStrategy { public: - IdUniquenessStrategyUnique (); + IdUniquenessStrategyUnique () = default; - virtual void strategy_init (TAO_Root_POA *poa); + void strategy_init (TAO_Root_POA *poa) override; - virtual void strategy_cleanup (); + void strategy_cleanup () override; - virtual bool is_servant_activation_allowed ( - PortableServer::Servant servant, - bool &wait_occurred_restart_call); + bool is_servant_activation_allowed (PortableServer::Servant servant, bool &wait_occurred_restart_call) override; - virtual bool allow_multiple_activations () const; - - virtual ::PortableServer::IdUniquenessPolicyValue type() const; + bool allow_multiple_activations () const override; private: - TAO_Root_POA* poa_; + TAO_Root_POA* poa_ {}; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdUniquenessStrategyUnique) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdUniquenessStrategyUnique) - TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp b/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp deleted file mode 100644 index 71383493628..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h" -#include "tao/PortableServer/IdUniquenessStrategyUnique.h" -#include "ace/Dynamic_Service.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - IdUniquenessStrategy* - IdUniquenessStrategyUniqueFactoryImpl::create ( - ::PortableServer::IdUniquenessPolicyValue value) - { - IdUniquenessStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::UNIQUE_ID : - { - ACE_NEW_RETURN (strategy, IdUniquenessStrategyUnique, 0); - break; - } - case ::PortableServer::MULTIPLE_ID : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in IdUniquenessStrategyUniqueFactoryImpl")); - break; - } - } - - return strategy; - } - - void - IdUniquenessStrategyUniqueFactoryImpl::destroy ( - IdUniquenessStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - - } -} - -ACE_STATIC_SVC_DEFINE ( - IdUniquenessStrategyUniqueFactoryImpl, - ACE_TEXT ("IdUniquenessStrategyUniqueFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdUniquenessStrategyUniqueFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdUniquenessStrategyUniqueFactoryImpl, - TAO::Portable_Server::IdUniquenessStrategyUniqueFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h b/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h deleted file mode 100644 index f5dfc25b016..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdUniquenessStrategyUniqueFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYUNIQUEFACTORYIMPL_H -#define TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYUNIQUEFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/IdUniquenessStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export IdUniquenessStrategyUniqueFactoryImpl - : public IdUniquenessStrategyFactory - { - public: - /// Create a new strategy - virtual IdUniquenessStrategy* create (::PortableServer::IdUniquenessPolicyValue value); - - virtual void destroy (IdUniquenessStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdUniquenessStrategyUniqueFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdUniquenessStrategyUniqueFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYUNIQUEFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategy.cpp b/TAO/tao/PortableServer/ImplicitActivationStrategy.cpp deleted file mode 100644 index 3bc68da0d7e..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategy.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -*- C++ -*- -#include "tao/PortableServer/ImplicitActivationStrategy.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - void - ImplicitActivationStrategy::strategy_init (TAO_Root_POA * /*poa*/) - { - // dependent on type create the correct strategy. - } - - void - ImplicitActivationStrategy::strategy_cleanup () - { - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategy.h b/TAO/tao/PortableServer/ImplicitActivationStrategy.h index 491df8cf702..f1491cf6664 100644 --- a/TAO/tao/PortableServer/ImplicitActivationStrategy.h +++ b/TAO/tao/PortableServer/ImplicitActivationStrategy.h @@ -12,7 +12,7 @@ #define TAO_ACTIVATION_STRATEGY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/Policy_Strategy.h" +#include "tao/orbconf.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -25,12 +25,10 @@ namespace TAO namespace Portable_Server { class ImplicitActivationStrategy - : public Policy_Strategy { public: - virtual void strategy_init(TAO_Root_POA *poa); - - virtual void strategy_cleanup(); + ImplicitActivationStrategy () = default; + virtual ~ImplicitActivationStrategy () = default; virtual bool allow_implicit_activation () const = 0; }; diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.cpp b/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.cpp index 98c308606d8..97762e51cb7 100644 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.cpp +++ b/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.cpp @@ -15,17 +15,4 @@ namespace TAO } } -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ImplicitActivationStrategyExplicit, - TAO::Portable_Server::ImplicitActivationStrategyExplicit) - -ACE_STATIC_SVC_DEFINE ( - ImplicitActivationStrategyExplicit, - ACE_TEXT ("ImplicitActivationStrategyExplicit"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ImplicitActivationStrategyExplicit), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.h b/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.h index 05846df574a..03a2663f6b3 100644 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.h +++ b/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.h @@ -12,35 +12,27 @@ #define TAO_IMPLICITACTIVATIONSTRATEGYEXPLICIT_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/ImplicitActivationStrategy.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/ImplicitActivationStrategy.h" -#include "ace/Service_Config.h" - TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace TAO { namespace Portable_Server { - class ImplicitActivationStrategyExplicit : - public ImplicitActivationStrategy + class ImplicitActivationStrategyExplicit : public ImplicitActivationStrategy { public: - virtual bool allow_implicit_activation () const; + bool allow_implicit_activation () const override; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ImplicitActivationStrategyExplicit) -ACE_FACTORY_DECLARE (TAO_PortableServer, ImplicitActivationStrategyExplicit) - TAO_END_VERSIONED_NAMESPACE_DECL - #include /**/ "ace/post.h" #endif /* TAO_IMPLICITACTIVATIONSTRATEGYEXPLICIT_H */ diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyFactory.h b/TAO/tao/PortableServer/ImplicitActivationStrategyFactory.h deleted file mode 100644 index f2d8514ef57..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyFactory.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ImplicitActivationStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IMPLICITACTIVATIONSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_IMPLICITACTIVATIONSTRATEGYFACTORY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/StrategyFactory.h" -#include "tao/PortableServer/ImplicitActivationPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ImplicitActivationStrategy; - - class TAO_PortableServer_Export ImplicitActivationStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ImplicitActivationStrategy* create (::PortableServer::ImplicitActivationPolicyValue value) = 0; - - virtual void destroy (ImplicitActivationStrategy *strategy) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IMPLICITACTIVATIONSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.cpp deleted file mode 100644 index d9035f5bcae..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// -*- C++ -*- -#include "tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h" -#include "ace/Dynamic_Service.h" -#include "tao/PortableServer/ImplicitActivationStrategyImplicit.h" -#include "tao/PortableServer/ImplicitActivationStrategyExplicit.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ImplicitActivationStrategy* - ImplicitActivationStrategyFactoryImpl::create ( - ::PortableServer::ImplicitActivationPolicyValue value) - { - ImplicitActivationStrategy* strategy = 0; - const char * strategy_name = 0; - - switch (value) - { - case ::PortableServer::IMPLICIT_ACTIVATION : - { - strategy_name = "ImplicitActivationStrategyImplicit"; - break; - } - case ::PortableServer::NO_IMPLICIT_ACTIVATION : - { - strategy_name = "ImplicitActivationStrategyExplicit"; - break; - } - } - - strategy = - ACE_Dynamic_Service::instance (strategy_name); - - if (strategy == 0) - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR, Unable to get %C\n"), - strategy_name)); - - return strategy; - } - - void - ImplicitActivationStrategyFactoryImpl::destroy ( - ImplicitActivationStrategy * /*strategy*/) - { - // Noop because both types are singletons - } - } -} - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ImplicitActivationStrategyFactoryImpl, - TAO_VERSIONED_NAMESPACE_NAME::TAO::Portable_Server::ImplicitActivationStrategyFactoryImpl) - -ACE_STATIC_SVC_DEFINE ( - ImplicitActivationStrategyFactoryImpl, - ACE_TEXT ("ImplicitActivationStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ImplicitActivationStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h b/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h deleted file mode 100644 index 3ee40e3d8ba..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ImplicitActivationStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IMPLICITACTIVATIONSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_IMPLICITACTIVATIONSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/ImplicitActivationStrategyFactory.h" - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ImplicitActivationStrategyFactoryImpl - : public ImplicitActivationStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ImplicitActivationStrategy* create (::PortableServer::ImplicitActivationPolicyValue value); - - virtual void destroy (ImplicitActivationStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ImplicitActivationStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ImplicitActivationStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IMPLICITACTIVATIONSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.cpp b/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.cpp index 989dd133b88..5ff61d8362b 100644 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.cpp +++ b/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.cpp @@ -16,19 +16,6 @@ namespace TAO } } -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ImplicitActivationStrategyImplicit, - TAO::Portable_Server::ImplicitActivationStrategyImplicit) - -ACE_STATIC_SVC_DEFINE ( - ImplicitActivationStrategyImplicit, - ACE_TEXT ("ImplicitActivationStrategyImplicit"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ImplicitActivationStrategyImplicit), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - TAO_END_VERSIONED_NAMESPACE_DECL #endif diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.h b/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.h index 68d0a997130..daa7ba096a9 100644 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.h +++ b/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.h @@ -12,15 +12,12 @@ #define TAO_IMPLICITACTIVATIONSTRATEGYIMPLICIT_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/ImplicitActivationStrategy.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/ImplicitActivationStrategy.h" -#include "ace/Service_Config.h" - #if !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -29,18 +26,14 @@ namespace TAO { namespace Portable_Server { - class TAO_PortableServer_Export ImplicitActivationStrategyImplicit - : public ImplicitActivationStrategy + class ImplicitActivationStrategyImplicit : public ImplicitActivationStrategy { public: - virtual bool allow_implicit_activation () const; + bool allow_implicit_activation () const override; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ImplicitActivationStrategyImplicit) -ACE_FACTORY_DECLARE (TAO_PortableServer, ImplicitActivationStrategyImplicit) - TAO_END_VERSIONED_NAMESPACE_DECL #endif diff --git a/TAO/tao/PortableServer/LifespanStrategy.cpp b/TAO/tao/PortableServer/LifespanStrategy.cpp index e331e653adb..6ea71982149 100644 --- a/TAO/tao/PortableServer/LifespanStrategy.cpp +++ b/TAO/tao/PortableServer/LifespanStrategy.cpp @@ -14,11 +14,6 @@ namespace TAO { namespace Portable_Server { - LifespanStrategy::LifespanStrategy () : - poa_ (0) - { - } - void LifespanStrategy::strategy_init (TAO_Root_POA *poa) { @@ -28,7 +23,7 @@ namespace TAO void LifespanStrategy::strategy_cleanup () { - poa_ = 0; + poa_ = nullptr; } CORBA::ULong diff --git a/TAO/tao/PortableServer/LifespanStrategy.h b/TAO/tao/PortableServer/LifespanStrategy.h index 01a9a150dbd..ac034037f9f 100644 --- a/TAO/tao/PortableServer/LifespanStrategy.h +++ b/TAO/tao/PortableServer/LifespanStrategy.h @@ -12,17 +12,18 @@ #define TAO_PORTABLESERVER_LIFESPANPOLICY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/Policy_Strategy.h" +#include "tao/PortableServer/LifespanPolicyC.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/LifespanPolicyC.h" #include "tao/Object_KeyC.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL +class TAO_Root_POA; + namespace TAO { namespace Portable_Server @@ -30,10 +31,10 @@ namespace TAO class Temporary_Creation_Time; class LifespanStrategy - : public Policy_Strategy { public: - LifespanStrategy (); + LifespanStrategy () = default; + virtual ~LifespanStrategy () = default; virtual void strategy_init (TAO_Root_POA *poa); @@ -70,8 +71,6 @@ namespace TAO /// Check the state of the POA. virtual void check_state () = 0; - virtual ::PortableServer::LifespanPolicyValue type () const = 0; - virtual bool use_imr () const = 0; virtual CORBA::Object_ptr imr_key_to_object ( @@ -79,7 +78,7 @@ namespace TAO const char *type_id) const = 0; protected: - TAO_Root_POA *poa_; + TAO_Root_POA *poa_ {}; }; } /* namespace Portable_Server */ } /* namespace TAO */ diff --git a/TAO/tao/PortableServer/LifespanStrategyFactory.h b/TAO/tao/PortableServer/LifespanStrategyFactory.h deleted file mode 100644 index e60df4872d1..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyFactory.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_LIFEPSPANSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_LIFEPSPANSTRATEGYFACTORY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/StrategyFactory.h" -#include "tao/PortableServer/LifespanPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class LifespanStrategy; - - class TAO_PortableServer_Export LifespanStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual LifespanStrategy* create (::PortableServer::LifespanPolicyValue value) = 0; - - /// Cleanup the given strategy instance - virtual void destroy (LifespanStrategy *strategy) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_LIFEPSPANSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.cpp deleted file mode 100644 index f66cdebd8b3..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#include "tao/PortableServer/LifespanStrategyFactoryImpl.h" -#include "tao/PortableServer/LifespanStrategy.h" -#include "ace/Dynamic_Service.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - LifespanStrategy* - LifespanStrategyFactoryImpl::create ( - ::PortableServer::LifespanPolicyValue value) - { - LifespanStrategy *strategy = 0; - const char *strategy_name = 0; - - switch (value) - { - case ::PortableServer::PERSISTENT : - { - strategy_name = "LifespanStrategyPersistentFactory"; - break; - } - case ::PortableServer::TRANSIENT : - { - strategy_name = "LifespanStrategyTransientFactory"; - break; - } - } - - LifespanStrategyFactory *strategy_factory = - ACE_Dynamic_Service::instance (strategy_name); - - if (strategy_factory != 0) - strategy = strategy_factory->create (value); - else - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR, Unable to get %C\n"), - strategy_name)); - - - return strategy; - } - - void - LifespanStrategyFactoryImpl::destroy (LifespanStrategy *strategy) - { - switch (strategy->type ()) - { - case ::PortableServer::PERSISTENT : - { - LifespanStrategyFactory *strategy_factory = - ACE_Dynamic_Service::instance ("LifespanStrategyPersistentFactory"); - - if (strategy_factory != 0) - { - strategy_factory->destroy (strategy); - } - break; - } - case ::PortableServer::TRANSIENT : - { - LifespanStrategyFactory *strategy_factory = - ACE_Dynamic_Service::instance ("LifespanStrategyTransientFactory"); - - if (strategy_factory != 0) - { - strategy_factory->destroy (strategy); - } - break; - } - } - } - } -} - -ACE_STATIC_SVC_DEFINE ( - LifespanStrategyFactoryImpl, - ACE_TEXT ("LifespanStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (LifespanStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - LifespanStrategyFactoryImpl, - TAO::Portable_Server::LifespanStrategyFactoryImpl) -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.h b/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.h deleted file mode 100644 index b076007cd7a..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.h +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_LIFEPSPANSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_LIFEPSPANSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/LifespanStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export LifespanStrategyFactoryImpl - : public LifespanStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual LifespanStrategy* create (::PortableServer::LifespanPolicyValue value); - - /// Cleanup the given strategy instance - virtual void destroy (LifespanStrategy *strategy); - }; - } -} -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, LifespanStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, LifespanStrategyFactoryImpl) - - -TAO_END_VERSIONED_NAMESPACE_DECL - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_LIFEPSPANSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp b/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp index 62f681a6f18..32bb04a343c 100644 --- a/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp +++ b/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp @@ -127,12 +127,6 @@ namespace TAO this->poa_->tao_poa_manager().check_state (); } - ::PortableServer::LifespanPolicyValue - LifespanStrategyPersistent::type() const - { - return ::PortableServer::PERSISTENT; - } - bool LifespanStrategyPersistent::use_imr () const { diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistent.h b/TAO/tao/PortableServer/LifespanStrategyPersistent.h index 03d2075f81d..9b964c2b184 100644 --- a/TAO/tao/PortableServer/LifespanStrategyPersistent.h +++ b/TAO/tao/PortableServer/LifespanStrategyPersistent.h @@ -34,33 +34,30 @@ namespace TAO public: LifespanStrategyPersistent (); - virtual void strategy_init(TAO_Root_POA *poa); + void strategy_init(TAO_Root_POA *poa) override; - virtual void notify_startup (); + void notify_startup () override; - virtual void notify_shutdown (); + void notify_shutdown () override; char key_type () const; - virtual CORBA::Boolean is_persistent () const; + CORBA::Boolean is_persistent () const override; CORBA::ULong key_length () const; - virtual void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at); + void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at) override; - virtual bool + bool validate (CORBA::Boolean is_persistent, - const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const; + const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const override; /// Check the state of the POA. - virtual void check_state (); + void check_state () override; - virtual ::PortableServer::LifespanPolicyValue type() const; + bool use_imr () const override; - virtual bool use_imr () const; - - virtual CORBA::Object_ptr imr_key_to_object(const TAO::ObjectKey &key, - const char *type_id) const; + CORBA::Object_ptr imr_key_to_object(const TAO::ObjectKey &key, const char *type_id) const override; private: bool use_imr_; diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.cpp b/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.cpp deleted file mode 100644 index cd56cf99c58..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// -*- C++ -*- -#include "tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h" -#include "ace/Dynamic_Service.h" -#include "tao/PortableServer/LifespanStrategyPersistent.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - LifespanStrategy* - LifespanStrategyPersistentFactoryImpl::create ( - ::PortableServer::LifespanPolicyValue value) - { - LifespanStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::PERSISTENT : - { - ACE_NEW_RETURN (strategy, LifespanStrategyPersistent, 0); - break; - } - case ::PortableServer::TRANSIENT : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in LifespanStrategyPersistentFactoryImpl")); - break; - } - } - - return strategy; - } - - void - LifespanStrategyPersistentFactoryImpl::destroy (LifespanStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -ACE_STATIC_SVC_DEFINE ( - LifespanStrategyPersistentFactoryImpl, - ACE_TEXT ("LifespanStrategyPersistentFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (LifespanStrategyPersistentFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - LifespanStrategyPersistentFactoryImpl, - TAO::Portable_Server::LifespanStrategyPersistentFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h b/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h deleted file mode 100644 index 77fbcaa3466..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyPersistentFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_LIFEPSPANSTRATEGYPERSISTENTFACTORYIMPL_H -#define TAO_PORTABLESERVER_LIFEPSPANSTRATEGYPERSISTENTFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/LifespanStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export LifespanStrategyPersistentFactoryImpl - : public LifespanStrategyFactory - { - public: - /// Create a new strategy - virtual LifespanStrategy* create (::PortableServer::LifespanPolicyValue value); - - /// Cleanup the given strategy instance - virtual void destroy (LifespanStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, LifespanStrategyPersistentFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, LifespanStrategyPersistentFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_LIFEPSPANSTRATEGYPERSISTENTFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/LifespanStrategyTransient.cpp b/TAO/tao/PortableServer/LifespanStrategyTransient.cpp index 268ea7b3546..eb6ed65faeb 100644 --- a/TAO/tao/PortableServer/LifespanStrategyTransient.cpp +++ b/TAO/tao/PortableServer/LifespanStrategyTransient.cpp @@ -108,12 +108,6 @@ namespace TAO { return CORBA::Object::_nil(); } - - ::PortableServer::LifespanPolicyValue - LifespanStrategyTransient::type () const - { - return ::PortableServer::TRANSIENT; - } } /* namespace Portable_Server */ } /* namespace TAO */ diff --git a/TAO/tao/PortableServer/LifespanStrategyTransient.h b/TAO/tao/PortableServer/LifespanStrategyTransient.h index 161994e964a..5a3c7d988d5 100644 --- a/TAO/tao/PortableServer/LifespanStrategyTransient.h +++ b/TAO/tao/PortableServer/LifespanStrategyTransient.h @@ -27,40 +27,35 @@ namespace TAO { namespace Portable_Server { - class LifespanStrategyTransient - : public LifespanStrategy + class LifespanStrategyTransient : public LifespanStrategy { public: LifespanStrategyTransient (); - virtual void notify_startup (); + void notify_startup () override; - virtual void notify_shutdown (); + void notify_shutdown () override; char key_type () const; - virtual CORBA::Boolean is_persistent () const; + CORBA::Boolean is_persistent () const override; CORBA::ULong key_length () const; - virtual void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at); + void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at) override; - virtual bool validate (CORBA::Boolean is_persistent, - const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const; + const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const override; /// Check the state of the POA. - virtual void check_state (); + void check_state () override; - virtual ::PortableServer::LifespanPolicyValue type() const; + bool use_imr () const override; - virtual bool use_imr () const; - - virtual CORBA::Object_ptr imr_key_to_object (const TAO::ObjectKey &key, - const char *type_id) const; + CORBA::Object_ptr imr_key_to_object (const TAO::ObjectKey &key, const char *type_id) const override; private: - TAO::Portable_Server::Creation_Time creation_time_; + TAO::Portable_Server::Creation_Time const creation_time_; }; } /* namespace Portable_Server */ } /* namespace TAO */ diff --git a/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.cpp b/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.cpp deleted file mode 100644 index 05b6c6b1e17..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- -#include "tao/PortableServer/LifespanStrategyTransientFactoryImpl.h" -#include "ace/Dynamic_Service.h" -#include "tao/PortableServer/LifespanStrategyTransient.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - LifespanStrategy* - LifespanStrategyTransientFactoryImpl::create ( - ::PortableServer::LifespanPolicyValue value) - { - LifespanStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::PERSISTENT : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in LifespanStrategyTransientFactoryImpl")); - break; - } - case ::PortableServer::TRANSIENT : - { - ACE_NEW_RETURN (strategy, LifespanStrategyTransient, 0); - break; - } - } - - return strategy; - } - - void - LifespanStrategyTransientFactoryImpl::destroy (LifespanStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -ACE_STATIC_SVC_DEFINE ( - LifespanStrategyTransientFactoryImpl, - ACE_TEXT ("LifespanStrategyTransientFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (LifespanStrategyTransientFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - LifespanStrategyTransientFactoryImpl, - TAO::Portable_Server::LifespanStrategyTransientFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - diff --git a/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.h b/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.h deleted file mode 100644 index 1d90c3f23f5..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyTransientFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_LIFEPSPANSTRATEGYTRANSIENTFACTORYIMPL_H -#define TAO_PORTABLESERVER_LIFEPSPANSTRATEGYTRANSIENTFACTORYIMPL_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/LifespanStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export LifespanStrategyTransientFactoryImpl - : public LifespanStrategyFactory - { - public: - /// Create a new strategy - virtual LifespanStrategy* create (::PortableServer::LifespanPolicyValue value); - - /// Cleanup the given strategy instance - virtual void destroy (LifespanStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, LifespanStrategyTransientFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, LifespanStrategyTransientFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_PORTABLESERVER_LIFEPSPANSTRATEGYTRANSIENTFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index bc65cf1fbc3..77a78f08282 100644 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ b/TAO/tao/PortableServer/Object_Adapter.cpp @@ -509,30 +509,30 @@ TAO_Object_Adapter::locate_servant_i (const TAO::ObjectKey &key) this->locate_poa (key, id, poa); PortableServer::Servant servant = 0; - TAO_SERVANT_LOCATION const servant_location = + TAO_Servant_Location const servant_location = poa->locate_servant_i (id, servant); switch (servant_location) { - case TAO_SERVANT_FOUND: + case TAO_Servant_Location::Found: // Optimistic attitude - case TAO_DEFAULT_SERVANT: - case TAO_SERVANT_MANAGER: + case TAO_Servant_Location::Default_Servant: + case TAO_Servant_Location::Servant_Manager: return 0; - case TAO_SERVANT_NOT_FOUND: + case TAO_Servant_Location::Not_Found: return -1; } return -1; } -TAO_SERVANT_LOCATION +TAO_Servant_Location TAO_Object_Adapter::find_servant_i (const TAO::ObjectKey &key, PortableServer::Servant &servant) { PortableServer::ObjectId id; - TAO_Root_POA *poa = 0; + TAO_Root_POA *poa = nullptr; this->locate_poa (key, id, poa); @@ -547,7 +547,7 @@ TAO_Object_Adapter::open () // If a POA extension hasn't changed the servant dispatcher, initialize the // default one. - if (this->servant_dispatcher_ == 0) + if (!this->servant_dispatcher_) { ACE_NEW (this->servant_dispatcher_, TAO_Default_Servant_Dispatcher); @@ -560,8 +560,7 @@ TAO_Object_Adapter::open () ::CORBA::PolicyList policy; PortableServer::POAManager_var poa_manager - = poa_manager_factory_->create_POAManager (TAO_DEFAULT_ROOTPOAMANAGER_NAME, - policy); + = poa_manager_factory_->create_POAManager (TAO_DEFAULT_ROOTPOAMANAGER_NAME, policy); #else PortableServer::POAManager_ptr poa_manager_ptr; ::CORBA::PolicyList policy_list; diff --git a/TAO/tao/PortableServer/Object_Adapter.h b/TAO/tao/PortableServer/Object_Adapter.h index c041333d425..4f534d8471b 100644 --- a/TAO/tao/PortableServer/Object_Adapter.h +++ b/TAO/tao/PortableServer/Object_Adapter.h @@ -92,7 +92,7 @@ public: int locate_servant (const TAO::ObjectKey &key); - TAO_SERVANT_LOCATION find_servant (const TAO::ObjectKey &key, + TAO_Servant_Location find_servant (const TAO::ObjectKey &key, PortableServer::Servant &servant); int find_poa (const poa_name &system_name, @@ -165,7 +165,7 @@ public: protected: int locate_servant_i (const TAO::ObjectKey &key); - TAO_SERVANT_LOCATION find_servant_i (const TAO::ObjectKey &key, + TAO_Servant_Location find_servant_i (const TAO::ObjectKey &key, PortableServer::Servant &servant); void dispatch_servant_i (const TAO::ObjectKey &key, diff --git a/TAO/tao/PortableServer/Object_Adapter.inl b/TAO/tao/PortableServer/Object_Adapter.inl index 7acba182498..7092ede9222 100644 --- a/TAO/tao/PortableServer/Object_Adapter.inl +++ b/TAO/tao/PortableServer/Object_Adapter.inl @@ -50,12 +50,12 @@ TAO_Object_Adapter::locate_servant (const TAO::ObjectKey &key) return this->locate_servant_i (key); } -ACE_INLINE TAO_SERVANT_LOCATION +ACE_INLINE TAO_Servant_Location TAO_Object_Adapter::find_servant (const TAO::ObjectKey &key, PortableServer::Servant &servant) { // Lock access for the duration of this transaction. - TAO_OBJECT_ADAPTER_GUARD_RETURN (TAO_SERVANT_NOT_FOUND); + TAO_OBJECT_ADAPTER_GUARD_RETURN (Not_Found); return this->find_servant_i (key, servant); } diff --git a/TAO/tao/PortableServer/Policy_Strategy.h b/TAO/tao/PortableServer/Policy_Strategy.h deleted file mode 100644 index 1acd9e71912..00000000000 --- a/TAO/tao/PortableServer/Policy_Strategy.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Policy_Strategy.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_POLICY_STRATEGY_H -#define TAO_POLICY_STRATEGY_H -#include /**/ "ace/pre.h" - -#include "tao/orbconf.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Object.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_Root_POA; - -namespace TAO -{ - namespace Portable_Server - { - class Policy_Strategy - : public ACE_Service_Object - { - public: - virtual void strategy_init(TAO_Root_POA *poa) = 0; - - virtual void strategy_cleanup() = 0; - - virtual ~Policy_Strategy () {}; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_POLICY_STRATEGY_H */ diff --git a/TAO/tao/PortableServer/PortableServer.cpp b/TAO/tao/PortableServer/PortableServer.cpp index 42268bcdfec..8d2cd3f885c 100644 --- a/TAO/tao/PortableServer/PortableServer.cpp +++ b/TAO/tao/PortableServer/PortableServer.cpp @@ -1,152 +1,15 @@ #include "tao/PortableServer/PortableServer.h" -#include "tao/PortableServer/Object_Adapter.h" #include "tao/PortableServer/Object_Adapter_Factory.h" #include "tao/PortableServer/POA_Current_Factory.h" -#include "tao/PortableServer/ThreadStrategyFactoryImpl.h" -#include "tao/PortableServer/LifespanStrategyFactoryImpl.h" -#include "tao/PortableServer/IdAssignmentStrategyFactoryImpl.h" -#include "tao/PortableServer/IdUniquenessStrategyFactoryImpl.h" -#include "tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h" -#include "tao/PortableServer/RequestProcessingStrategyFactoryImpl.h" -#include "tao/PortableServer/ServantRetentionStrategyFactoryImpl.h" - -#include "tao/PortableServer/ThreadStrategyORBControl.h" -#include "tao/PortableServer/ThreadStrategySingle.h" -#include "tao/PortableServer/ThreadStrategySingleFactoryImpl.h" - -#include "tao/PortableServer/IdAssignmentStrategySystem.h" -#include "tao/PortableServer/IdAssignmentStrategyUser.h" - -#include "tao/PortableServer/IdUniquenessStrategyMultiple.h" -#include "tao/PortableServer/IdUniquenessStrategyUnique.h" - -#include "tao/PortableServer/ImplicitActivationStrategyExplicit.h" -#include "tao/PortableServer/ImplicitActivationStrategyImplicit.h" - -#include "tao/PortableServer/RequestProcessingStrategyAOMOnly.h" -#include "tao/PortableServer/RequestProcessingStrategyDefaultServant.h" -#include "tao/PortableServer/RequestProcessingStrategyServantManager.h" - -#include "tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h" -#include "tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h" - -#include "tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h" -#include "tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h" -#include "tao/PortableServer/RequestProcessingStrategyServantActivatorFI.h" -#include "tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h" - -#include "tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h" - -#include "tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h" -#include "tao/PortableServer/LifespanStrategyTransientFactoryImpl.h" - TAO_BEGIN_VERSIONED_NAMESPACE_DECL int TAO_POA_Initializer::init () { - ACE_Service_Config::process_directive ( - ace_svc_desc_IdAssignmentStrategySystem); - -#if !defined (CORBA_E_MICRO) - ACE_Service_Config::process_directive ( - ace_svc_desc_IdAssignmentStrategyUser); -#endif /* CORBA_E_MICRO */ - -#if !defined (CORBA_E_MICRO) - ACE_Service_Config::process_directive ( - ace_svc_desc_IdUniquenessStrategyMultiple); -#endif /* CORBA_E_MICRO */ - - ACE_Service_Config::process_directive ( - ace_svc_desc_IdUniquenessStrategyUnique); - - ACE_Service_Config::process_directive ( - ace_svc_desc_IdUniquenessStrategyUniqueFactoryImpl); - - ACE_Service_Config::process_directive ( - ace_svc_desc_ImplicitActivationStrategyExplicit); - -#if !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) - ACE_Service_Config::process_directive ( - ace_svc_desc_ImplicitActivationStrategyImplicit); -#endif /* CORBA_E_MICRO */ - - // Strategy factories - - ACE_Service_Config::process_directive ( - ace_svc_desc_ThreadStrategyFactoryImpl); - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) - ACE_Service_Config::process_directive ( - ace_svc_desc_ThreadStrategySingleFactoryImpl); -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - ACE_Service_Config::process_directive ( - ace_svc_desc_LifespanStrategyFactoryImpl); - -#if !defined (CORBA_E_MICRO) - ACE_Service_Config::process_directive ( - ace_svc_desc_LifespanStrategyPersistentFactoryImpl); -#endif /* CORBA_E_MICRO */ - - ACE_Service_Config::process_directive ( - ace_svc_desc_LifespanStrategyTransientFactoryImpl); - - ACE_Service_Config::process_directive ( - ace_svc_desc_IdAssignmentStrategyFactoryImpl); - - ACE_Service_Config::process_directive ( - ace_svc_desc_IdUniquenessStrategyFactoryImpl); - - ACE_Service_Config::process_directive ( - ace_svc_desc_ImplicitActivationStrategyFactoryImpl); - - ACE_Service_Config::process_directive ( - ace_svc_desc_RequestProcessingStrategyFactoryImpl); - - ACE_Service_Config::process_directive ( - ace_svc_desc_RequestProcessingStrategyAOMOnlyFactoryImpl); - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - ACE_Service_Config::process_directive ( - ace_svc_desc_RequestProcessingStrategyDefaultServantFactoryImpl); - - ACE_Service_Config::process_directive ( - ace_svc_desc_RequestProcessingStrategyServantActivatorFactoryImpl); - - ACE_Service_Config::process_directive ( - ace_svc_desc_RequestProcessingStrategyServantLocatorFactoryImpl); -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - ACE_Service_Config::process_directive ( - ace_svc_desc_ServantRetentionStrategyFactoryImpl); - - ACE_Service_Config::process_directive ( - ace_svc_desc_ServantRetentionStrategyRetainFactoryImpl); - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) - ACE_Service_Config::process_directive ( - ace_svc_desc_ServantRetentionStrategyNonRetainFactoryImpl); -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - // Strategy implementations - - ACE_Service_Config::process_directive ( - ace_svc_desc_ThreadStrategyORBControl); - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) - ACE_Service_Config::process_directive ( - ace_svc_desc_ThreadStrategySingle); -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - ACE_Service_Config::process_directive ( - ace_svc_desc_TAO_POA_Current_Factory); + ACE_Service_Config::process_directive (ace_svc_desc_TAO_POA_Current_Factory); - return - ACE_Service_Config::process_directive ( - ace_svc_desc_TAO_Object_Adapter_Factory); + return ACE_Service_Config::process_directive (ace_svc_desc_TAO_Object_Adapter_Factory); } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Regular_POA.cpp b/TAO/tao/PortableServer/Regular_POA.cpp index e47ea8010a6..867e819de30 100644 --- a/TAO/tao/PortableServer/Regular_POA.cpp +++ b/TAO/tao/PortableServer/Regular_POA.cpp @@ -28,10 +28,6 @@ TAO_Regular_POA::TAO_Regular_POA (const TAO_Root_POA::String &name, { } -TAO_Regular_POA::~TAO_Regular_POA () -{ -} - void TAO_Regular_POA::remove_from_parent_i () { diff --git a/TAO/tao/PortableServer/Regular_POA.h b/TAO/tao/PortableServer/Regular_POA.h index 9da69970431..e11f4a1d4fe 100644 --- a/TAO/tao/PortableServer/Regular_POA.h +++ b/TAO/tao/PortableServer/Regular_POA.h @@ -47,16 +47,16 @@ public: TAO_ORB_Core &orb_core, TAO_Object_Adapter *object_adapter); - virtual ~TAO_Regular_POA (); + ~TAO_Regular_POA () override = default; - PortableServer::POA_ptr the_parent (); + PortableServer::POA_ptr the_parent () override; protected: - virtual void remove_from_parent_i (); + void remove_from_parent_i () override; - virtual CORBA::Boolean root () const; + CORBA::Boolean root () const override; - virtual char root_key_type (); + char root_key_type () override; /// The parent of this POA, be aware that in case this pointer is nill, /// we are a parent. This can be achieved by deriving from this Regular_POA diff --git a/TAO/tao/PortableServer/RequestProcessingStrategy.cpp b/TAO/tao/PortableServer/RequestProcessingStrategy.cpp index f564757c699..713b6a92e04 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategy.cpp +++ b/TAO/tao/PortableServer/RequestProcessingStrategy.cpp @@ -14,20 +14,6 @@ namespace TAO { namespace Portable_Server { - RequestProcessingStrategy::RequestProcessingStrategy () - : poa_ (0) - { - } - - void - RequestProcessingStrategy::strategy_init( - TAO_Root_POA *poa, - ::PortableServer::ServantRetentionPolicyValue sr_value) - { - poa_ = poa; - sr_value_ = sr_value; - } - void RequestProcessingStrategy::strategy_init(TAO_Root_POA *poa) { @@ -37,13 +23,7 @@ namespace TAO void RequestProcessingStrategy::strategy_cleanup() { - poa_ = 0; - } - - ::PortableServer::ServantRetentionPolicyValue - RequestProcessingStrategy::sr_type() const - { - return sr_value_; + poa_ = nullptr; } } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategy.h b/TAO/tao/PortableServer/RequestProcessingStrategy.h index 5378d1739a4..3a25f9182be 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategy.h +++ b/TAO/tao/PortableServer/RequestProcessingStrategy.h @@ -12,13 +12,12 @@ #define TAO_REQUEST_PROCESSING_STRATEGY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/Policy_Strategy.h" +#include "tao/PortableServer/PortableServer.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/PortableServer.h" #include "tao/PortableServer/Servant_Location.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -45,21 +44,16 @@ namespace TAO namespace Portable_Server { class RequestProcessingStrategy - : public Policy_Strategy { public: - RequestProcessingStrategy (); + RequestProcessingStrategy () = default; + virtual ~RequestProcessingStrategy () = default; virtual void strategy_init(TAO_Root_POA *poa); - virtual void strategy_init( - TAO_Root_POA *poa, - ::PortableServer::ServantRetentionPolicyValue); - virtual void strategy_cleanup(); #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - virtual PortableServer::ServantManager_ptr get_servant_manager () = 0; virtual void set_servant_manager ( @@ -68,10 +62,9 @@ namespace TAO virtual void set_servant (PortableServer::Servant servant) = 0; virtual PortableServer::Servant get_servant () = 0; - #endif /* TAO_HAS_MINIMUM_POA == 0 !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ - virtual TAO_SERVANT_LOCATION locate_servant ( + virtual TAO_Servant_Location locate_servant ( const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) = 0; @@ -101,13 +94,8 @@ namespace TAO const PortableServer::ObjectId &system_id, const TAO::Portable_Server::Servant_Upcall &servant_upcall) = 0; - virtual ::PortableServer::RequestProcessingPolicyValue type() const = 0; - - virtual ::PortableServer::ServantRetentionPolicyValue sr_type() const; - protected: - TAO_Root_POA* poa_; - ::PortableServer::ServantRetentionPolicyValue sr_value_; + TAO_Root_POA* poa_ {}; }; } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.cpp index 9a77833ffe3..6d90a05f023 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.cpp +++ b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.cpp @@ -12,12 +12,7 @@ namespace TAO { namespace Portable_Server { - RequestProcessingStrategyAOMOnly::RequestProcessingStrategyAOMOnly() - { - } - #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - PortableServer::ServantManager_ptr RequestProcessingStrategyAOMOnly::get_servant_manager () { @@ -43,10 +38,9 @@ namespace TAO { throw PortableServer::POA::WrongPolicy (); } - #endif /* TAO_HAS_MINIMUM_POA == 0 !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ - TAO_SERVANT_LOCATION + TAO_Servant_Location RequestProcessingStrategyAOMOnly::locate_servant ( const PortableServer::ObjectId & system_id, PortableServer::Servant & servant) @@ -141,13 +135,6 @@ namespace TAO const TAO::Portable_Server::Servant_Upcall &/*servant_upcall*/) { } - - ::PortableServer::RequestProcessingPolicyValue - RequestProcessingStrategyAOMOnly::type() const - { - return ::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY; - } - } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.h b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.h index 28718985f5f..011f360b876 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.h +++ b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.h @@ -32,58 +32,49 @@ namespace TAO * * Request Processing Strategy which only uses the Active Object Map (AOM) */ - class RequestProcessingStrategyAOMOnly - : public RequestProcessingStrategy + class RequestProcessingStrategyAOMOnly : public RequestProcessingStrategy { public: - RequestProcessingStrategyAOMOnly (); + RequestProcessingStrategyAOMOnly () = default; #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) + PortableServer::ServantManager_ptr get_servant_manager () override; - PortableServer::ServantManager_ptr - get_servant_manager (); + void set_servant_manager (PortableServer::ServantManager_ptr imgr) override; - void set_servant_manager (PortableServer::ServantManager_ptr imgr); - - void set_servant (PortableServer::Servant servant); - - PortableServer::Servant get_servant (); + void set_servant (PortableServer::Servant servant) override; + PortableServer::Servant get_servant () override; #endif /* TAO_HAS_MINIMUM_POA == 0 !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ - virtual - TAO_SERVANT_LOCATION + TAO_Servant_Location locate_servant (const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant); + PortableServer::Servant &servant) override; - virtual PortableServer::Servant locate_servant (const char *operation, const PortableServer::ObjectId &system_id, TAO::Portable_Server::Servant_Upcall &servant_upcall, TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual PortableServer::Servant system_id_to_servant ( - const PortableServer::ObjectId &system_id); + PortableServer::Servant system_id_to_servant ( + const PortableServer::ObjectId &system_id) override; - virtual PortableServer::Servant id_to_servant ( - const PortableServer::ObjectId &id); + PortableServer::Servant id_to_servant ( + const PortableServer::ObjectId &id) override; - virtual void cleanup_servant ( + void cleanup_servant ( PortableServer::Servant servant, - const PortableServer::ObjectId &user_id); + const PortableServer::ObjectId &user_id) override; - virtual void etherealize_objects (CORBA::Boolean etherealize_objects); + void etherealize_objects (CORBA::Boolean etherealize_objects) override; - virtual PortableServer::ObjectId *servant_to_id ( - PortableServer::Servant servant); + PortableServer::ObjectId *servant_to_id (PortableServer::Servant servant) override; - virtual void post_invoke_servant_cleanup( + void post_invoke_servant_cleanup( const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall); - - virtual ::PortableServer::RequestProcessingPolicyValue type() const; + const TAO::Portable_Server::Servant_Upcall &servant_upcall) override; }; } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.cpp deleted file mode 100644 index 2bdb5d8ce17..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// -*- C++ -*- -#include "tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h" -#include "tao/PortableServer/RequestProcessingStrategy.h" -#include "tao/PortableServer/RequestProcessingStrategyAOMOnly.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategy* - RequestProcessingStrategyAOMOnlyFactoryImpl::create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue /*srvalue*/) - { - RequestProcessingStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY : - { - ACE_NEW_RETURN (strategy, RequestProcessingStrategyAOMOnly, 0); - break; - } - default : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyAOMOnlyFactoryImpl")); - break; - } - } - - return strategy; - } - - void - RequestProcessingStrategyAOMOnlyFactoryImpl::destroy ( - RequestProcessingStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -ACE_STATIC_SVC_DEFINE ( - RequestProcessingStrategyAOMOnlyFactoryImpl, - ACE_TEXT ("RequestProcessingStrategyAOMOnlyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (RequestProcessingStrategyAOMOnlyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - RequestProcessingStrategyAOMOnlyFactoryImpl, - TAO::Portable_Server::RequestProcessingStrategyAOMOnlyFactoryImpl) -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h deleted file mode 100644 index c3bbc2407fb..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyAOMOnlyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYAOMONLYFACTORYIMPL_H -#define TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYAOMONLYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/RequestProcessingStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export RequestProcessingStrategyAOMOnlyFactoryImpl - : public RequestProcessingStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual RequestProcessingStrategy* create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue); - - virtual void destroy (RequestProcessingStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyAOMOnlyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyAOMOnlyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYAOMONLYFACTORYIMPL_H*/ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.cpp index cd58b8697d9..97997f1baf6 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.cpp +++ b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.cpp @@ -18,15 +18,10 @@ namespace TAO { namespace Portable_Server { - RequestProcessingStrategyDefaultServant::RequestProcessingStrategyDefaultServant () - : default_servant_ (0) - { - } - void RequestProcessingStrategyDefaultServant::strategy_cleanup() { - this->default_servant_ = 0; + this->default_servant_ = nullptr; } PortableServer::ServantManager_ptr @@ -63,7 +58,7 @@ namespace TAO // once on the Servant argument before returning. When the POA no // longer needs the Servant, it will invoke _remove_ref on it the // same number of times. - if (servant != 0) + if (servant) { // A recursive thread lock without using a recursive thread // lock. Non_Servant_Upcall has a magic constructor and @@ -80,20 +75,20 @@ namespace TAO } } - TAO_SERVANT_LOCATION + TAO_Servant_Location RequestProcessingStrategyDefaultServant::locate_servant ( const PortableServer::ObjectId & system_id, PortableServer::Servant & servant) { - TAO_SERVANT_LOCATION location = TAO_SERVANT_NOT_FOUND; + TAO_Servant_Location location = TAO_Servant_Location::Not_Found; location = this->poa_->servant_present (system_id, servant); - if (location == TAO_SERVANT_NOT_FOUND) + if (location == TAO_Servant_Location::Not_Found) { - if (this->default_servant_.in () != 0) + if (this->default_servant_.in ()) { - location = TAO_DEFAULT_SERVANT; + location = TAO_Servant_Location::Default_Servant; } } @@ -108,13 +103,13 @@ namespace TAO TAO::Portable_Server::POA_Current_Impl &poa_current_impl, bool & /*wait_occurred_restart_call*/) { - PortableServer::Servant servant = 0; + PortableServer::Servant servant = nullptr; servant = this->poa_->find_servant (system_id, servant_upcall, poa_current_impl); - if (servant == 0) + if (!servant) { // If the POA has the USE_DEFAULT_SERVANT policy, a default servant // has been associated with the POA so the POA will invoke the @@ -122,7 +117,7 @@ namespace TAO // associated with the POA, the POA raises the OBJ_ADAPTER system // exception. PortableServer::Servant default_servant = this->default_servant_.in (); - if (default_servant == 0) + if (!default_servant) { throw ::CORBA::OBJ_ADAPTER ( CORBA::OMGVMCID | 3, @@ -144,7 +139,7 @@ namespace TAO { PortableServer::Servant servant = this->default_servant_.in (); - if (servant == 0) + if (!servant) { servant = this->poa_->find_servant (system_id); } @@ -158,7 +153,7 @@ namespace TAO { PortableServer::Servant servant = this->default_servant_.in (); - if (servant == 0) + if (!servant) { /* * If using default servant request processing strategy but @@ -239,12 +234,6 @@ namespace TAO const TAO::Portable_Server::Servant_Upcall &/*servant_upcall*/) { } - - ::PortableServer::RequestProcessingPolicyValue - RequestProcessingStrategyDefaultServant::type() const - { - return ::PortableServer::USE_DEFAULT_SERVANT; - } } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.h b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.h index e0c9f62f970..5318c0482a7 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.h +++ b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.h @@ -37,52 +37,50 @@ namespace TAO : public RequestProcessingStrategy { public: - RequestProcessingStrategyDefaultServant (); + RequestProcessingStrategyDefaultServant () = default; - virtual void strategy_cleanup(); + void strategy_cleanup() override; - PortableServer::ServantManager_ptr get_servant_manager (); + PortableServer::ServantManager_ptr get_servant_manager () override; - void set_servant_manager (PortableServer::ServantManager_ptr imgr); + void set_servant_manager (PortableServer::ServantManager_ptr imgr) override; - PortableServer::Servant get_servant (); + PortableServer::Servant get_servant () override; - void set_servant (PortableServer::Servant servant); + void set_servant (PortableServer::Servant servant) override; - virtual TAO_SERVANT_LOCATION locate_servant ( + TAO_Servant_Location locate_servant ( const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant); + PortableServer::Servant &servant) override; - virtual PortableServer::Servant locate_servant ( + PortableServer::Servant locate_servant ( const char *operation, const PortableServer::ObjectId &system_id, TAO::Portable_Server::Servant_Upcall &servant_upcall, TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual PortableServer::Servant system_id_to_servant ( - const PortableServer::ObjectId &system_id); + PortableServer::Servant system_id_to_servant ( + const PortableServer::ObjectId &system_id) override; - virtual PortableServer::Servant id_to_servant ( - const PortableServer::ObjectId &id); + PortableServer::Servant id_to_servant ( + const PortableServer::ObjectId &id) override; - virtual void cleanup_servant ( + void cleanup_servant ( PortableServer::Servant servant, - const PortableServer::ObjectId &user_id); + const PortableServer::ObjectId &user_id) override; - virtual void etherealize_objects (CORBA::Boolean etherealize_objects); + void etherealize_objects (CORBA::Boolean etherealize_objects) override; - virtual PortableServer::ObjectId *servant_to_id ( - PortableServer::Servant servant); + PortableServer::ObjectId *servant_to_id ( + PortableServer::Servant servant) override; - virtual void post_invoke_servant_cleanup( + void post_invoke_servant_cleanup( const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall); - - virtual ::PortableServer::RequestProcessingPolicyValue type() const; + const TAO::Portable_Server::Servant_Upcall &servant_upcall) override; private: - PortableServer::ServantBase_var default_servant_; + PortableServer::ServantBase_var default_servant_ {}; }; } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.cpp deleted file mode 100644 index b2a2250c04a..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include "tao/orbconf.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -#include "tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h" -#include "tao/PortableServer/RequestProcessingStrategy.h" -#include "tao/PortableServer/RequestProcessingStrategyDefaultServant.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategy* - RequestProcessingStrategyDefaultServantFactoryImpl::create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue /*srvalue*/) - { - RequestProcessingStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::USE_DEFAULT_SERVANT : - { - ACE_NEW_RETURN (strategy, RequestProcessingStrategyDefaultServant, 0); - break; - } - default : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyDefaultServantFactoryImpl")); - break; - } - } - - return strategy; - } - - void - RequestProcessingStrategyDefaultServantFactoryImpl::destroy ( - RequestProcessingStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -ACE_STATIC_SVC_DEFINE ( - RequestProcessingStrategyDefaultServantFactoryImpl, - ACE_TEXT ("RequestProcessingStrategyDefaultServantFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (RequestProcessingStrategyDefaultServantFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - RequestProcessingStrategyDefaultServantFactoryImpl, - TAO::Portable_Server::RequestProcessingStrategyDefaultServantFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h deleted file mode 100644 index 3fd7f737609..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyDefaultServantFI.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYDEFAULTSERVANTFACTORYIMPL_H -#define TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYDEFAULTSERVANTFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/RequestProcessingStrategyFactory.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export RequestProcessingStrategyDefaultServantFactoryImpl - : public RequestProcessingStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual RequestProcessingStrategy* create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue); - - virtual void destroy (RequestProcessingStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyDefaultServantFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyDefaultServantFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYDEFAULTSERVANTFACTORYIMPL_H*/ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyFactory.h b/TAO/tao/PortableServer/RequestProcessingStrategyFactory.h deleted file mode 100644 index 24b9a9c8767..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyFactory.h +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYFACTORY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/StrategyFactory.h" -#include "tao/PortableServer/RequestProcessingPolicyC.h" -#include "tao/PortableServer/ServantRetentionPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class RequestProcessingStrategy; - - class TAO_PortableServer_Export RequestProcessingStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual RequestProcessingStrategy* create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue) = 0; - - virtual void destroy (RequestProcessingStrategy *strategy) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.cpp deleted file mode 100644 index bd18a086ce7..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.cpp +++ /dev/null @@ -1,141 +0,0 @@ -#include "tao/PortableServer/RequestProcessingStrategyFactoryImpl.h" -#include "tao/PortableServer/RequestProcessingStrategyAOMOnly.h" -#include "tao/PortableServer/RequestProcessingStrategyDefaultServant.h" -#include "tao/PortableServer/RequestProcessingStrategyServantLocator.h" -#include "tao/PortableServer/RequestProcessingStrategyServantActivator.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategy* - RequestProcessingStrategyFactoryImpl::create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue) - { - RequestProcessingStrategy* strategy = 0; - RequestProcessingStrategyFactory *strategy_factory = 0; - - switch (value) - { - case ::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY : - { - strategy_factory = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyAOMOnlyFactory"); - - break; - } - case ::PortableServer::USE_DEFAULT_SERVANT : - { - strategy_factory = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyDefaultServantFactory"); - - break; - } - case ::PortableServer::USE_SERVANT_MANAGER : - { -#if (TAO_HAS_MINIMUM_POA == 0) - switch (srvalue) - { - case ::PortableServer::RETAIN : - { - strategy_factory = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyServantActivatorFactory"); - - break; - } - case ::PortableServer::NON_RETAIN : - { - strategy_factory = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyServantLocatorFactory"); - - break; - } - } -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - break; - } - } - - if (strategy_factory != 0) - strategy = strategy_factory->create (value, srvalue); - else - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) %p\n"), - ACE_TEXT ("ERROR, Unable to get ") - ACE_TEXT ("RequestProcessingStrategyFactory"))); - - return strategy; - } - - void - RequestProcessingStrategyFactoryImpl::destroy ( - RequestProcessingStrategy *strategy) - { - RequestProcessingStrategyFactory *strategy_factory = 0; - - switch (strategy->type ()) - { - case ::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY : - { - strategy_factory = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyAOMOnlyFactory"); - - break; - } - case ::PortableServer::USE_DEFAULT_SERVANT : - { - strategy_factory = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyDefaultServantFactory"); - - break; - } - case ::PortableServer::USE_SERVANT_MANAGER : - { -#if (TAO_HAS_MINIMUM_POA == 0) - switch (strategy->sr_type ()) - { - case ::PortableServer::RETAIN : - { - strategy_factory = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyServantActivatorFactory"); - - break; - } - case ::PortableServer::NON_RETAIN : - { - strategy_factory = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyServantLocatorFactory"); - break; - } - } -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - break; - } - } - - if (strategy_factory != 0) - { - strategy_factory->destroy (strategy); - } - } - } -} - -ACE_STATIC_SVC_DEFINE ( - RequestProcessingStrategyFactoryImpl, - ACE_TEXT ("RequestProcessingStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (RequestProcessingStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - RequestProcessingStrategyFactoryImpl, - TAO::Portable_Server::RequestProcessingStrategyFactoryImpl) -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.h b/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.h deleted file mode 100644 index 96ee26cf106..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.h +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/RequestProcessingStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export RequestProcessingStrategyFactoryImpl - : public RequestProcessingStrategyFactory - { - public: - virtual RequestProcessingStrategy* create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue); - - virtual void destroy (RequestProcessingStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.cpp index 2ba133bb309..e07d39daf81 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.cpp +++ b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.cpp @@ -17,11 +17,6 @@ namespace TAO { namespace Portable_Server { - RequestProcessingStrategyServantActivator::RequestProcessingStrategyServantActivator () : - etherealize_objects_ (true) - { - } - void RequestProcessingStrategyServantActivator::strategy_cleanup () { @@ -61,20 +56,20 @@ namespace TAO this->validate_servant_manager (this->servant_activator_.in ()); } - TAO_SERVANT_LOCATION + TAO_Servant_Location RequestProcessingStrategyServantActivator::locate_servant ( const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) { - TAO_SERVANT_LOCATION location = TAO_SERVANT_NOT_FOUND; + TAO_Servant_Location location = TAO_Servant_Location::Not_Found; location = this->poa_->servant_present (system_id, servant); - if (location == TAO_SERVANT_NOT_FOUND) + if (location == TAO_Servant_Location::Not_Found) { if (!CORBA::is_nil (this->servant_activator_.in ())) { - location = TAO_SERVANT_MANAGER; + location = TAO_Servant_Location::Servant_Manager; } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.h b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.h index c7675ae80a0..7d41bcf6b6f 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.h +++ b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.h @@ -34,34 +34,34 @@ namespace TAO : public RequestProcessingStrategyServantManager { public: - RequestProcessingStrategyServantActivator (); + RequestProcessingStrategyServantActivator () = default; - virtual void strategy_cleanup(); + void strategy_cleanup() override; - PortableServer::ServantManager_ptr get_servant_manager (); + PortableServer::ServantManager_ptr get_servant_manager () override; - void set_servant_manager (PortableServer::ServantManager_ptr imgr); + void set_servant_manager (PortableServer::ServantManager_ptr imgr) override; - virtual TAO_SERVANT_LOCATION locate_servant ( + TAO_Servant_Location locate_servant ( const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant); + PortableServer::Servant &servant) override; - virtual PortableServer::Servant locate_servant ( + PortableServer::Servant locate_servant ( const char *operation, const PortableServer::ObjectId &system_id, TAO::Portable_Server::Servant_Upcall &servant_upcall, TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual void cleanup_servant ( + void cleanup_servant ( PortableServer::Servant servant, - const PortableServer::ObjectId &user_id); + const PortableServer::ObjectId &user_id) override; - virtual void etherealize_objects (CORBA::Boolean etherealize_objects); + void etherealize_objects (CORBA::Boolean etherealize_objects) override; - virtual void post_invoke_servant_cleanup( + void post_invoke_servant_cleanup( const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall); + const TAO::Portable_Server::Servant_Upcall &servant_upcall) override; private: PortableServer::Servant incarnate_servant ( @@ -73,7 +73,7 @@ namespace TAO private: PortableServer::ServantActivator_var servant_activator_; - CORBA::Boolean etherealize_objects_; + CORBA::Boolean etherealize_objects_ { true }; }; } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.cpp deleted file mode 100644 index 9d25c652d3a..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "tao/orbconf.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -#include "tao/PortableServer/RequestProcessingStrategyServantActivatorFI.h" -#include "tao/PortableServer/RequestProcessingStrategy.h" -#include "tao/PortableServer/RequestProcessingStrategyServantActivator.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategy* - RequestProcessingStrategyServantActivatorFactoryImpl::create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue) - { - RequestProcessingStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::USE_SERVANT_MANAGER : - { - switch (srvalue) - { - case ::PortableServer::RETAIN : - { - ACE_NEW_RETURN (strategy, RequestProcessingStrategyServantActivator, 0); - break; - } - case ::PortableServer::NON_RETAIN : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantActivatorFactoryImpl")); - break; - } - } - break; - } - default : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantActivatorFactoryImpl")); - break; - } - } - - return strategy; - } - - void - RequestProcessingStrategyServantActivatorFactoryImpl::destroy ( - RequestProcessingStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -ACE_STATIC_SVC_DEFINE ( - RequestProcessingStrategyServantActivatorFactoryImpl, - ACE_TEXT ("RequestProcessingStrategyServantActivatorFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (RequestProcessingStrategyServantActivatorFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - RequestProcessingStrategyServantActivatorFactoryImpl, - TAO::Portable_Server::RequestProcessingStrategyServantActivatorFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.h b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.h deleted file mode 100644 index b5bb15a8f98..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyServantActivatorFI.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYSERVANTACTIVATORFACTORYIMPL_H -#define TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYSERVANTACTIVATORFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/RequestProcessingStrategyFactory.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export RequestProcessingStrategyServantActivatorFactoryImpl - : public RequestProcessingStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual RequestProcessingStrategy* create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue); - - virtual void destroy (RequestProcessingStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyServantActivatorFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyServantActivatorFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYSERVANTACTIVATORFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.cpp index 01458939b75..40f660c33ee 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.cpp +++ b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.cpp @@ -17,10 +17,6 @@ namespace TAO { namespace Portable_Server { - RequestProcessingStrategyServantLocator::RequestProcessingStrategyServantLocator () - { - } - void RequestProcessingStrategyServantLocator::strategy_cleanup() { @@ -60,19 +56,18 @@ namespace TAO this->validate_servant_manager (this->servant_locator_.in ()); } - TAO_SERVANT_LOCATION + TAO_Servant_Location RequestProcessingStrategyServantLocator::locate_servant ( const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) { - TAO_SERVANT_LOCATION location = - this->poa_->servant_present (system_id, servant); + TAO_Servant_Location location = this->poa_->servant_present (system_id, servant); - if (location == TAO_SERVANT_NOT_FOUND) + if (location == TAO_Servant_Location::Not_Found) { if (!CORBA::is_nil (this->servant_locator_.in ())) { - location = TAO_SERVANT_MANAGER; + location = TAO_Servant_Location::Servant_Manager; } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.h b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.h index 9cff43232f2..c6f8c3a4ff6 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.h +++ b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.h @@ -34,34 +34,34 @@ namespace TAO : public RequestProcessingStrategyServantManager { public: - RequestProcessingStrategyServantLocator (); + RequestProcessingStrategyServantLocator () = default; - virtual void strategy_cleanup(); + void strategy_cleanup() override; - PortableServer::ServantManager_ptr get_servant_manager (); + PortableServer::ServantManager_ptr get_servant_manager () override; - void set_servant_manager (PortableServer::ServantManager_ptr imgr); + void set_servant_manager (PortableServer::ServantManager_ptr imgr) override; - virtual TAO_SERVANT_LOCATION locate_servant ( + TAO_Servant_Location locate_servant ( const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant); + PortableServer::Servant &servant) override; - virtual void post_invoke_servant_cleanup( + void post_invoke_servant_cleanup( const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall); + const TAO::Portable_Server::Servant_Upcall &servant_upcall) override; - virtual PortableServer::Servant locate_servant ( + PortableServer::Servant locate_servant ( const char *operation, const PortableServer::ObjectId &system_id, TAO::Portable_Server::Servant_Upcall &servant_upcall, TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual void cleanup_servant ( + void cleanup_servant ( PortableServer::Servant servant, - const PortableServer::ObjectId &user_id); + const PortableServer::ObjectId &user_id) override; - virtual void etherealize_objects (CORBA::Boolean etherealize_objects); + void etherealize_objects (CORBA::Boolean etherealize_objects) override; private: PortableServer::ServantLocator_var servant_locator_; diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.cpp deleted file mode 100644 index 9da757ce489..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- -#include "tao/orbconf.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -#include "tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h" -#include "tao/PortableServer/RequestProcessingStrategy.h" -#include "tao/PortableServer/RequestProcessingStrategyServantLocator.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategy* - RequestProcessingStrategyServantLocatorFactoryImpl::create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue) - { - RequestProcessingStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::USE_SERVANT_MANAGER : - { - switch (srvalue) - { - case ::PortableServer::RETAIN : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantLocatorFactoryImpl")); - break; - } - case ::PortableServer::NON_RETAIN : - { - ACE_NEW_RETURN (strategy, RequestProcessingStrategyServantLocator, 0); - break; - } - } - break; - } - default : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantLocatorFactoryImpl")); - break; - } - } - - return strategy; - } - - void - RequestProcessingStrategyServantLocatorFactoryImpl::destroy ( - RequestProcessingStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -ACE_STATIC_SVC_DEFINE ( - RequestProcessingStrategyServantLocatorFactoryImpl, - ACE_TEXT ("RequestProcessingStrategyServantLocatorFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (RequestProcessingStrategyServantLocatorFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - RequestProcessingStrategyServantLocatorFactoryImpl, - TAO::Portable_Server::RequestProcessingStrategyServantLocatorFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h deleted file mode 100644 index a114844ac8f..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyServantLocatorFI.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYSERVANTLOCATORFACTORYIMPL_H -#define TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYSERVANTLOCATORFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/RequestProcessingStrategyFactory.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export RequestProcessingStrategyServantLocatorFactoryImpl - : public RequestProcessingStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual RequestProcessingStrategy* create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue); - - virtual void destroy (RequestProcessingStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyServantLocatorFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyServantLocatorFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYSERVANTLOCATORFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.cpp index 6454c9ff55b..476258bcf68 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.cpp +++ b/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.cpp @@ -14,10 +14,6 @@ namespace TAO { namespace Portable_Server { - RequestProcessingStrategyServantManager::RequestProcessingStrategyServantManager () - { - } - PortableServer::Servant RequestProcessingStrategyServantManager::get_servant () { @@ -63,12 +59,6 @@ namespace TAO { return this->poa_->user_id_to_servant_i (id); } - - ::PortableServer::RequestProcessingPolicyValue - RequestProcessingStrategyServantManager::type() const - { - return ::PortableServer::USE_SERVANT_MANAGER; - } } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.h b/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.h index 420d9441072..65438cb07f7 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.h +++ b/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.h @@ -33,25 +33,20 @@ namespace TAO : public RequestProcessingStrategy { public: - RequestProcessingStrategyServantManager (); + RequestProcessingStrategyServantManager () = default; - PortableServer::Servant get_servant (); + PortableServer::Servant get_servant () override; - void set_servant (PortableServer::Servant servant); + void set_servant (PortableServer::Servant servant) override; - void validate_servant_manager ( + virtual void validate_servant_manager ( PortableServer::ServantManager_ptr servant_manager); - virtual PortableServer::Servant system_id_to_servant ( - const PortableServer::ObjectId &system_id); + PortableServer::Servant system_id_to_servant (const PortableServer::ObjectId &system_id) override; - virtual PortableServer::Servant id_to_servant ( - const PortableServer::ObjectId &id); + PortableServer::Servant id_to_servant (const PortableServer::ObjectId &id) override; - virtual PortableServer::ObjectId *servant_to_id ( - PortableServer::Servant servant); - - virtual ::PortableServer::RequestProcessingPolicyValue type() const; + PortableServer::ObjectId *servant_to_id (PortableServer::Servant servant) override; }; } } diff --git a/TAO/tao/PortableServer/Root_POA.cpp b/TAO/tao/PortableServer/Root_POA.cpp index a2ea413e806..049f891a4bf 100644 --- a/TAO/tao/PortableServer/Root_POA.cpp +++ b/TAO/tao/PortableServer/Root_POA.cpp @@ -258,11 +258,9 @@ TAO_Root_POA::TAO_Root_POA (const TAO_Root_POA::String &name, // minimum POA builds, remove this code and remove the guards // in Object_Adapter.cpp when changing the default policy for the // RootPOA. - if (ACE_OS::strcmp (this->name_.c_str (), - TAO_DEFAULT_ROOTPOA_NAME) == 0) + if (ACE_OS::strcmp (this->name_.c_str (), TAO_DEFAULT_ROOTPOA_NAME) == 0) { - this->cached_policies_.implicit_activation - (PortableServer::IMPLICIT_ACTIVATION); + this->cached_policies_.implicit_activation (PortableServer::IMPLICIT_ACTIVATION); } #endif /* TAO_HAS_MINIMUM_POA == 1 */ @@ -270,7 +268,7 @@ TAO_Root_POA::TAO_Root_POA (const TAO_Root_POA::String &name, this->active_policy_strategies_.update (this->cached_policies_, this); TAO::Portable_Server::Active_Policy_Strategies_Cleanup_Guard aps_cleanup_guard ( - &this->active_policy_strategies_); + std::addressof(this->active_policy_strategies_)); // Set the folded name of this POA. this->set_folded_name (parent); @@ -2189,7 +2187,7 @@ TAO_Root_POA::client_exposed_policies (CORBA::Short /* object_priority */) return policies._retn (); } -TAO_SERVANT_LOCATION +TAO_Servant_Location TAO_Root_POA::locate_servant_i (const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) { @@ -2197,7 +2195,7 @@ TAO_Root_POA::locate_servant_i (const PortableServer::ObjectId &system_id, locate_servant (system_id, servant); } -TAO_SERVANT_LOCATION +TAO_Servant_Location TAO_Root_POA::servant_present (const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) { diff --git a/TAO/tao/PortableServer/Root_POA.h b/TAO/tao/PortableServer/Root_POA.h index 317e4ce67f5..812a4b7d00e 100644 --- a/TAO/tao/PortableServer/Root_POA.h +++ b/TAO/tao/PortableServer/Root_POA.h @@ -391,7 +391,7 @@ public: PortableServer::Servant find_servant (const PortableServer::ObjectId &system_id); - TAO_SERVANT_LOCATION servant_present ( + TAO_Servant_Location servant_present ( const PortableServer::ObjectId &system_id, PortableServer::Servant &servant); @@ -620,7 +620,7 @@ protected: PortableInterceptor::ObjectReferenceFactory *current_factory); - TAO_SERVANT_LOCATION locate_servant_i (const PortableServer::ObjectId &id, + TAO_Servant_Location locate_servant_i (const PortableServer::ObjectId &id, PortableServer::Servant &servant); PortableServer::Servant locate_servant_i ( diff --git a/TAO/tao/PortableServer/ServantRetentionStrategy.cpp b/TAO/tao/PortableServer/ServantRetentionStrategy.cpp new file mode 100644 index 00000000000..81c33e627da --- /dev/null +++ b/TAO/tao/PortableServer/ServantRetentionStrategy.cpp @@ -0,0 +1,23 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file ServantRetentionStrategy.cpp + */ +//============================================================================= + +#include "tao/PortableServer/ServantRetentionStrategy.h" + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace TAO +{ + namespace Portable_Server + { + ServantRetentionStrategy::ServantRetentionStrategy () + { + } + } /* namespace Portable_Server */ +} /* namespace TAO */ + +TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ServantRetentionStrategy.h b/TAO/tao/PortableServer/ServantRetentionStrategy.h index 6873a3b8028..700616953f8 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategy.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategy.h @@ -12,13 +12,12 @@ #define TAO_SERVANTRETENTIONSTRATEGY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/Policy_Strategy.h" +#include "tao/PortableServer/Servant_Location.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/Servant_Location.h" #include "tao/PortableServer/Servant_Upcall.h" #include "tao/PortableServer/ServantRetentionPolicyC.h" #include "tao/PortableServer/PortableServer.h" @@ -34,15 +33,21 @@ namespace TAO namespace Portable_Server { class ServantRetentionStrategy - : public Policy_Strategy { public: + ServantRetentionStrategy (); + virtual ~ServantRetentionStrategy () = default; + + virtual void strategy_init (TAO_Root_POA *poa); + + virtual void strategy_cleanup(); + virtual CORBA::ULong waiting_servant_deactivation () const = 0; virtual int is_servant_in_map (PortableServer::Servant servant, bool &wait_occurred_restart_call) = 0; - virtual TAO_SERVANT_LOCATION servant_present ( + virtual TAO_Servant_Location servant_present ( const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) = 0; diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyFactory.h b/TAO/tao/PortableServer/ServantRetentionStrategyFactory.h deleted file mode 100644 index dce8425c22b..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyFactory.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYFACTORY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/StrategyFactory.h" -#include "tao/PortableServer/ServantRetentionPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ServantRetentionStrategy; - - class TAO_PortableServer_Export ServantRetentionStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ServantRetentionStrategy* create (::PortableServer::ServantRetentionPolicyValue value) = 0; - - virtual void destroy (ServantRetentionStrategy *strategy) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.cpp deleted file mode 100644 index 71fa991e79a..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// -*- C++ -*- -#include "tao/PortableServer/ServantRetentionStrategyFactoryImpl.h" -#include "tao/PortableServer/ServantRetentionStrategy.h" -#include "tao/debug.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ServantRetentionStrategy* - ServantRetentionStrategyFactoryImpl::create ( - ::PortableServer::ServantRetentionPolicyValue value) - { - ServantRetentionStrategyFactory *strategy_factory = 0; - const char *strategy_factory_name = 0; - - switch (value) - { - case ::PortableServer::RETAIN : - { - strategy_factory_name = "ServantRetentionStrategyRetainFactory"; - break; - } - case ::PortableServer::NON_RETAIN : - { - strategy_factory_name = "ServantRetentionStrategyNonRetainFactory"; - break; - } - } - - strategy_factory = - ACE_Dynamic_Service::instance (strategy_factory_name); - - if (strategy_factory == 0) - { - if (TAO_debug_level > 1) - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR, Unable to get %C\n"), - strategy_factory_name)); - - return 0; - } - - return strategy_factory->create (value); - } - - void - ServantRetentionStrategyFactoryImpl::destroy ( - ServantRetentionStrategy *strategy) - { - const char *strategy_factory_name = 0; - - switch (strategy->type ()) - { - case ::PortableServer::RETAIN : - { - strategy_factory_name = "ServantRetentionStrategyRetainFactory"; - break; - } - case ::PortableServer::NON_RETAIN : - { - strategy_factory_name = "ServantRetentionStrategyNonRetainFactory"; - break; - } - } - - ServantRetentionStrategyFactory *servantretention_strategy_factory = - ACE_Dynamic_Service::instance (strategy_factory_name); - - if (servantretention_strategy_factory != 0) - { - servantretention_strategy_factory->destroy (strategy); - } - } - } -} - -ACE_STATIC_SVC_DEFINE ( - ServantRetentionStrategyFactoryImpl, - ACE_TEXT ("ServantRetentionStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ServantRetentionStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ServantRetentionStrategyFactoryImpl, - TAO::Portable_Server::ServantRetentionStrategyFactoryImpl) -TAO_END_VERSIONED_NAMESPACE_DECL - diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.h b/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.h deleted file mode 100644 index e73ae1ff4d5..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/ServantRetentionStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export ServantRetentionStrategyFactoryImpl - : public ServantRetentionStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ServantRetentionStrategy* create (::PortableServer::ServantRetentionPolicyValue value); - - virtual void destroy (ServantRetentionStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ServantRetentionStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ServantRetentionStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp index e4e39fbe4bd..7fd93860d12 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp +++ b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp @@ -24,12 +24,6 @@ namespace TAO { namespace Portable_Server { - ServantRetentionStrategyNonRetain::ServantRetentionStrategyNonRetain () : - poa_ (0), - sys_id_count_ (0) - { - } - void ServantRetentionStrategyNonRetain::strategy_init (TAO_Root_POA *poa) { @@ -39,7 +33,7 @@ namespace TAO void ServantRetentionStrategyNonRetain::strategy_cleanup () { - poa_ = 0; + poa_ = nullptr; } void @@ -87,12 +81,12 @@ namespace TAO throw PortableServer::POA::WrongPolicy (); } - TAO_SERVANT_LOCATION + TAO_Servant_Location ServantRetentionStrategyNonRetain::servant_present ( const PortableServer::ObjectId &/*system_id*/, PortableServer::Servant &/*servant*/) { - return TAO_SERVANT_NOT_FOUND; + return TAO_Servant_Location::Not_Found; } PortableServer::Servant diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h index 8d2e46f5336..3365ec714fd 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h @@ -33,97 +33,88 @@ namespace TAO : public ServantRetentionStrategy { public: - ServantRetentionStrategyNonRetain (); + ServantRetentionStrategyNonRetain () = default; - virtual void strategy_init (TAO_Root_POA *poa); + void strategy_init (TAO_Root_POA *poa) override; - virtual void strategy_cleanup(); + void strategy_cleanup() override; CORBA::ULong waiting_servant_deactivation () const; - virtual PortableServer::ObjectId * activate_object (PortableServer::Servant servant, CORBA::Short priority, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual void activate_object_with_id (const PortableServer::ObjectId &id, PortableServer::Servant servant, CORBA::Short priority, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual void deactivate_object (const PortableServer::ObjectId &id); + void deactivate_object (const PortableServer::ObjectId &id) override; - virtual PortableServer::Servant find_servant ( - const PortableServer::ObjectId &system_id); + PortableServer::Servant find_servant ( + const PortableServer::ObjectId &system_id) override; - virtual int is_servant_in_map (PortableServer::Servant servant, - bool &wait_occurred_restart_call); + int is_servant_in_map (PortableServer::Servant servant, + bool &wait_occurred_restart_call) override; - virtual PortableServer::ObjectId *system_id_to_object_id ( - const PortableServer::ObjectId &system_id); + PortableServer::ObjectId *system_id_to_object_id ( + const PortableServer::ObjectId &system_id) override; - virtual PortableServer::Servant - user_id_to_servant (const PortableServer::ObjectId &id); + user_id_to_servant (const PortableServer::ObjectId &id) override; CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &id, bool indirect); - virtual TAO_SERVANT_LOCATION servant_present ( + TAO_Servant_Location servant_present ( const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant); + PortableServer::Servant &servant) override; - virtual PortableServer::Servant find_servant ( + PortableServer::Servant find_servant ( const PortableServer::ObjectId &system_id, TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl); + TAO::Portable_Server::POA_Current_Impl &poa_current_impl) override; - virtual int find_servant_priority ( + int find_servant_priority ( const PortableServer::ObjectId &system_id, - CORBA::Short &priority); + CORBA::Short &priority) override; - virtual void deactivate_all_objects (); + void deactivate_all_objects () override; - virtual PortableServer::ObjectId *servant_to_user_id ( - PortableServer::Servant servant); + PortableServer::ObjectId *servant_to_user_id (PortableServer::Servant servant) override; - virtual CORBA::Object_ptr servant_to_reference ( - PortableServer::Servant servant); + CORBA::Object_ptr servant_to_reference (PortableServer::Servant servant) override; - virtual CORBA::Object_ptr create_reference ( - const char *intf, - CORBA::Short priority); + CORBA::Object_ptr create_reference (const char *intf, CORBA::Short priority) override; #if !defined (CORBA_E_MICRO) - virtual CORBA::Object_ptr create_reference_with_id ( + CORBA::Object_ptr create_reference_with_id ( const PortableServer::ObjectId &oid, const char *intf, - CORBA::Short priority); + CORBA::Short priority) override; #endif - virtual int rebind_using_user_id_and_system_id ( + int rebind_using_user_id_and_system_id ( PortableServer::Servant servant, const PortableServer::ObjectId &user_id, const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall); + TAO::Portable_Server::Servant_Upcall &servant_upcall) override; - virtual CORBA::Boolean servant_has_remaining_activations ( - PortableServer::Servant servant); + CORBA::Boolean servant_has_remaining_activations (PortableServer::Servant servant) override; - virtual int unbind_using_user_id ( - const PortableServer::ObjectId &user_id); + int unbind_using_user_id (const PortableServer::ObjectId &user_id) override; - virtual ::PortableServer::ServantRetentionPolicyValue type() const; + ::PortableServer::ServantRetentionPolicyValue type() const override; - virtual TAO_Active_Object_Map * get_active_object_map() const; + TAO_Active_Object_Map * get_active_object_map() const override; protected: - TAO_Root_POA *poa_; - std::atomic sys_id_count_; + TAO_Root_POA *poa_ {}; + std::atomic sys_id_count_ { 0 }; }; } } diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.cpp deleted file mode 100644 index 5d5881e9582..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "tao/orbconf.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -#include "tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h" -#include "tao/PortableServer/ServantRetentionStrategy.h" -#include "tao/PortableServer/ServantRetentionStrategyNonRetain.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ServantRetentionStrategy* - ServantRetentionStrategyNonRetainFactoryImpl::create ( - ::PortableServer::ServantRetentionPolicyValue value) - { - ServantRetentionStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::NON_RETAIN : - { - ACE_NEW_RETURN (strategy, ServantRetentionStrategyNonRetain, 0); - break; - } - case ::PortableServer::RETAIN : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in ServantRetentionStrategyNonRetainFactoryImpl")); - break; - } - } - - return strategy; - } - - void - ServantRetentionStrategyNonRetainFactoryImpl::destroy ( - ServantRetentionStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -ACE_STATIC_SVC_DEFINE ( - ServantRetentionStrategyNonRetainFactoryImpl, - ACE_TEXT ("ServantRetentionStrategyNonRetainFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ServantRetentionStrategyNonRetainFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ServantRetentionStrategyNonRetainFactoryImpl, - TAO::Portable_Server::ServantRetentionStrategyNonRetainFactoryImpl) -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 && !CORBA_E_COMPACT && !CORBA_E_MICRO */ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h deleted file mode 100644 index f4003e80207..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyNonRetainFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYNONRETAIN_FACTORYIMPL_H -#define TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYNONRETAIN_FACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/ServantRetentionStrategyFactory.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export ServantRetentionStrategyNonRetainFactoryImpl - : public ServantRetentionStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ServantRetentionStrategy* create (::PortableServer::ServantRetentionPolicyValue value); - - virtual void destroy (ServantRetentionStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ServantRetentionStrategyNonRetainFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ServantRetentionStrategyNonRetainFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYNONRETAIN_FACTORYIMPL_H*/ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp index efcd7935078..292e13dfcd2 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp +++ b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp @@ -26,13 +26,6 @@ namespace TAO { namespace Portable_Server { - ServantRetentionStrategyRetain::ServantRetentionStrategyRetain () : - ServantRetentionStrategyNonRetain (), - active_object_map_ (), - waiting_servant_deactivation_ (0) - { - } - void ServantRetentionStrategyRetain::strategy_init (TAO_Root_POA *poa) { @@ -234,7 +227,7 @@ namespace TAO } } - TAO_SERVANT_LOCATION + TAO_Servant_Location ServantRetentionStrategyRetain::servant_present ( const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) @@ -256,11 +249,11 @@ namespace TAO if (result == 0) { // Success - return TAO_SERVANT_FOUND; + return TAO_Servant_Location::Found; } else { - return TAO_SERVANT_NOT_FOUND; + return TAO_Servant_Location::Not_Found; } } @@ -961,13 +954,6 @@ namespace TAO return this->active_object_map_->remaining_activations (servant); } - - ::PortableServer::ServantRetentionPolicyValue - ServantRetentionStrategyRetain::type() const - { - return ::PortableServer::RETAIN; - } - TAO_Active_Object_Map * ServantRetentionStrategyRetain::get_active_object_map() const { diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h index a475bdb69ac..22eefd38cd1 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h @@ -18,7 +18,8 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Auto_Ptr.h" +#include "tao/PortableServer/Active_Object_Map.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -32,82 +33,67 @@ namespace TAO : public ServantRetentionStrategyNonRetain { public: - ServantRetentionStrategyRetain (); + ServantRetentionStrategyRetain () = default; - CORBA::ULong waiting_servant_deactivation () const; + CORBA::ULong waiting_servant_deactivation () const override; - virtual void strategy_init (TAO_Root_POA *poa); + void strategy_init (TAO_Root_POA *poa) override; - virtual void strategy_cleanup(); + void strategy_cleanup() override; - virtual int is_servant_in_map (PortableServer::Servant servant, - bool &wait_occurred_restart_call); + int is_servant_in_map (PortableServer::Servant servant, + bool &wait_occurred_restart_call) override; - virtual PortableServer::ObjectId * activate_object (PortableServer::Servant servant, CORBA::Short priority, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual void activate_object_with_id (const PortableServer::ObjectId &id, PortableServer::Servant servant, CORBA::Short priority, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - void deactivate_object (const PortableServer::ObjectId &id); + void deactivate_object (const PortableServer::ObjectId &id) override; - virtual PortableServer::Servant find_servant ( - const PortableServer::ObjectId &system_id); + PortableServer::Servant find_servant (const PortableServer::ObjectId &system_id) override; - virtual PortableServer::ObjectId * system_id_to_object_id ( - const PortableServer::ObjectId &system_id); + PortableServer::ObjectId * system_id_to_object_id (const PortableServer::ObjectId &system_id) override; - virtual - PortableServer::Servant - user_id_to_servant (const PortableServer::ObjectId &id); + PortableServer::Servant user_id_to_servant (const PortableServer::ObjectId &id) override; CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &id, - bool indirect); + bool indirect) override; - virtual - TAO_SERVANT_LOCATION + TAO_Servant_Location servant_present (const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant); + PortableServer::Servant &servant) override; - virtual PortableServer::Servant find_servant ( + PortableServer::Servant find_servant ( const PortableServer::ObjectId &system_id, TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl); + TAO::Portable_Server::POA_Current_Impl &poa_current_impl) override; - virtual int find_servant_priority ( + int find_servant_priority ( const PortableServer::ObjectId &system_id, - CORBA::Short &priority); + CORBA::Short &priority) override; - virtual void deactivate_all_objects (); + void deactivate_all_objects () override; - virtual PortableServer::ObjectId *servant_to_user_id ( - PortableServer::Servant servant); + PortableServer::ObjectId *servant_to_user_id (PortableServer::Servant servant) override; - virtual - CORBA::Object_ptr servant_to_reference (PortableServer::Servant servant); + CORBA::Object_ptr servant_to_reference (PortableServer::Servant servant) override; - virtual - CORBA::Object_ptr create_reference ( - const char *intf, - CORBA::Short priority); + CORBA::Object_ptr create_reference (const char *intf, CORBA::Short priority) override; #if !defined (CORBA_E_MICRO) - virtual CORBA::Object_ptr create_reference_with_id ( const PortableServer::ObjectId &oid, const char *intf, - CORBA::Short priority); + CORBA::Short priority) override; #endif - virtual ::PortableServer::ServantRetentionPolicyValue type() const; - protected: int is_user_id_in_map (const PortableServer::ObjectId &id, @@ -122,25 +108,23 @@ namespace TAO PortableServer::Servant p_servant, CORBA::Short &priority); - virtual int rebind_using_user_id_and_system_id ( PortableServer::Servant servant, const PortableServer::ObjectId &user_id, const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall); + TAO::Portable_Server::Servant_Upcall &servant_upcall) override; - virtual CORBA::Boolean servant_has_remaining_activations ( - PortableServer::Servant servant); + PortableServer::Servant servant) override; - virtual int unbind_using_user_id ( - const PortableServer::ObjectId &user_id); + int unbind_using_user_id ( + const PortableServer::ObjectId &user_id) override; TAO_Active_Object_Map * get_active_object_map() const; private: std::unique_ptr active_object_map_; - CORBA::ULong waiting_servant_deactivation_; + CORBA::ULong waiting_servant_deactivation_ { 0 } ; }; } } diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.cpp deleted file mode 100644 index ab5b254407c..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// -*- C++ -*- -#include "tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h" -#include "tao/PortableServer/ServantRetentionStrategy.h" -#include "tao/PortableServer/ServantRetentionStrategyRetain.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ServantRetentionStrategy* - ServantRetentionStrategyRetainFactoryImpl::create ( - ::PortableServer::ServantRetentionPolicyValue value) - { - ServantRetentionStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::RETAIN : - { - ACE_NEW_RETURN (strategy, ServantRetentionStrategyRetain, 0); - break; - } - case ::PortableServer::NON_RETAIN : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in ServantRetentionStrategyNonRetainFactoryImpl")); - break; - } - } - - return strategy; - } - - void - ServantRetentionStrategyRetainFactoryImpl::destroy ( - ServantRetentionStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -ACE_STATIC_SVC_DEFINE ( - ServantRetentionStrategyRetainFactoryImpl, - ACE_TEXT ("ServantRetentionStrategyRetainFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ServantRetentionStrategyRetainFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ServantRetentionStrategyRetainFactoryImpl, - TAO::Portable_Server::ServantRetentionStrategyRetainFactoryImpl) -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h b/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h deleted file mode 100644 index 1a2d964250a..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyRetainFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYRETAIN_FACTORYIMPL_H -#define TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYRETAIN_FACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/ServantRetentionStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export ServantRetentionStrategyRetainFactoryImpl - : public ServantRetentionStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ServantRetentionStrategy* create (::PortableServer::ServantRetentionPolicyValue value); - - virtual void destroy (ServantRetentionStrategy *strategy); - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ServantRetentionStrategyRetainFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ServantRetentionStrategyRetainFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYRETAIN_FACTORYIMPL_H*/ diff --git a/TAO/tao/PortableServer/Servant_Location.h b/TAO/tao/PortableServer/Servant_Location.h index 2946650b2bf..e9eefbaac43 100644 --- a/TAO/tao/PortableServer/Servant_Location.h +++ b/TAO/tao/PortableServer/Servant_Location.h @@ -8,8 +8,8 @@ */ //============================================================================= -#ifndef TAO_SERVANT_LOCATION_H -#define TAO_SERVANT_LOCATION_H +#ifndef TAO_Servant_Location_H +#define TAO_Servant_Location_H #include /**/ "ace/pre.h" @@ -23,16 +23,16 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -enum TAO_SERVANT_LOCATION +enum class TAO_Servant_Location { - TAO_SERVANT_FOUND, - TAO_DEFAULT_SERVANT, - TAO_SERVANT_MANAGER, - TAO_SERVANT_NOT_FOUND + Found, + Default_Servant, + Servant_Manager, + Not_Found }; TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" -#endif /* TAO_SERVANT_LOCATION_H */ +#endif /* TAO_Servant_Location_H */ diff --git a/TAO/tao/PortableServer/Servant_Upcall.cpp b/TAO/tao/PortableServer/Servant_Upcall.cpp index ecad0576c2e..ae36b5d7486 100644 --- a/TAO/tao/PortableServer/Servant_Upcall.cpp +++ b/TAO/tao/PortableServer/Servant_Upcall.cpp @@ -403,7 +403,7 @@ namespace TAO ex._tao_print_exception ("TAO_POA::~complete_destruction_i"); } - this->poa_ = 0; + this->poa_ = nullptr; } } } diff --git a/TAO/tao/PortableServer/ThreadStrategy.cpp b/TAO/tao/PortableServer/ThreadStrategy.cpp deleted file mode 100644 index 647081f0660..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategy.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "tao/PortableServer/ThreadStrategy.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - void - ThreadStrategy::strategy_init (TAO_Root_POA * /*poa*/) - { - } - - void - ThreadStrategy::strategy_cleanup () - { - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ThreadStrategy.h b/TAO/tao/PortableServer/ThreadStrategy.h index 289c9dcd214..6ad68bcb0cd 100644 --- a/TAO/tao/PortableServer/ThreadStrategy.h +++ b/TAO/tao/PortableServer/ThreadStrategy.h @@ -12,13 +12,12 @@ #define TAO_THREAD_STRATEGY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/Policy_Strategy.h" +#include "tao/PortableServer/ThreadPolicyC.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/ThreadPolicyC.h" #include "tao/orbconf.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -28,18 +27,14 @@ namespace TAO namespace Portable_Server { class ThreadStrategy - : public Policy_Strategy { public: + ThreadStrategy () = default; + virtual ~ThreadStrategy () = default; + virtual int enter () = 0; virtual int exit () = 0; - - void strategy_init (TAO_Root_POA *poa) override; - - void strategy_cleanup() override; - - virtual ::PortableServer::ThreadPolicyValue type() const = 0; }; } } diff --git a/TAO/tao/PortableServer/ThreadStrategyFactory.h b/TAO/tao/PortableServer/ThreadStrategyFactory.h deleted file mode 100644 index bac43806fa1..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategyFactory.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ThreadStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_THREADPOLICYSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_THREADPOLICYSTRATEGYFACTORY_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/StrategyFactory.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/ThreadPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ThreadStrategy; - - class ThreadStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ThreadStrategy *create (::PortableServer::ThreadPolicyValue value) = 0; - - /// Cleanup the given strategy instance - virtual void destroy (ThreadStrategy *strategy) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_PORTABLESERVER_THREADPOLICYSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.cpp deleted file mode 100644 index 908513d3cb4..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include "tao/PortableServer/ThreadStrategyFactoryImpl.h" -#include "tao/PortableServer/ThreadStrategy.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ThreadStrategy* - ThreadStrategyFactoryImpl::create ( - ::PortableServer::ThreadPolicyValue value) - { - ThreadStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::SINGLE_THREAD_MODEL : - { - ThreadStrategyFactory *strategy_factory = - ACE_Dynamic_Service::instance ("ThreadStrategySingleFactory"); - - if (strategy_factory) - { - strategy = strategy_factory->create (value); - } - else - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) %p\n"), - ACE_TEXT ("ERROR, Unable to get ") - ACE_TEXT ("ThreadStrategySingleFactory"))); - - break; - } - case ::PortableServer::ORB_CTRL_MODEL : - { - strategy = - ACE_Dynamic_Service::instance ("ThreadStrategyORBControl"); - - if (!strategy) - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) %p\n"), - ACE_TEXT ("ERROR, Unable to get ") - ACE_TEXT ("ThreadStrategyORBControl"))); - - break; - } - } - - return strategy; - } - - void - ThreadStrategyFactoryImpl::destroy ( - ThreadStrategy *strategy) - { - switch (strategy->type ()) - { - case ::PortableServer::SINGLE_THREAD_MODEL : - { - ThreadStrategyFactory *strategy_factory = - ACE_Dynamic_Service::instance ("ThreadStrategySingleFactory"); - - if (strategy_factory) - { - strategy_factory->destroy (strategy); - } - break; - } - case ::PortableServer::ORB_CTRL_MODEL : - { - // Noop - break; - } - } - } - } -} - -ACE_STATIC_SVC_DEFINE ( - ThreadStrategyFactoryImpl, - ACE_TEXT ("ThreadStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ThreadStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ThreadStrategyFactoryImpl, - TAO::Portable_Server::ThreadStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.h b/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.h deleted file mode 100644 index 666793af2fd..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ThreadStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_THREADPOLICYSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_THREADPOLICYSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/ThreadStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export ThreadStrategyFactoryImpl - : public ThreadStrategyFactory - { - public: - /// Create a new servant retention strategy - ThreadStrategy* create (::PortableServer::ThreadPolicyValue value) override; - - void destroy (ThreadStrategy *strategy) override; - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ThreadStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ThreadStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_THREADPOLICYSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/ThreadStrategyORBControl.cpp b/TAO/tao/PortableServer/ThreadStrategyORBControl.cpp index aa99de625fe..bdd833456cd 100644 --- a/TAO/tao/PortableServer/ThreadStrategyORBControl.cpp +++ b/TAO/tao/PortableServer/ThreadStrategyORBControl.cpp @@ -19,25 +19,7 @@ namespace TAO { return 0; } - - ::PortableServer::ThreadPolicyValue - ThreadStrategyORBControl::type () const - { - return ::PortableServer::ORB_CTRL_MODEL; - } } } -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ThreadStrategyORBControl, - TAO::Portable_Server::ThreadStrategyORBControl) - -ACE_STATIC_SVC_DEFINE ( - ThreadStrategyORBControl, - ACE_TEXT ("ThreadStrategyORBControl"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ThreadStrategyORBControl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ThreadStrategyORBControl.h b/TAO/tao/PortableServer/ThreadStrategyORBControl.h index 1bf7c0cf336..af3db329d0c 100644 --- a/TAO/tao/PortableServer/ThreadStrategyORBControl.h +++ b/TAO/tao/PortableServer/ThreadStrategyORBControl.h @@ -13,15 +13,13 @@ #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/ThreadStrategy.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/ThreadStrategy.h" #include "tao/orbconf.h" -#include "ace/Service_Config.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -29,22 +27,16 @@ namespace TAO { namespace Portable_Server { - class ThreadStrategyORBControl - : public ThreadStrategy + class ThreadStrategyORBControl : public ThreadStrategy { public: int enter () override; int exit () override; - - ::PortableServer::ThreadPolicyValue type() const override; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ThreadStrategyORBControl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ThreadStrategyORBControl) - TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" diff --git a/TAO/tao/PortableServer/ThreadStrategySingle.cpp b/TAO/tao/PortableServer/ThreadStrategySingle.cpp index 6f58c76f9ec..08f0dba3b63 100644 --- a/TAO/tao/PortableServer/ThreadStrategySingle.cpp +++ b/TAO/tao/PortableServer/ThreadStrategySingle.cpp @@ -3,7 +3,6 @@ #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) #include "tao/PortableServer/ThreadStrategySingle.h" -#include "ace/Dynamic_Service.h" #include "ace/Log_Msg.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -23,27 +22,9 @@ namespace TAO { return lock_.release(); } - - ::PortableServer::ThreadPolicyValue - ThreadStrategySingle::type() const - { - return ::PortableServer::SINGLE_THREAD_MODEL; - } } } -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ThreadStrategySingle, - TAO::Portable_Server::ThreadStrategySingle) - -ACE_STATIC_SVC_DEFINE ( - ThreadStrategySingle, - ACE_TEXT ("ThreadStrategySingle"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ThreadStrategySingle), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) TAO_END_VERSIONED_NAMESPACE_DECL #endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/ThreadStrategySingle.h b/TAO/tao/PortableServer/ThreadStrategySingle.h index 87962311eb7..29baed0bedb 100644 --- a/TAO/tao/PortableServer/ThreadStrategySingle.h +++ b/TAO/tao/PortableServer/ThreadStrategySingle.h @@ -38,24 +38,18 @@ namespace TAO { namespace Portable_Server { - class TAO_PortableServer_Export ThreadStrategySingle : - public ThreadStrategy + class ThreadStrategySingle : public ThreadStrategy { public: int enter () override; int exit () override; - - ::PortableServer::ThreadPolicyValue type() const override; private: TAO_SYNCH_RECURSIVE_MUTEX lock_; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ThreadStrategySingle) -ACE_FACTORY_DECLARE (TAO_PortableServer, ThreadStrategySingle) - TAO_END_VERSIONED_NAMESPACE_DECL #endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.cpp b/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.cpp deleted file mode 100644 index 8b9f2a898d2..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "tao/orbconf.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -#include "tao/PortableServer/ThreadStrategySingleFactoryImpl.h" -#include "tao/PortableServer/ThreadStrategy.h" -#include "tao/PortableServer/ThreadStrategySingle.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ThreadStrategy* - ThreadStrategySingleFactoryImpl::create ( - ::PortableServer::ThreadPolicyValue value) - { - ThreadStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::SINGLE_THREAD_MODEL : - { - ACE_NEW_RETURN (strategy, ThreadStrategySingle, 0); - break; - } - case ::PortableServer::ORB_CTRL_MODEL : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in ThreadStrategySingleFactoryImpl")); - break; - } - } - - return strategy; - } - - void - ThreadStrategySingleFactoryImpl::destroy (ThreadStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -ACE_STATIC_SVC_DEFINE ( - ThreadStrategySingleFactoryImpl, - ACE_TEXT ("ThreadStrategySingleFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ThreadStrategySingleFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ThreadStrategySingleFactoryImpl, - TAO::Portable_Server::ThreadStrategySingleFactoryImpl) -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.h b/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.h deleted file mode 100644 index 2dbf0a018bc..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.h +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ThreadStrategySingleFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_THREADPOLICYSINGLESTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_THREADPOLICYSINGLESTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/ThreadStrategyFactory.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ThreadStrategySingleFactoryImpl - : public ThreadStrategyFactory - { - public: - /// Create a new thread strategy - ThreadStrategy* create (::PortableServer::ThreadPolicyValue value) override; - - void destroy (ThreadStrategy *strategy) override; - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ThreadStrategySingleFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ThreadStrategySingleFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_THREADPOLICYSINGLESTRATEGYFACTORYIMPL_H*/ -- cgit v1.2.1 From 4db6c4351dfd785f59a9b16122e52eeec44520c0 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 12:30:59 +0100 Subject: Fixed unresolved exports, more override * ACE/protocols/ace/HTBP/HTBP_Addr.cpp: * ACE/protocols/ace/HTBP/HTBP_Addr.h: * TAO/tao/PortableServer/Active_Object_Map.cpp: * TAO/tao/PortableServer/Active_Object_Map.h: * TAO/tao/PortableServer/Active_Policy_Strategies.h: * TAO/tao/PortableServer/Active_Policy_Strategies.inl: * TAO/tao/PortableServer/IdUniquenessStrategy.h: * TAO/tao/PortableServer/Operation_Table_Binary_Search.cpp: * TAO/tao/PortableServer/Operation_Table_Binary_Search.h: * TAO/tao/PortableServer/Operation_Table_Dynamic_Hash.h: * TAO/tao/PortableServer/Operation_Table_Linear_Search.cpp: * TAO/tao/PortableServer/Operation_Table_Linear_Search.h: * TAO/tao/PortableServer/Operation_Table_Perfect_Hash.cpp: * TAO/tao/PortableServer/Operation_Table_Perfect_Hash.h: * TAO/tao/PortableServer/POA_Current_Factory.cpp: * TAO/tao/PortableServer/POA_Current_Impl.cpp: * TAO/tao/PortableServer/POA_Current_Impl.h: * TAO/tao/PortableServer/POA_Policy_Set.h: * TAO/tao/PortableServer/ServantRetentionStrategy.h: --- ACE/protocols/ace/HTBP/HTBP_Addr.cpp | 6 ----- ACE/protocols/ace/HTBP/HTBP_Addr.h | 2 +- TAO/tao/PortableServer/Active_Object_Map.cpp | 26 ---------------------- TAO/tao/PortableServer/Active_Object_Map.h | 12 +++++----- TAO/tao/PortableServer/Active_Policy_Strategies.h | 1 - .../PortableServer/Active_Policy_Strategies.inl | 3 +-- TAO/tao/PortableServer/IdUniquenessStrategy.h | 4 ++-- .../Operation_Table_Binary_Search.cpp | 4 ---- .../PortableServer/Operation_Table_Binary_Search.h | 20 ++++++++--------- .../PortableServer/Operation_Table_Dynamic_Hash.h | 20 ++++++++--------- .../Operation_Table_Linear_Search.cpp | 4 ---- .../PortableServer/Operation_Table_Linear_Search.h | 20 ++++++++--------- .../Operation_Table_Perfect_Hash.cpp | 5 ----- .../PortableServer/Operation_Table_Perfect_Hash.h | 23 +++++++++---------- TAO/tao/PortableServer/POA_Current_Factory.cpp | 4 ++-- TAO/tao/PortableServer/POA_Current_Impl.cpp | 3 +-- TAO/tao/PortableServer/POA_Current_Impl.h | 2 +- TAO/tao/PortableServer/POA_Policy_Set.h | 2 +- TAO/tao/PortableServer/ServantRetentionStrategy.h | 4 ++-- 19 files changed, 58 insertions(+), 107 deletions(-) diff --git a/ACE/protocols/ace/HTBP/HTBP_Addr.cpp b/ACE/protocols/ace/HTBP/HTBP_Addr.cpp index fdc13f56090..182fa4f1fbc 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Addr.cpp +++ b/ACE/protocols/ace/HTBP/HTBP_Addr.cpp @@ -3,14 +3,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -// Constructor -ACE::HTBP::Addr::Addr () -{ -} - // Creates a ACE_INET_Addr from a PORT_NUMBER and the remote // HOST_NAME. - ACE::HTBP::Addr::Addr (u_short port_number, const char host_name[], int address_family) diff --git a/ACE/protocols/ace/HTBP/HTBP_Addr.h b/ACE/protocols/ace/HTBP/HTBP_Addr.h index 3484700dc53..21e6ec35303 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Addr.h +++ b/ACE/protocols/ace/HTBP/HTBP_Addr.h @@ -41,7 +41,7 @@ namespace ACE { public: /// Constructor - Addr (); + Addr () = default; Addr (const Addr &other); diff --git a/TAO/tao/PortableServer/Active_Object_Map.cpp b/TAO/tao/PortableServer/Active_Object_Map.cpp index 9f626b82f58..1ddf7e457cd 100644 --- a/TAO/tao/PortableServer/Active_Object_Map.cpp +++ b/TAO/tao/PortableServer/Active_Object_Map.cpp @@ -377,10 +377,6 @@ TAO_Active_Object_Map::is_user_id_in_map ( //////////////////////////////////////////////////////////////////////////////// -TAO_Id_Uniqueness_Strategy::~TAO_Id_Uniqueness_Strategy () -{ -} - void TAO_Id_Uniqueness_Strategy::set_active_object_map ( TAO_Active_Object_Map *active_object_map) @@ -790,10 +786,6 @@ TAO_Multiple_Id_Strategy::remaining_activations ( } #endif -TAO_Lifespan_Strategy::~TAO_Lifespan_Strategy () -{ -} - void TAO_Lifespan_Strategy::set_active_object_map ( TAO_Active_Object_Map *active_object_map) @@ -913,10 +905,6 @@ TAO_Active_Object_Map_Entry *&entry) } #endif -TAO_Id_Assignment_Strategy::~TAO_Id_Assignment_Strategy () -{ -} - void TAO_Id_Assignment_Strategy::set_active_object_map ( TAO_Active_Object_Map *active_object_map) @@ -1071,21 +1059,11 @@ TAO_System_Id_With_Multiple_Id_Strategy::bind_using_system_id ( //////////////////////////////////////////////////////////////////////////////// -TAO_Id_Hint_Strategy::~TAO_Id_Hint_Strategy () -{ -} - -//////////////////////////////////////////////////////////////////////////////// - TAO_Active_Hint_Strategy::TAO_Active_Hint_Strategy (CORBA::ULong map_size) : system_id_map_ (map_size) { } -TAO_Active_Hint_Strategy::~TAO_Active_Hint_Strategy () -{ -} - int TAO_Active_Hint_Strategy::recover_key ( const PortableServer::ObjectId &system_id, @@ -1135,10 +1113,6 @@ TAO_Active_Hint_Strategy::system_id (PortableServer::ObjectId_out system_id, //////////////////////////////////////////////////////////////////////////////// -TAO_No_Hint_Strategy::~TAO_No_Hint_Strategy () -{ -} - int TAO_No_Hint_Strategy::recover_key (const PortableServer::ObjectId &system_id, PortableServer::ObjectId &user_id) diff --git a/TAO/tao/PortableServer/Active_Object_Map.h b/TAO/tao/PortableServer/Active_Object_Map.h index b4eb5ef21ea..d9c99565c45 100644 --- a/TAO/tao/PortableServer/Active_Object_Map.h +++ b/TAO/tao/PortableServer/Active_Object_Map.h @@ -277,7 +277,7 @@ class TAO_Id_Uniqueness_Strategy { public: /// Virtual destructor. - virtual ~TAO_Id_Uniqueness_Strategy (); + virtual ~TAO_Id_Uniqueness_Strategy () = default; /// Must be used with UNIQUE_ID policy. virtual int @@ -432,7 +432,7 @@ class TAO_Lifespan_Strategy { public: /// Virtual destructor. - virtual ~TAO_Lifespan_Strategy (); + virtual ~TAO_Lifespan_Strategy () = default; /// Can be used with any policy. virtual int @@ -503,7 +503,7 @@ class TAO_Id_Assignment_Strategy { public: /// Virtual destructor. - virtual ~TAO_Id_Assignment_Strategy (); + virtual ~TAO_Id_Assignment_Strategy () = default; /// Must be used with SYSTEM_ID policy. virtual int @@ -589,7 +589,7 @@ class TAO_Id_Hint_Strategy { public: /// Virtual destructor. - virtual ~TAO_Id_Hint_Strategy (); + virtual ~TAO_Id_Hint_Strategy () = default; /// Find the user id from the system id. virtual int @@ -632,7 +632,7 @@ public: TAO_Active_Hint_Strategy (CORBA::ULong map_size); /// Virtual destructor. - virtual ~TAO_Active_Hint_Strategy (); + virtual ~TAO_Active_Hint_Strategy () = default; virtual int recover_key (const PortableServer::ObjectId &system_id, @@ -674,7 +674,7 @@ class TAO_No_Hint_Strategy : public TAO_Id_Hint_Strategy { public: /// Virtual destructor. - virtual ~TAO_No_Hint_Strategy (); + virtual ~TAO_No_Hint_Strategy () = default; virtual int recover_key (const PortableServer::ObjectId &system_id, diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.h b/TAO/tao/PortableServer/Active_Policy_Strategies.h index f05fbba535c..9f982b3998e 100644 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.h +++ b/TAO/tao/PortableServer/Active_Policy_Strategies.h @@ -100,7 +100,6 @@ namespace TAO Active_Policy_Strategies_Cleanup_Guard () = delete; Active_Policy_Strategies_Cleanup_Guard (Active_Policy_Strategies *p); ~Active_Policy_Strategies_Cleanup_Guard (); - Active_Policy_Strategies *_retn (); private: diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.inl b/TAO/tao/PortableServer/Active_Policy_Strategies.inl index 0f1e51fb0eb..78f1b33b63e 100644 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.inl +++ b/TAO/tao/PortableServer/Active_Policy_Strategies.inl @@ -62,8 +62,7 @@ namespace TAO } ACE_INLINE - Active_Policy_Strategies_Cleanup_Guard - ::~Active_Policy_Strategies_Cleanup_Guard () + Active_Policy_Strategies_Cleanup_Guard::~Active_Policy_Strategies_Cleanup_Guard () { if (this->ptr_) { diff --git a/TAO/tao/PortableServer/IdUniquenessStrategy.h b/TAO/tao/PortableServer/IdUniquenessStrategy.h index 7098f64e59e..323356245ea 100644 --- a/TAO/tao/PortableServer/IdUniquenessStrategy.h +++ b/TAO/tao/PortableServer/IdUniquenessStrategy.h @@ -32,9 +32,9 @@ namespace TAO IdUniquenessStrategy (); virtual ~IdUniquenessStrategy () = default; - virtual void strategy_init (TAO_Root_POA *poa); + virtual void strategy_init (TAO_Root_POA *poa) = 0; - virtual void strategy_cleanup (); + virtual void strategy_cleanup () = 0; /* * Validate if the servant may be activated diff --git a/TAO/tao/PortableServer/Operation_Table_Binary_Search.cpp b/TAO/tao/PortableServer/Operation_Table_Binary_Search.cpp index a36d050310a..0810f667852 100644 --- a/TAO/tao/PortableServer/Operation_Table_Binary_Search.cpp +++ b/TAO/tao/PortableServer/Operation_Table_Binary_Search.cpp @@ -26,10 +26,6 @@ ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Operation_Table_Timeprobe_Description, TAO_BEGIN_VERSIONED_NAMESPACE_DECL -TAO_Binary_Search_OpTable::~TAO_Binary_Search_OpTable () -{ -} - int TAO_Binary_Search_OpTable::find (const char *opname, TAO_Skeleton &skelfunc, diff --git a/TAO/tao/PortableServer/Operation_Table_Binary_Search.h b/TAO/tao/PortableServer/Operation_Table_Binary_Search.h index 0d45423ff0d..741d3f4da1c 100644 --- a/TAO/tao/PortableServer/Operation_Table_Binary_Search.h +++ b/TAO/tao/PortableServer/Operation_Table_Binary_Search.h @@ -39,20 +39,20 @@ class TAO_PortableServer_Export TAO_Binary_Search_OpTable { public: /// Do nothing destructor. - virtual ~TAO_Binary_Search_OpTable (); + ~TAO_Binary_Search_OpTable () override = default; /// See the documentation in the base class for details. - virtual int find (const char *opname, - TAO_Skeleton &skelfunc, - const unsigned int length = 0); + int find (const char *opname, + TAO_Skeleton &skelfunc, + const unsigned int length = 0) override; - virtual int find (const char *opname, - TAO_Collocated_Skeleton &skelfunc, - TAO::Collocation_Strategy s, - const unsigned int length = 0); + int find (const char *opname, + TAO_Collocated_Skeleton &skelfunc, + TAO::Collocation_Strategy s, + const unsigned int length = 0) override; - virtual int bind (const char *opname, - const TAO::Operation_Skeletons skel_ptr); + int bind (const char *opname, + const TAO::Operation_Skeletons skel_ptr) override; private: /// Method that should defined by the subclasses. GPERF program diff --git a/TAO/tao/PortableServer/Operation_Table_Dynamic_Hash.h b/TAO/tao/PortableServer/Operation_Table_Dynamic_Hash.h index c2c421691f2..9959710c633 100644 --- a/TAO/tao/PortableServer/Operation_Table_Dynamic_Hash.h +++ b/TAO/tao/PortableServer/Operation_Table_Dynamic_Hash.h @@ -49,20 +49,20 @@ public: ACE_Allocator *alloc); /// Destructor - ~TAO_Dynamic_Hash_OpTable (); + ~TAO_Dynamic_Hash_OpTable () override; /// See the documentation in the base class for details. - virtual int bind (const char *opname, - const TAO::Operation_Skeletons skel_ptr); + int bind (const char *opname, + const TAO::Operation_Skeletons skel_ptr) override; - virtual int find (const char *opname, - TAO_Skeleton &skelfunc, - const unsigned int length = 0); + int find (const char *opname, + TAO_Skeleton &skelfunc, + const unsigned int length = 0) override; - virtual int find (const char *opname, - TAO_Collocated_Skeleton &skelfunc, - TAO::Collocation_Strategy s, - const unsigned int length = 0); + int find (const char *opname, + TAO_Collocated_Skeleton &skelfunc, + TAO::Collocation_Strategy s, + const unsigned int length = 0) override; private: typedef ACE_Hash_Map_Manager_Ex Date: Mon, 13 Feb 2023 12:43:48 +0100 Subject: Use override/default for RTPortableServer * TAO/NEWS: * TAO/tao/RTPortableServer/RT_Acceptor_Filters.h: * TAO/tao/RTPortableServer/RT_Collocation_Resolver.h: * TAO/tao/RTPortableServer/RT_Object_Adapter_Factory.h: * TAO/tao/RTPortableServer/RT_POA.cpp: * TAO/tao/RTPortableServer/RT_POA.h: * TAO/tao/RTPortableServer/RT_Policy_Validator.h: * TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp: * TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h: --- TAO/NEWS | 3 + TAO/tao/RTPortableServer/RT_Acceptor_Filters.h | 4 +- TAO/tao/RTPortableServer/RT_Collocation_Resolver.h | 2 +- .../RTPortableServer/RT_Object_Adapter_Factory.h | 2 +- TAO/tao/RTPortableServer/RT_POA.cpp | 7 +- TAO/tao/RTPortableServer/RT_POA.h | 102 ++++++++++----------- TAO/tao/RTPortableServer/RT_Policy_Validator.h | 4 +- TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp | 4 - TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h | 10 +- 9 files changed, 66 insertions(+), 72 deletions(-) diff --git a/TAO/NEWS b/TAO/NEWS index a65cd83348f..23f0ed8a665 100644 --- a/TAO/NEWS +++ b/TAO/NEWS @@ -1,6 +1,9 @@ USER VISIBLE CHANGES BETWEEN TAO-3.0.11 and TAO-3.1.0 ===================================================== +. Removed usage of ACE service configurator for all + POA internal strategy classes + USER VISIBLE CHANGES BETWEEN TAO-3.0.10 and TAO-3.0.11 ====================================================== diff --git a/TAO/tao/RTPortableServer/RT_Acceptor_Filters.h b/TAO/tao/RTPortableServer/RT_Acceptor_Filters.h index 5a90d176b41..bb87e9dad19 100644 --- a/TAO/tao/RTPortableServer/RT_Acceptor_Filters.h +++ b/TAO/tao/RTPortableServer/RT_Acceptor_Filters.h @@ -52,11 +52,11 @@ public: TAO_MProfile &mprofile, TAO_Acceptor **acceptors_begin, TAO_Acceptor **acceptors_end, - CORBA::Short priority); + CORBA::Short priority) override; /// Encodes the endpoints in the profiles into the TAO_TAG_ENDPOINTS /// tag component of profiles. - int encode_endpoints (TAO_MProfile &mprofile); + int encode_endpoints (TAO_MProfile &mprofile) override; private: /// Value of the ServerProtocolPolicy used for endpoint diff --git a/TAO/tao/RTPortableServer/RT_Collocation_Resolver.h b/TAO/tao/RTPortableServer/RT_Collocation_Resolver.h index bf32bc4fccc..457615bfdaf 100644 --- a/TAO/tao/RTPortableServer/RT_Collocation_Resolver.h +++ b/TAO/tao/RTPortableServer/RT_Collocation_Resolver.h @@ -41,7 +41,7 @@ class TAO_RTPortableServer_Export TAO_RT_Collocation_Resolver : { public: /// Is @a object collocated? - virtual CORBA::Boolean is_collocated (CORBA::Object_ptr object) const; + CORBA::Boolean is_collocated (CORBA::Object_ptr object) const override; }; diff --git a/TAO/tao/RTPortableServer/RT_Object_Adapter_Factory.h b/TAO/tao/RTPortableServer/RT_Object_Adapter_Factory.h index 2709e4d3ec6..6e1ac24df2a 100644 --- a/TAO/tao/RTPortableServer/RT_Object_Adapter_Factory.h +++ b/TAO/tao/RTPortableServer/RT_Object_Adapter_Factory.h @@ -32,7 +32,7 @@ class TAO_RTPortableServer_Export TAO_RT_Object_Adapter_Factory { public: /// Create adapter. - virtual TAO_Adapter *create (TAO_ORB_Core *orb_core); + TAO_Adapter *create (TAO_ORB_Core *orb_core) override; }; diff --git a/TAO/tao/RTPortableServer/RT_POA.cpp b/TAO/tao/RTPortableServer/RT_POA.cpp index 0ead61fa6d7..93b27235ac6 100644 --- a/TAO/tao/RTPortableServer/RT_POA.cpp +++ b/TAO/tao/RTPortableServer/RT_POA.cpp @@ -45,17 +45,12 @@ TAO_RT_POA::TAO_RT_POA (const TAO_Root_POA::String &name, lock, thread_lock, orb_core, - object_adapter), - thread_pool_ (0) + object_adapter) { // Parse the RT policies and update our policy cache. this->parse_rt_policies (this->policies ()); } -TAO_RT_POA::~TAO_RT_POA () -{ -} - TAO_Root_POA * TAO_RT_POA::new_POA (const String &name, PortableServer::POAManager_ptr poa_manager, diff --git a/TAO/tao/RTPortableServer/RT_POA.h b/TAO/tao/RTPortableServer/RT_POA.h index 4c510007cb3..62420daa053 100644 --- a/TAO/tao/RTPortableServer/RT_POA.h +++ b/TAO/tao/RTPortableServer/RT_POA.h @@ -50,129 +50,129 @@ class TAO_RTPortableServer_Export TAO_RT_POA public: // RTCORBA specific methods CORBA::Object_ptr create_reference_with_priority (const char * intf, - RTCORBA::Priority priority); + RTCORBA::Priority priority) override; #if !defined (CORBA_E_MICRO) CORBA::Object_ptr create_reference_with_id_and_priority (const PortableServer::ObjectId & oid, const char * intf, - RTCORBA::Priority priority); + RTCORBA::Priority priority) override; #endif PortableServer::ObjectId * activate_object_with_priority (PortableServer::Servant p_servant, - RTCORBA::Priority priority); + RTCORBA::Priority priority) override; #if !defined (CORBA_E_MICRO) void activate_object_with_id_and_priority (const PortableServer::ObjectId & oid, PortableServer::Servant p_servant, - RTCORBA::Priority priority); + RTCORBA::Priority priority) override; #endif // End RTCORBA specific methods // Standard POA interface methods PortableServer::POA_ptr create_POA (const char *adapter_name, PortableServer::POAManager_ptr poa_manager, - const CORBA::PolicyList &policies); + const CORBA::PolicyList &policies) override; PortableServer::POA_ptr find_POA (const char *adapter_name, - CORBA::Boolean activate_it); + CORBA::Boolean activate_it) override; void destroy (CORBA::Boolean etherealize_objects, - CORBA::Boolean wait_for_completion); + CORBA::Boolean wait_for_completion) override; #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) PortableServer::ThreadPolicy_ptr create_thread_policy ( - PortableServer::ThreadPolicyValue value); + PortableServer::ThreadPolicyValue value) override; #endif /* TAO_HAS_MINIMUM_POA == 0 */ #if !defined (CORBA_E_MICRO) PortableServer::LifespanPolicy_ptr create_lifespan_policy ( - PortableServer::LifespanPolicyValue value); + PortableServer::LifespanPolicyValue value) override; #endif #if !defined (CORBA_E_MICRO) PortableServer::IdUniquenessPolicy_ptr create_id_uniqueness_policy ( - PortableServer::IdUniquenessPolicyValue value); + PortableServer::IdUniquenessPolicyValue value) override; #endif #if !defined (CORBA_E_MICRO) PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy ( - PortableServer::IdAssignmentPolicyValue value); + PortableServer::IdAssignmentPolicyValue value) override; #endif #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy ( - PortableServer::ImplicitActivationPolicyValue value); + PortableServer::ImplicitActivationPolicyValue value) override; PortableServer::ServantRetentionPolicy_ptr create_servant_retention_policy ( - PortableServer::ServantRetentionPolicyValue value); + PortableServer::ServantRetentionPolicyValue value) override; PortableServer::RequestProcessingPolicy_ptr create_request_processing_policy ( - PortableServer::RequestProcessingPolicyValue value); + PortableServer::RequestProcessingPolicyValue value) override; #endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ - char * the_name (); + char * the_name () override; - PortableServer::POA_ptr the_parent (); + PortableServer::POA_ptr the_parent () override; - PortableServer::POAList *the_children (); + PortableServer::POAList *the_children () override; - PortableServer::POAManager_ptr the_POAManager (); + PortableServer::POAManager_ptr the_POAManager () override; #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - PortableServer::AdapterActivator_ptr the_activator (); + PortableServer::AdapterActivator_ptr the_activator () override; - void the_activator (PortableServer::AdapterActivator_ptr adapter_activator); + void the_activator (PortableServer::AdapterActivator_ptr adapter_activator) override; - PortableServer::ServantManager_ptr get_servant_manager (); + PortableServer::ServantManager_ptr get_servant_manager () override; - void set_servant_manager (PortableServer::ServantManager_ptr imgr); + void set_servant_manager (PortableServer::ServantManager_ptr imgr) override; - PortableServer::Servant get_servant (); + PortableServer::Servant get_servant () override; - void set_servant (PortableServer::Servant servant); + void set_servant (PortableServer::Servant servant) override; #endif /* TAO_HAS_MINIMUM_POA == 0 */ - PortableServer::ObjectId *activate_object (PortableServer::Servant p_servant); + PortableServer::ObjectId *activate_object (PortableServer::Servant p_servant) override; #if !defined (CORBA_E_MICRO) void activate_object_with_id (const PortableServer::ObjectId &id, - PortableServer::Servant p_servant); + PortableServer::Servant p_servant) override; #endif - void deactivate_object (const PortableServer::ObjectId &oid); + void deactivate_object (const PortableServer::ObjectId &oid) override; - CORBA::Object_ptr create_reference (const char *intf); + CORBA::Object_ptr create_reference (const char *intf) override; #if !defined (CORBA_E_MICRO) CORBA::Object_ptr create_reference_with_id (const PortableServer::ObjectId &oid, - const char *intf); + const char *intf) override; #endif - PortableServer::ObjectId *servant_to_id (PortableServer::Servant p_servant); + PortableServer::ObjectId *servant_to_id (PortableServer::Servant p_servant) override; - CORBA::Object_ptr servant_to_reference (PortableServer::Servant p_servant); + CORBA::Object_ptr servant_to_reference (PortableServer::Servant p_servant) override; - PortableServer::Servant reference_to_servant (CORBA::Object_ptr reference); + PortableServer::Servant reference_to_servant (CORBA::Object_ptr reference) override; - PortableServer::ObjectId *reference_to_id (CORBA::Object_ptr reference); + PortableServer::ObjectId *reference_to_id (CORBA::Object_ptr reference) override; - PortableServer::Servant id_to_servant (const PortableServer::ObjectId &oid); + PortableServer::Servant id_to_servant (const PortableServer::ObjectId &oid) override; - CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid); + CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid) override; - CORBA::OctetSeq *id (); + CORBA::OctetSeq *id () override; // End standard POA interface methods. - virtual CORBA::PolicyList *client_exposed_policies (CORBA::Short object_priority); + CORBA::PolicyList *client_exposed_policies (CORBA::Short object_priority) override; TAO_RT_POA (const String &name, PortableServer::POAManager_ptr poa_manager, @@ -183,24 +183,24 @@ public: TAO_ORB_Core &orb_core, TAO_Object_Adapter *object_adapter); - virtual ~TAO_RT_POA (); + ~TAO_RT_POA () override = default; void *thread_pool () const; protected: /// Template method for creating new POA's of this type. - virtual TAO_Root_POA *new_POA (const String &name, - PortableServer::POAManager_ptr poa_manager, - const TAO_POA_Policy_Set &policies, - TAO_Root_POA *parent, - ACE_Lock &lock, - TAO_SYNCH_MUTEX &thread_lock, - TAO_ORB_Core &orb_core, - TAO_Object_Adapter *object_adapter); - - virtual TAO_Stub *key_to_stub_i (const TAO::ObjectKey &key, - const char *type_id, - CORBA::Short priority); + TAO_Root_POA *new_POA (const String &name, + PortableServer::POAManager_ptr poa_manager, + const TAO_POA_Policy_Set &policies, + TAO_Root_POA *parent, + ACE_Lock &lock, + TAO_SYNCH_MUTEX &thread_lock, + TAO_ORB_Core &orb_core, + TAO_Object_Adapter *object_adapter) override; + + TAO_Stub *key_to_stub_i (const TAO::ObjectKey &key, + const char *type_id, + CORBA::Short priority) override; void validate_priority (RTCORBA::Priority priority); @@ -221,7 +221,7 @@ protected: int lane_required (TAO_Thread_Lane *lane, TAO_PriorityBandedConnectionPolicy *priority_bands); - TAO_Thread_Pool *thread_pool_; + TAO_Thread_Pool *thread_pool_ {}; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/RTPortableServer/RT_Policy_Validator.h b/TAO/tao/RTPortableServer/RT_Policy_Validator.h index 49e445e4dca..2fcf68be954 100644 --- a/TAO/tao/RTPortableServer/RT_Policy_Validator.h +++ b/TAO/tao/RTPortableServer/RT_Policy_Validator.h @@ -42,7 +42,7 @@ public: TAO_POA_RT_Policy_Validator (TAO_ORB_Core &orb_core); /// Destructor. - ~TAO_POA_RT_Policy_Validator () = default; + ~TAO_POA_RT_Policy_Validator () override = default; static RTCORBA::ServerProtocolPolicy_ptr server_protocol_policy_from_thread_pool (TAO_Thread_Pool *thread_pool, TAO_ORB_Core &orb_core); @@ -71,7 +71,7 @@ protected: * potentially specify policies that are unknown to an * validate () routine, and these need to be caught. */ - virtual CORBA::Boolean legal_policy_impl (CORBA::PolicyType type); + CORBA::Boolean legal_policy_impl (CORBA::PolicyType type) override; private: void validate_server_protocol (TAO_Policy_Set &policies); diff --git a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp index c49c6019527..e3faefbd69d 100644 --- a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp +++ b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp @@ -24,10 +24,6 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -TAO_RT_Servant_Dispatcher::~TAO_RT_Servant_Dispatcher () -{ -} - void TAO_RT_Servant_Dispatcher::pre_invoke_remote_request ( TAO_Root_POA &poa, diff --git a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h index dd7df712e50..4806ddf6609 100644 --- a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h +++ b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h @@ -39,22 +39,22 @@ class TAO_RTPortableServer_Export TAO_RT_Servant_Dispatcher : public TAO_Servant_Dispatcher { public: - virtual ~TAO_RT_Servant_Dispatcher (); + ~TAO_RT_Servant_Dispatcher () override = default; /// Pre_invoke remote request. void pre_invoke_remote_request (TAO_Root_POA &poa, CORBA::Short servant_priority, TAO_ServerRequest &req, - TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state); + TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state) override; /// Pre_invoke collocated request. void pre_invoke_collocated_request (TAO_Root_POA &poa, CORBA::Short servant_priority, - TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state); + TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state) override; /// Post_invoke request. void post_invoke (TAO_Root_POA &poa, - TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state); + TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state) override; /// Factory method for creating new POA's. TAO_Root_POA *create_Root_POA (const ACE_CString &name, @@ -63,7 +63,7 @@ public: ACE_Lock &lock, TAO_SYNCH_MUTEX &thread_lock, TAO_ORB_Core &orb_core, - TAO_Object_Adapter *object_adapter); + TAO_Object_Adapter *object_adapter) override; }; TAO_END_VERSIONED_NAMESPACE_DECL -- cgit v1.2.1 From 5a66fa9c3a3c1d265808ee2049dabaef4bf1a3db Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 14:01:06 +0100 Subject: Check for nil pointers in cleanup * TAO/tao/PortableServer/Active_Policy_Strategies.cpp: --- .../PortableServer/Active_Policy_Strategies.cpp | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.cpp b/TAO/tao/PortableServer/Active_Policy_Strategies.cpp index b457efcdc4f..a2a2ce4319b 100644 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.cpp +++ b/TAO/tao/PortableServer/Active_Policy_Strategies.cpp @@ -42,22 +42,22 @@ namespace TAO this->create (policies.request_processing(), policies.servant_retention()); /**/ - if (this->lifespan_strategy_ != 0) + if (this->lifespan_strategy_) { this->lifespan_strategy_->strategy_init (poa); } - if (this->request_processing_strategy_ != 0) + if (this->request_processing_strategy_) { this->request_processing_strategy_->strategy_init (poa); } - if (this->id_uniqueness_strategy_ != 0) + if (this->id_uniqueness_strategy_) { this->id_uniqueness_strategy_->strategy_init (poa); } - if (this->servant_retention_strategy_ != 0) + if (this->servant_retention_strategy_) { this->servant_retention_strategy_->strategy_init (poa); } @@ -66,15 +66,27 @@ namespace TAO void Active_Policy_Strategies::cleanup () { - this->lifespan_strategy_->strategy_cleanup (); + if (this->lifespan_strategy_) + { + this->lifespan_strategy_->strategy_cleanup (); + } this->lifespan_strategy_.reset (nullptr); - this->request_processing_strategy_->strategy_cleanup (); + if (this->request_processing_strategy_) + { + this->request_processing_strategy_->strategy_cleanup (); + } this->request_processing_strategy_.reset (nullptr); - this->id_uniqueness_strategy_->strategy_cleanup (); + if (this->id_uniqueness_strategy_) + { + this->id_uniqueness_strategy_->strategy_cleanup (); + } this->id_uniqueness_strategy_.reset (nullptr); this->implicit_activation_strategy_.reset (nullptr); this->thread_strategy_.reset (nullptr); - this->servant_retention_strategy_->strategy_cleanup (); + if (this->servant_retention_strategy_) + { + this->servant_retention_strategy_->strategy_cleanup (); + } this->servant_retention_strategy_.reset (nullptr); this->id_assignment_strategy_.reset (nullptr); } -- cgit v1.2.1 From 8c215112dfc278f704ba37db8699a829f9cabf3a Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 14:13:15 +0100 Subject: Compile fixes * TAO/tao/PortableServer/Active_Policy_Strategies.h: * TAO/tao/PortableServer/ThreadStrategy.h: --- TAO/tao/PortableServer/Active_Policy_Strategies.h | 15 ++++++++------- TAO/tao/PortableServer/ThreadStrategy.h | 3 +-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.h b/TAO/tao/PortableServer/Active_Policy_Strategies.h index 9f982b3998e..c0ff0e06b21 100644 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.h +++ b/TAO/tao/PortableServer/Active_Policy_Strategies.h @@ -28,6 +28,14 @@ #include "tao/PortableServer/ImplicitActivationPolicyC.h" #include "tao/PortableServer/RequestProcessingPolicyC.h" +#include "tao/PortableServer/ThreadStrategy.h" +#include "tao/PortableServer/IdAssignmentStrategy.h" +#include "tao/PortableServer/IdUniquenessStrategy.h" +#include "tao/PortableServer/ImplicitActivationStrategy.h" +#include "tao/PortableServer/LifespanStrategy.h" +#include "tao/PortableServer/RequestProcessingStrategy.h" +#include "tao/PortableServer/ServantRetentionStrategy.h" + TAO_BEGIN_VERSIONED_NAMESPACE_DECL class TAO_Root_POA; @@ -37,13 +45,6 @@ namespace TAO namespace Portable_Server { class Cached_Policies; - class ThreadStrategy; - class RequestProcessingStrategy; - class IdAssignmentStrategy; - class LifespanStrategy; - class IdUniquenessStrategy; - class ImplicitActivationStrategy; - class ServantRetentionStrategy; /** * This class stores the active policy strategies used for a certain POA. diff --git a/TAO/tao/PortableServer/ThreadStrategy.h b/TAO/tao/PortableServer/ThreadStrategy.h index 6ad68bcb0cd..5ee79a7a354 100644 --- a/TAO/tao/PortableServer/ThreadStrategy.h +++ b/TAO/tao/PortableServer/ThreadStrategy.h @@ -12,13 +12,12 @@ #define TAO_THREAD_STRATEGY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/ThreadPolicyC.h" +#include "tao/orbconf.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/orbconf.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL -- cgit v1.2.1 From 48b96dee6147efa609f1536296929489203f3193 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 14:16:16 +0100 Subject: Another default destructor * TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp: * TAO/tao/PortableServer/Acceptor_Filter_Factory.h: --- TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp | 4 ---- TAO/tao/PortableServer/Acceptor_Filter_Factory.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp b/TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp index c052494c862..38e3b9a251e 100644 --- a/TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp +++ b/TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp @@ -6,10 +6,6 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -TAO_Acceptor_Filter_Factory::~TAO_Acceptor_Filter_Factory() -{ -} - TAO_Acceptor_Filter* TAO_Acceptor_Filter_Factory::create_object (TAO_POA_Manager& ) { diff --git a/TAO/tao/PortableServer/Acceptor_Filter_Factory.h b/TAO/tao/PortableServer/Acceptor_Filter_Factory.h index 88fa02f2182..f408dba8b73 100644 --- a/TAO/tao/PortableServer/Acceptor_Filter_Factory.h +++ b/TAO/tao/PortableServer/Acceptor_Filter_Factory.h @@ -50,7 +50,7 @@ class TAO_PortableServer_Export TAO_Acceptor_Filter_Factory : public ACE_Service_Object { public: - virtual ~TAO_Acceptor_Filter_Factory(); + ~TAO_Acceptor_Filter_Factory() override = default; virtual TAO_Acceptor_Filter* create_object (TAO_POA_Manager& poamanager); -- cgit v1.2.1 From 53cabe442f3b082ee21458dfa2095fd0b5b0ba6b Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 14:33:33 +0100 Subject: Use default * TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp: * TAO/tao/PortableServer/Default_Acceptor_Filter.cpp: * TAO/tao/PortableServer/Default_Acceptor_Filter.h: --- TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp | 4 ++-- TAO/tao/PortableServer/Default_Acceptor_Filter.cpp | 16 +++------------- TAO/tao/PortableServer/Default_Acceptor_Filter.h | 8 ++++---- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp b/TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp index 38e3b9a251e..7384025005b 100644 --- a/TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp +++ b/TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp @@ -9,11 +9,11 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Acceptor_Filter* TAO_Acceptor_Filter_Factory::create_object (TAO_POA_Manager& ) { - TAO_Acceptor_Filter *filter = 0; + TAO_Acceptor_Filter *filter = nullptr; ACE_NEW_RETURN (filter, TAO_Default_Acceptor_Filter (), - 0); + nullptr); return filter; } diff --git a/TAO/tao/PortableServer/Default_Acceptor_Filter.cpp b/TAO/tao/PortableServer/Default_Acceptor_Filter.cpp index ec9ae61a7a8..28024ce6c2b 100644 --- a/TAO/tao/PortableServer/Default_Acceptor_Filter.cpp +++ b/TAO/tao/PortableServer/Default_Acceptor_Filter.cpp @@ -6,10 +6,6 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -TAO_Default_Acceptor_Filter::TAO_Default_Acceptor_Filter () -{ -} - int TAO_Default_Acceptor_Filter::fill_profile (const TAO::ObjectKey &object_key, TAO_MProfile &mprofile, @@ -18,14 +14,10 @@ TAO_Default_Acceptor_Filter::fill_profile (const TAO::ObjectKey &object_key, CORBA::Short priority) { // Go through all the acceptors. - for (TAO_Acceptor** acceptor = acceptors_begin; - acceptor != acceptors_end; - ++acceptor) + for (TAO_Acceptor** acceptor = acceptors_begin; acceptor != acceptors_end; ++acceptor) { // Ask each acceptor to make a profile. - if ((*acceptor)->create_profile (object_key, - mprofile, - priority) == -1) + if ((*acceptor)->create_profile (object_key, mprofile, priority) == -1) return -1; } @@ -37,9 +29,7 @@ TAO_Default_Acceptor_Filter::encode_endpoints (TAO_MProfile &mprofile) { // if -ORBUseSharedProfile is set, there may be multiple endpoints // per profile, even without priority. - for (CORBA::ULong i = 0; - i < mprofile.profile_count (); - ++i) + for (CORBA::ULong i = 0; i < mprofile.profile_count (); ++i) { TAO_Profile *profile = mprofile.get_profile (i); if (profile->encode_alternate_endpoints () == -1) diff --git a/TAO/tao/PortableServer/Default_Acceptor_Filter.h b/TAO/tao/PortableServer/Default_Acceptor_Filter.h index c440b985c5d..0057e403b6a 100644 --- a/TAO/tao/PortableServer/Default_Acceptor_Filter.h +++ b/TAO/tao/PortableServer/Default_Acceptor_Filter.h @@ -41,18 +41,18 @@ class TAO_PortableServer_Export TAO_Default_Acceptor_Filter : public TAO_Acceptor_Filter { public: - TAO_Default_Acceptor_Filter (); + TAO_Default_Acceptor_Filter () = default; /// Populate @a mprofile with all available endpoints. - virtual int fill_profile (const TAO::ObjectKey &object_key, + int fill_profile (const TAO::ObjectKey &object_key, TAO_MProfile &mprofile, TAO_Acceptor **acceptors_begin, TAO_Acceptor **acceptors_end, - CORBA::Short priority = TAO_INVALID_PRIORITY); + CORBA::Short priority = TAO_INVALID_PRIORITY) override; /// Encodes the endpoints in the profiles into the TAO_TAG_ENDPOINTS /// tag component of profiles. - int encode_endpoints (TAO_MProfile &mprofile); + int encode_endpoints (TAO_MProfile &mprofile) override; }; TAO_END_VERSIONED_NAMESPACE_DECL -- cgit v1.2.1 From d9b768c3239be29c3219f2fca81b39e2dc8787b1 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 15:29:08 +0100 Subject: the_children is not available in all CORBA profiles * TAO/tao/PortableServer/Root_POA.cpp: * TAO/tao/PortableServer/Root_POA.h: * TAO/tao/RTPortableServer/RT_POA.cpp: * TAO/tao/RTPortableServer/RT_POA.h: --- TAO/tao/PortableServer/Root_POA.cpp | 4 +++- TAO/tao/PortableServer/Root_POA.h | 3 ++- TAO/tao/RTPortableServer/RT_POA.cpp | 4 ++-- TAO/tao/RTPortableServer/RT_POA.h | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/TAO/tao/PortableServer/Root_POA.cpp b/TAO/tao/PortableServer/Root_POA.cpp index 049f891a4bf..f894825dd50 100644 --- a/TAO/tao/PortableServer/Root_POA.cpp +++ b/TAO/tao/PortableServer/Root_POA.cpp @@ -736,6 +736,8 @@ TAO_Root_POA::servant_to_reference (PortableServer::Servant servant) return this->servant_to_reference_i (servant); } + +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) PortableServer::POAList * TAO_Root_POA::the_children () { @@ -744,7 +746,7 @@ TAO_Root_POA::the_children () return this->the_children_i (); } - +#endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ PortableServer::Servant TAO_Root_POA::id_to_servant (const PortableServer::ObjectId &oid) diff --git a/TAO/tao/PortableServer/Root_POA.h b/TAO/tao/PortableServer/Root_POA.h index 812a4b7d00e..899c8031481 100644 --- a/TAO/tao/PortableServer/Root_POA.h +++ b/TAO/tao/PortableServer/Root_POA.h @@ -173,14 +173,15 @@ public: PortableServer::RequestProcessingPolicy_ptr create_request_processing_policy ( PortableServer::RequestProcessingPolicyValue value); - #endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ char * the_name (); PortableServer::POA_ptr the_parent (); +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) PortableServer::POAList *the_children (); +#endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ PortableServer::POAManager_ptr the_POAManager (); diff --git a/TAO/tao/RTPortableServer/RT_POA.cpp b/TAO/tao/RTPortableServer/RT_POA.cpp index 93b27235ac6..87830403e45 100644 --- a/TAO/tao/RTPortableServer/RT_POA.cpp +++ b/TAO/tao/RTPortableServer/RT_POA.cpp @@ -569,11 +569,13 @@ TAO_RT_POA::the_parent () return this->TAO_Regular_POA::the_parent (); } +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) PortableServer::POAList * TAO_RT_POA::the_children () { return this->TAO_Regular_POA::the_children (); } +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::POAManager_ptr TAO_RT_POA::the_POAManager () @@ -581,9 +583,7 @@ TAO_RT_POA::the_POAManager () return this->TAO_Regular_POA::the_POAManager (); } - #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - PortableServer::AdapterActivator_ptr TAO_RT_POA::the_activator () { diff --git a/TAO/tao/RTPortableServer/RT_POA.h b/TAO/tao/RTPortableServer/RT_POA.h index 62420daa053..aedc17d469c 100644 --- a/TAO/tao/RTPortableServer/RT_POA.h +++ b/TAO/tao/RTPortableServer/RT_POA.h @@ -120,12 +120,13 @@ public: PortableServer::POA_ptr the_parent () override; +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) PortableServer::POAList *the_children () override; +#endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::POAManager_ptr the_POAManager () override; #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - PortableServer::AdapterActivator_ptr the_activator () override; void the_activator (PortableServer::AdapterActivator_ptr adapter_activator) override; @@ -137,7 +138,6 @@ public: PortableServer::Servant get_servant () override; void set_servant (PortableServer::Servant servant) override; - #endif /* TAO_HAS_MINIMUM_POA == 0 */ PortableServer::ObjectId *activate_object (PortableServer::Servant p_servant) override; -- cgit v1.2.1 From 88ce4a3384ee967a8007a3575bfca9d2dde0dc7a Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 16:23:46 +0100 Subject: Replace enum with static constexpr * TAO/tao/PortableServer/Root_POA.h: --- TAO/tao/PortableServer/Root_POA.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/TAO/tao/PortableServer/Root_POA.h b/TAO/tao/PortableServer/Root_POA.h index 899c8031481..436e6e67704 100644 --- a/TAO/tao/PortableServer/Root_POA.h +++ b/TAO/tao/PortableServer/Root_POA.h @@ -275,10 +275,7 @@ public: static CORBA::ULong name_separator_length (); - enum - { - TAO_OBJECTKEY_PREFIX_SIZE = 4 - }; + static constexpr size_t TAO_OBJECTKEY_PREFIX_SIZE = 4; static CORBA::Octet const objectkey_prefix[TAO_OBJECTKEY_PREFIX_SIZE]; -- cgit v1.2.1 From 45fa63be04357683ab473a2f993e621508ecb5f7 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 16:29:08 +0100 Subject: Fixed warnings * TAO/tao/PortableServer/IdAssignmentPolicy.h: * TAO/tao/PortableServer/IdUniquenessPolicy.h: * TAO/tao/PortableServer/LifespanStrategyPersistent.h: * TAO/tao/PortableServer/LifespanStrategyTransient.h: * TAO/tao/PortableServer/Operation_Table_Linear_Search.h: * TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h: * TAO/tao/PortableServer/ServantRetentionStrategyRetain.h: * TAO/tao/RTPortableServer/RT_POA.h: * TAO/tao/RTPortableServer/RT_Policy_Validator.h: --- TAO/tao/PortableServer/IdAssignmentPolicy.h | 8 ++++---- TAO/tao/PortableServer/IdUniquenessPolicy.h | 8 ++++---- TAO/tao/PortableServer/LifespanStrategyPersistent.h | 2 +- TAO/tao/PortableServer/LifespanStrategyTransient.h | 2 +- TAO/tao/PortableServer/Operation_Table_Linear_Search.h | 2 +- TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h | 4 ++-- TAO/tao/PortableServer/ServantRetentionStrategyRetain.h | 2 +- TAO/tao/RTPortableServer/RT_POA.h | 2 +- TAO/tao/RTPortableServer/RT_Policy_Validator.h | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/TAO/tao/PortableServer/IdAssignmentPolicy.h b/TAO/tao/PortableServer/IdAssignmentPolicy.h index bef8f68e0b5..e7c4f4c21d0 100644 --- a/TAO/tao/PortableServer/IdAssignmentPolicy.h +++ b/TAO/tao/PortableServer/IdAssignmentPolicy.h @@ -43,13 +43,13 @@ namespace TAO public: IdAssignmentPolicy (::PortableServer::IdAssignmentPolicyValue value); - CORBA::Policy_ptr copy (); + CORBA::Policy_ptr copy () override; - void destroy (); + void destroy () override; - ::PortableServer::IdAssignmentPolicyValue value (); + ::PortableServer::IdAssignmentPolicyValue value () override; - CORBA::PolicyType policy_type (); + CORBA::PolicyType policy_type () override; /// Return the cached policy type for this policy. TAO_Cached_Policy_Type _tao_cached_type () const override; diff --git a/TAO/tao/PortableServer/IdUniquenessPolicy.h b/TAO/tao/PortableServer/IdUniquenessPolicy.h index 3cf26325ac5..8793a19f90b 100644 --- a/TAO/tao/PortableServer/IdUniquenessPolicy.h +++ b/TAO/tao/PortableServer/IdUniquenessPolicy.h @@ -43,13 +43,13 @@ namespace TAO public: IdUniquenessPolicy (::PortableServer::IdUniquenessPolicyValue value); - CORBA::Policy_ptr copy (); + CORBA::Policy_ptr copy () override; - void destroy (); + void destroy () override; - ::PortableServer::IdUniquenessPolicyValue value (); + ::PortableServer::IdUniquenessPolicyValue value () override; - CORBA::PolicyType policy_type (); + CORBA::PolicyType policy_type () override; /// Return the cached policy type for this policy. TAO_Cached_Policy_Type _tao_cached_type () const override; diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistent.h b/TAO/tao/PortableServer/LifespanStrategyPersistent.h index 9b964c2b184..5de7c9cb52c 100644 --- a/TAO/tao/PortableServer/LifespanStrategyPersistent.h +++ b/TAO/tao/PortableServer/LifespanStrategyPersistent.h @@ -44,7 +44,7 @@ namespace TAO CORBA::Boolean is_persistent () const override; - CORBA::ULong key_length () const; + CORBA::ULong key_length () const override; void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at) override; diff --git a/TAO/tao/PortableServer/LifespanStrategyTransient.h b/TAO/tao/PortableServer/LifespanStrategyTransient.h index 5a3c7d988d5..58092432668 100644 --- a/TAO/tao/PortableServer/LifespanStrategyTransient.h +++ b/TAO/tao/PortableServer/LifespanStrategyTransient.h @@ -40,7 +40,7 @@ namespace TAO CORBA::Boolean is_persistent () const override; - CORBA::ULong key_length () const; + CORBA::ULong key_length () const override; void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at) override; diff --git a/TAO/tao/PortableServer/Operation_Table_Linear_Search.h b/TAO/tao/PortableServer/Operation_Table_Linear_Search.h index 75dd2dc7f53..c69ab4a5542 100644 --- a/TAO/tao/PortableServer/Operation_Table_Linear_Search.h +++ b/TAO/tao/PortableServer/Operation_Table_Linear_Search.h @@ -47,7 +47,7 @@ public: const unsigned int length = 0) override; int bind (const char *opname, - const TAO::Operation_Skeletons skelptr); + const TAO::Operation_Skeletons skelptr) override; private: // = Method that should defined by the subclasses. GPERF program diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h index 3365ec714fd..0e778aeb49d 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h @@ -39,7 +39,7 @@ namespace TAO void strategy_cleanup() override; - CORBA::ULong waiting_servant_deactivation () const; + CORBA::ULong waiting_servant_deactivation () const override; PortableServer::ObjectId * activate_object (PortableServer::Servant servant, @@ -68,7 +68,7 @@ namespace TAO CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &id, - bool indirect); + bool indirect) override; TAO_Servant_Location servant_present ( const PortableServer::ObjectId &system_id, diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h index 22eefd38cd1..98d0c1db5db 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h @@ -120,7 +120,7 @@ namespace TAO int unbind_using_user_id ( const PortableServer::ObjectId &user_id) override; - TAO_Active_Object_Map * get_active_object_map() const; + TAO_Active_Object_Map * get_active_object_map() const override; private: std::unique_ptr active_object_map_; diff --git a/TAO/tao/RTPortableServer/RT_POA.h b/TAO/tao/RTPortableServer/RT_POA.h index aedc17d469c..206c1518a42 100644 --- a/TAO/tao/RTPortableServer/RT_POA.h +++ b/TAO/tao/RTPortableServer/RT_POA.h @@ -185,7 +185,7 @@ public: ~TAO_RT_POA () override = default; - void *thread_pool () const; + void *thread_pool () const override; protected: /// Template method for creating new POA's of this type. diff --git a/TAO/tao/RTPortableServer/RT_Policy_Validator.h b/TAO/tao/RTPortableServer/RT_Policy_Validator.h index 2fcf68be954..afab3f0f46e 100644 --- a/TAO/tao/RTPortableServer/RT_Policy_Validator.h +++ b/TAO/tao/RTPortableServer/RT_Policy_Validator.h @@ -60,10 +60,10 @@ protected: * are consistent and legal. Throw an appropriate exception * if that is not the case. */ - void validate_impl (TAO_Policy_Set &policies); + void validate_impl (TAO_Policy_Set &policies) override; /// Add/merge policies. - void merge_policies_impl (TAO_Policy_Set &policies); + void merge_policies_impl (TAO_Policy_Set &policies) override; /** * Return whether the specified policy type is legal for the -- cgit v1.2.1 From 80ef4188441e6a0b786e48659af9e39ecd4b9735 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 16:38:30 +0100 Subject: Use default destructor * TAO/tao/Argument.cpp: * TAO/tao/Argument.h: * TAO/tao/Base_Transport_Property.cpp: * TAO/tao/Base_Transport_Property.h: --- TAO/tao/Argument.cpp | 4 ---- TAO/tao/Argument.h | 2 +- TAO/tao/Base_Transport_Property.cpp | 4 ---- TAO/tao/Base_Transport_Property.h | 2 +- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/TAO/tao/Argument.cpp b/TAO/tao/Argument.cpp index fab7b1d7514..dee22fca0f7 100644 --- a/TAO/tao/Argument.cpp +++ b/TAO/tao/Argument.cpp @@ -3,10 +3,6 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -TAO::Argument::~Argument () -{ -} - CORBA::Boolean TAO::Argument::marshal (TAO_OutputCDR &) { diff --git a/TAO/tao/Argument.h b/TAO/tao/Argument.h index 39740bb5230..cc2e35bb0de 100644 --- a/TAO/tao/Argument.h +++ b/TAO/tao/Argument.h @@ -50,7 +50,7 @@ namespace TAO { public: /// Destructor. - virtual ~Argument (); + virtual ~Argument () = default; /// Marshal the argument into the given CDR output stream. /** diff --git a/TAO/tao/Base_Transport_Property.cpp b/TAO/tao/Base_Transport_Property.cpp index 17a83e1a618..dd0eccfab29 100644 --- a/TAO/tao/Base_Transport_Property.cpp +++ b/TAO/tao/Base_Transport_Property.cpp @@ -7,10 +7,6 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -TAO_Base_Transport_Property::~TAO_Base_Transport_Property () -{ -} - TAO_Transport_Descriptor_Interface * TAO_Base_Transport_Property::duplicate () { diff --git a/TAO/tao/Base_Transport_Property.h b/TAO/tao/Base_Transport_Property.h index 54836a0817a..7f6a33180ae 100644 --- a/TAO/tao/Base_Transport_Property.h +++ b/TAO/tao/Base_Transport_Property.h @@ -43,7 +43,7 @@ public: CORBA::Boolean flag = false); /// Destructor - virtual ~TAO_Base_Transport_Property (); + virtual ~TAO_Base_Transport_Property () = default; /// The copy constructor. TAO_Base_Transport_Property (const TAO_Base_Transport_Property &rhs); -- cgit v1.2.1 From d2b7bf891f0b11840b5528b89cac105daef04f33 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 16:51:14 +0100 Subject: Revert default * TAO/tao/Argument.cpp: * TAO/tao/Argument.h: --- TAO/tao/Argument.cpp | 4 ++++ TAO/tao/Argument.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/TAO/tao/Argument.cpp b/TAO/tao/Argument.cpp index dee22fca0f7..fab7b1d7514 100644 --- a/TAO/tao/Argument.cpp +++ b/TAO/tao/Argument.cpp @@ -3,6 +3,10 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL +TAO::Argument::~Argument () +{ +} + CORBA::Boolean TAO::Argument::marshal (TAO_OutputCDR &) { diff --git a/TAO/tao/Argument.h b/TAO/tao/Argument.h index cc2e35bb0de..39740bb5230 100644 --- a/TAO/tao/Argument.h +++ b/TAO/tao/Argument.h @@ -50,7 +50,7 @@ namespace TAO { public: /// Destructor. - virtual ~Argument () = default; + virtual ~Argument (); /// Marshal the argument into the given CDR output stream. /** -- cgit v1.2.1 From 94392eaddf51af04621f46337b392c688171434f Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 16:51:27 +0100 Subject: Use constexpr * TAO/tao/CSD_Framework/CSD_FW_Server_Request_Wrapper.cpp: * TAO/tao/Codeset/UTF16_BOM_Translator.cpp: * TAO/tao/GIOP_Message_Generator_Parser_12.cpp: --- TAO/tao/CSD_Framework/CSD_FW_Server_Request_Wrapper.cpp | 2 +- TAO/tao/Codeset/UTF16_BOM_Translator.cpp | 9 ++++----- TAO/tao/GIOP_Message_Generator_Parser_12.cpp | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/TAO/tao/CSD_Framework/CSD_FW_Server_Request_Wrapper.cpp b/TAO/tao/CSD_Framework/CSD_FW_Server_Request_Wrapper.cpp index 6dfda150d7e..30d76194aa1 100644 --- a/TAO/tao/CSD_Framework/CSD_FW_Server_Request_Wrapper.cpp +++ b/TAO/tao/CSD_Framework/CSD_FW_Server_Request_Wrapper.cpp @@ -338,7 +338,7 @@ TAO::CSD::FW_Server_Request_Wrapper::clone (TAO_Operation_Details const *& from, } else { - static const size_t mb_size = 2048; + static constexpr size_t mb_size = 2048; ACE_NEW_RETURN (cdr, TAO_InputCDR (mb_size), false); diff --git a/TAO/tao/Codeset/UTF16_BOM_Translator.cpp b/TAO/tao/Codeset/UTF16_BOM_Translator.cpp index 4f47a615460..4df509712c8 100644 --- a/TAO/tao/Codeset/UTF16_BOM_Translator.cpp +++ b/TAO/tao/Codeset/UTF16_BOM_Translator.cpp @@ -19,11 +19,10 @@ // **************************************************************** typedef ACE_CDR::UShort ACE_UTF16_T; -static const size_t ACE_UTF16_CODEPOINT_SIZE = sizeof (ACE_UTF16_T); -static const ACE_CDR::ULong ACE_UL_UTF16_CODEPOINT_SIZE = - static_cast(ACE_UTF16_CODEPOINT_SIZE); -static const unsigned short ACE_UNICODE_BOM_CORRECT = 0xFEFFU; -static const unsigned short ACE_UNICODE_BOM_SWAPPED = 0xFFFEU; +static constexpr size_t ACE_UTF16_CODEPOINT_SIZE = sizeof (ACE_UTF16_T); +static constexpr ACE_CDR::ULong ACE_UL_UTF16_CODEPOINT_SIZE = static_cast(ACE_UTF16_CODEPOINT_SIZE); +static constexpr unsigned short ACE_UNICODE_BOM_CORRECT = 0xFEFFU; +static constexpr unsigned short ACE_UNICODE_BOM_SWAPPED = 0xFFFEU; TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/GIOP_Message_Generator_Parser_12.cpp b/TAO/tao/GIOP_Message_Generator_Parser_12.cpp index 7cbadbbc658..0dfc12ae0f4 100644 --- a/TAO/tao/GIOP_Message_Generator_Parser_12.cpp +++ b/TAO/tao/GIOP_Message_Generator_Parser_12.cpp @@ -16,7 +16,7 @@ // This is used by GIOP1.2. This is to align the message body on a // 8-octet boundary. This is declared static so that it is in file // scope. -static const size_t TAO_GIOP_MESSAGE_ALIGN_PTR = 8; +static constexpr size_t TAO_GIOP_MESSAGE_ALIGN_PTR = 8; TAO_BEGIN_VERSIONED_NAMESPACE_DECL -- cgit v1.2.1 From 90371aba592ff8153762036e2b0d5bd723af4a7d Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 17:04:25 +0100 Subject: Generate some parts as constexpr * ACE/apps/gperf/src/Key_List.cpp: --- ACE/apps/gperf/src/Key_List.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ACE/apps/gperf/src/Key_List.cpp b/ACE/apps/gperf/src/Key_List.cpp index 1d02a425acb..edfc738a947 100644 --- a/ACE/apps/gperf/src/Key_List.cpp +++ b/ACE/apps/gperf/src/Key_List.cpp @@ -501,7 +501,6 @@ Key_List::reorder () // Outputs the maximum and minimum hash values. Since the list is // already sorted by hash value all we need to do is find the final // item! - void Key_List::output_min_max () { @@ -817,7 +816,7 @@ Key_List::output_keyword_table () int pointer_and_type_enabled = option[POINTER] && option[TYPE]; ACE_OS::printf ("%sstatic %s%swordlist[] =\n%s%s{\n", indent, - option[CONSTANT] || pointer_and_type_enabled == 0 ? "const " : "", + option[CONSTANT] || pointer_and_type_enabled == 0 ? "constexpr " : "", struct_tag, indent, indent); @@ -1145,7 +1144,7 @@ Key_List::output_hash_function () // Generate the asso_values table. ACE_OS::printf (" static %sunsigned %s asso_values[] =\n {", - option[CONSTANT] ? "const " : "", + option[CONSTANT] ? "constexpr " : "", max_hash_value < ((int) UCHAR_MAX) ? "char" : (max_hash_value < ((int) USHRT_MAX) ? "short" : "int")); #if ACE_STANDARD_CHARACTER_SET_SIZE == ACE_EBCDIC_SIZE @@ -1443,7 +1442,7 @@ Key_List::output_lookup_array () const char *indent = option[GLOBAL] ? "" : " "; - ACE_OS::printf ("%sstatic %ssigned %s lookup[] =\n%s%s{\n%s", indent, option[CONSTANT] ? "const " : "", + ACE_OS::printf ("%sstatic %ssigned %s lookup[] =\n%s%s{\n%s", indent, option[CONSTANT] ? "constexpr " : "", max <= SCHAR_MAX ? "char" : (max <= SHRT_MAX ? "short" : "int"), indent, indent, option[DEBUGGING] ? "" : " "); -- cgit v1.2.1 From 5df6c5248e1c1be3aeaefa10ff9eb9be593ec2fd Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 17:04:40 +0100 Subject: Reduced usage of static as we do in generated code * TAO/tao/PortableServer/Servant_Base.cpp: --- TAO/tao/PortableServer/Servant_Base.cpp | 110 ++++++++------------------------ 1 file changed, 27 insertions(+), 83 deletions(-) diff --git a/TAO/tao/PortableServer/Servant_Base.cpp b/TAO/tao/PortableServer/Servant_Base.cpp index 54d5cff2d9d..8809dfd031a 100644 --- a/TAO/tao/PortableServer/Servant_Base.cpp +++ b/TAO/tao/PortableServer/Servant_Base.cpp @@ -72,7 +72,7 @@ TAO_ServantBase::TAO_ServantBase (const TAO_ServantBase &rhs) TAO_ServantBase & TAO_ServantBase::operator= (const TAO_ServantBase &rhs) { - if (this != &rhs) + if (this != std::addressof(rhs)) { this->optable_ = rhs.optable_; } @@ -97,11 +97,6 @@ TAO_ServantBase::_is_a_skel (TAO_ServerRequest & server_request, TAO::Portable_Server::Servant_Upcall* TAO_INTERCEPTOR(servant_upcall), TAO_ServantBase *servant) { -#if TAO_HAS_INTERCEPTORS == 1 - static ::CORBA::TypeCode_ptr const * const exceptions = 0; - static ::CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval; TAO::SArg_Traits< char *>::in_arg_val _tao_repository_id; @@ -111,8 +106,6 @@ TAO_ServantBase::_is_a_skel (TAO_ServerRequest & server_request, &_tao_repository_id }; - static size_t const nargs = 2; - _is_a_Upcall_Command command ( servant, args); @@ -120,12 +113,12 @@ TAO_ServantBase::_is_a_skel (TAO_ServerRequest & server_request, TAO::Upcall_Wrapper upcall_wrapper; upcall_wrapper.upcall (server_request , args - , nargs + , 2 , command #if TAO_HAS_INTERCEPTORS == 1 , servant_upcall - , exceptions - , nexceptions + , nullptr + , 0 #endif /* TAO_HAS_INTERCEPTORS == 1 */ ); } @@ -135,11 +128,6 @@ TAO_ServantBase::_is_a_thru_poa_skel (TAO_ServerRequest & server_request, TAO::Portable_Server::Servant_Upcall* TAO_INTERCEPTOR (servant_upcall), TAO_ServantBase *servant) { -#if TAO_HAS_INTERCEPTORS == 1 - static ::CORBA::TypeCode_ptr const * const exceptions = 0; - static ::CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval; TAO::SArg_Traits< char *>::in_arg_val _tao_repository_id; @@ -149,8 +137,6 @@ TAO_ServantBase::_is_a_thru_poa_skel (TAO_ServerRequest & server_request, &_tao_repository_id }; - static size_t const nargs = 2; - _is_a_thru_poa_Upcall_Command command ( servant, server_request.operation_details (), @@ -159,12 +145,12 @@ TAO_ServantBase::_is_a_thru_poa_skel (TAO_ServerRequest & server_request, TAO::Upcall_Wrapper upcall_wrapper; upcall_wrapper.upcall (server_request , args - , nargs + , 2 , command #if TAO_HAS_INTERCEPTORS == 1 , servant_upcall - , exceptions - , nexceptions + , nullptr + , 0 #endif /* TAO_HAS_INTERCEPTORS == 1 */ ); } @@ -176,11 +162,6 @@ TAO_ServantBase::_non_existent_skel (TAO_ServerRequest & server_request, TAO::Portable_Server::Servant_Upcall* TAO_INTERCEPTOR (servant_upcall), TAO_ServantBase *servant) { -#if TAO_HAS_INTERCEPTORS == 1 - static ::CORBA::TypeCode_ptr const * const exceptions = 0; - static ::CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval; TAO::Argument * const args[] = @@ -188,8 +169,6 @@ TAO_ServantBase::_non_existent_skel (TAO_ServerRequest & server_request, &retval }; - static size_t const nargs = 1; - _non_existent_Upcall_Command command ( servant, args); @@ -197,12 +176,12 @@ TAO_ServantBase::_non_existent_skel (TAO_ServerRequest & server_request, TAO::Upcall_Wrapper upcall_wrapper; upcall_wrapper.upcall (server_request , args - , nargs + , 1 , command #if TAO_HAS_INTERCEPTORS == 1 , servant_upcall - , exceptions - , nexceptions + , nullptr + , 0 #endif /* TAO_HAS_INTERCEPTORS == 1 */ ); } @@ -211,11 +190,6 @@ void TAO_ServantBase::_non_existent_thru_poa_skel (TAO_ServerRequest & server_re TAO::Portable_Server::Servant_Upcall* TAO_INTERCEPTOR (servant_upcall), TAO_ServantBase *servant) { -#if TAO_HAS_INTERCEPTORS == 1 - static ::CORBA::TypeCode_ptr const * const exceptions = 0; - static ::CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval; TAO::Argument * const args[] = @@ -223,8 +197,6 @@ void TAO_ServantBase::_non_existent_thru_poa_skel (TAO_ServerRequest & server_re &retval }; - static size_t const nargs = 1; - _non_existent_thru_poa_Upcall_Command command ( servant, server_request.operation_details (), @@ -233,12 +205,12 @@ void TAO_ServantBase::_non_existent_thru_poa_skel (TAO_ServerRequest & server_re TAO::Upcall_Wrapper upcall_wrapper; upcall_wrapper.upcall (server_request , args - , nargs + , 1 , command #if TAO_HAS_INTERCEPTORS == 1 , servant_upcall - , exceptions - , nexceptions + , nullptr + , 0 #endif /* TAO_HAS_INTERCEPTORS == 1 */ ); } @@ -279,11 +251,6 @@ TAO_ServantBase::_component_skel (TAO_ServerRequest & server_request, TAO::Portable_Server::Servant_Upcall* TAO_INTERCEPTOR (servant_upcall), TAO_ServantBase *servant) { -#if TAO_HAS_INTERCEPTORS == 1 - static ::CORBA::TypeCode_ptr const * const exceptions = 0; - static ::CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - TAO::SArg_Traits< ::CORBA::Object>::ret_val retval; TAO::Argument * const args[] = @@ -291,8 +258,6 @@ TAO_ServantBase::_component_skel (TAO_ServerRequest & server_request, &retval }; - static size_t const nargs = 1; - _get_component_Upcall_Command command ( servant, args); @@ -300,12 +265,12 @@ TAO_ServantBase::_component_skel (TAO_ServerRequest & server_request, TAO::Upcall_Wrapper upcall_wrapper; upcall_wrapper.upcall (server_request , args - , nargs + , 1 , command #if TAO_HAS_INTERCEPTORS == 1 , servant_upcall - , exceptions - , nexceptions + , nullptr + , 0 #endif /* TAO_HAS_INTERCEPTORS == 1 */ ); } @@ -315,11 +280,6 @@ TAO_ServantBase::_component_thru_poa_skel (TAO_ServerRequest & server_request, TAO::Portable_Server::Servant_Upcall* TAO_INTERCEPTOR (servant_upcall), TAO_ServantBase *servant) { -#if TAO_HAS_INTERCEPTORS == 1 - static ::CORBA::TypeCode_ptr const * const exceptions = 0; - static ::CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - TAO::SArg_Traits< ::CORBA::Object>::ret_val retval; TAO::Argument * const args[] = @@ -327,8 +287,6 @@ TAO_ServantBase::_component_thru_poa_skel (TAO_ServerRequest & server_request, &retval }; - static size_t const nargs = 1; - _get_component_thru_poa_Upcall_Command command ( servant, server_request.operation_details (), @@ -337,12 +295,12 @@ TAO_ServantBase::_component_thru_poa_skel (TAO_ServerRequest & server_request, TAO::Upcall_Wrapper upcall_wrapper; upcall_wrapper.upcall (server_request , args - , nargs + , 1 , command #if TAO_HAS_INTERCEPTORS == 1 , servant_upcall - , exceptions - , nexceptions + , nullptr + , 0 #endif /* TAO_HAS_INTERCEPTORS == 1 */ ); } @@ -355,11 +313,6 @@ TAO_ServantBase::_repository_id_skel (TAO_ServerRequest & server_request, TAO::Portable_Server::Servant_Upcall* TAO_INTERCEPTOR (servant_upcall), TAO_ServantBase *servant) { -#if TAO_HAS_INTERCEPTORS == 1 - static ::CORBA::TypeCode_ptr const * const exceptions = 0; - static ::CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - TAO::SArg_Traits< char *>::ret_val retval; TAO::Argument * const args[] = @@ -367,8 +320,6 @@ TAO_ServantBase::_repository_id_skel (TAO_ServerRequest & server_request, &retval }; - static size_t const nargs = 1; - _repository_id_Upcall_Command command ( servant, args); @@ -376,12 +327,12 @@ TAO_ServantBase::_repository_id_skel (TAO_ServerRequest & server_request, TAO::Upcall_Wrapper upcall_wrapper; upcall_wrapper.upcall (server_request , args - , nargs + , 1 , command #if TAO_HAS_INTERCEPTORS == 1 , servant_upcall - , exceptions - , nexceptions + , nullptr + , 0 #endif /* TAO_HAS_INTERCEPTORS == 1 */ ); } @@ -391,11 +342,6 @@ TAO_ServantBase::_repository_id_thru_poa_skel (TAO_ServerRequest & server_reques TAO::Portable_Server::Servant_Upcall* TAO_INTERCEPTOR (servant_upcall), TAO_ServantBase *servant) { -#if TAO_HAS_INTERCEPTORS == 1 - static ::CORBA::TypeCode_ptr const * const exceptions = 0; - static ::CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - TAO::SArg_Traits< char *>::ret_val retval; TAO::Argument * const args[] = @@ -403,8 +349,6 @@ TAO_ServantBase::_repository_id_thru_poa_skel (TAO_ServerRequest & server_reques &retval }; - static size_t const nargs = 1; - _repository_id_thru_poa_Upcall_Command command ( servant, server_request.operation_details (), @@ -413,12 +357,12 @@ TAO_ServantBase::_repository_id_thru_poa_skel (TAO_ServerRequest & server_reques TAO::Upcall_Wrapper upcall_wrapper; upcall_wrapper.upcall (server_request , args - , nargs + , 1 , command #if TAO_HAS_INTERCEPTORS == 1 , servant_upcall - , exceptions - , nexceptions + , nullptr + , 0 #endif /* TAO_HAS_INTERCEPTORS == 1 */ ); } @@ -494,13 +438,13 @@ TAO_ServantBase::_find (const char *opname, TAO_Stub * TAO_ServantBase::_create_stub () { - TAO_Stub *stub = 0; + TAO_Stub *stub = nullptr; TAO::Portable_Server::POA_Current_Impl *poa_current_impl = static_cast (TAO_TSS_Resources::instance ()->poa_current_impl_); - CORBA::ORB_ptr servant_orb = 0; + CORBA::ORB_ptr servant_orb = nullptr; if (poa_current_impl != 0 && this == poa_current_impl->servant ()) -- cgit v1.2.1 From d19030946af88f57a4b2b29af9228cbbf0386a71 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 18:08:58 +0100 Subject: Revert one constexpr change * ACE/apps/gperf/src/Key_List.cpp: --- ACE/apps/gperf/src/Key_List.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACE/apps/gperf/src/Key_List.cpp b/ACE/apps/gperf/src/Key_List.cpp index edfc738a947..cdb6ee90851 100644 --- a/ACE/apps/gperf/src/Key_List.cpp +++ b/ACE/apps/gperf/src/Key_List.cpp @@ -816,7 +816,7 @@ Key_List::output_keyword_table () int pointer_and_type_enabled = option[POINTER] && option[TYPE]; ACE_OS::printf ("%sstatic %s%swordlist[] =\n%s%s{\n", indent, - option[CONSTANT] || pointer_and_type_enabled == 0 ? "constexpr " : "", + option[CONSTANT] || pointer_and_type_enabled == 0 ? "const " : "", struct_tag, indent, indent); -- cgit v1.2.1