diff options
author | Angelo Corsaro <angelo@icorsaro.net> | 2001-06-21 18:21:12 +0000 |
---|---|---|
committer | Angelo Corsaro <angelo@icorsaro.net> | 2001-06-21 18:21:12 +0000 |
commit | 77c98b4897cdfbaa9d34f6f7663c6e09cf8f6303 (patch) | |
tree | 6fc041f937f150e6567c1c7dbe38b5b032b995cc | |
parent | 6f454336e82292218beda3cc6bbc692b958d6458 (diff) | |
download | ATCD-77c98b4897cdfbaa9d34f6f7663c6e09cf8f6303.tar.gz |
ChangeLogTag: Wed Jun 21 13:00:31 2001 Angelo Corsaro <corsaro@cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 12 | ||||
-rw-r--r-- | TAO/tao/PortableServer/POA.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/PortableServer/POA.h | 10 | ||||
-rw-r--r-- | TAO/tao/PortableServer/PortableServerC.h | 4 |
4 files changed, 31 insertions, 3 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 52591c61e27..b6a173a5d74 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,15 @@ +Wed Jun 21 13:00:31 2001 Angelo Corsaro <corsaro@cs.wustl.edu> + + * tao/PortableServer/POA.cpp: + * tao/PortableServer/PAO.h: + * tao/PortableServer/PortableServerC.h: + + Set inheritance from PortableServer::POA in class TAO_POA to be virtual. + + Added new method (_tao_poa_downcast) to safely downcast instances of + PortableServer::POA to TAO_POA. This method has to be used instead + of ACE_dynamic_cast for downcasting the POA. + Thu Jun 21 12:57:34 2001 Paul Calabrese <calabrese_p@ociweb.com> * docs/ec_options.html: diff --git a/TAO/tao/PortableServer/POA.cpp b/TAO/tao/PortableServer/POA.cpp index d86db5627ed..8604f49107b 100644 --- a/TAO/tao/PortableServer/POA.cpp +++ b/TAO/tao/PortableServer/POA.cpp @@ -40,6 +40,12 @@ TAO_POA::objectkey_prefix [TAO_POA::TAO_OBJECTKEY_PREFIX_SIZE] = { 000 }; +TAO_POA* +TAO_POA::_tao_poa_downcast(void) +{ + return this; +} + #if (TAO_HAS_MINIMUM_POA == 0) PortableServer::ThreadPolicy_ptr @@ -680,7 +686,7 @@ TAO_POA::destroy_i (CORBA::Boolean etherealize_objects, this->server_object_->_default_POA (ACE_TRY_ENV); ACE_CHECK; - tao_poa = ACE_dynamic_cast (TAO_POA *, poa.in ()); + tao_poa = poa->_tao_poa_downcast(); PortableServer::ObjectId_var id = tao_poa->servant_to_id_i (this->server_object_, ACE_TRY_ENV); ACE_CHECK; diff --git a/TAO/tao/PortableServer/POA.h b/TAO/tao/PortableServer/POA.h index 9fb46cb4b59..9f25c5073c6 100644 --- a/TAO/tao/PortableServer/POA.h +++ b/TAO/tao/PortableServer/POA.h @@ -127,8 +127,8 @@ protected: class ServerObject_i; class TAO_PortableServer_Export TAO_POA : - public PortableServer::POA , - public TAO_Local_RefCounted_Object + public virtual PortableServer::POA , + public virtual TAO_Local_RefCounted_Object { public: @@ -139,6 +139,12 @@ public: friend class TAO_POA_Manager; typedef ACE_CString String; + + /** + * This method is used to downcast safely an instance of PortableServer::POA + * to an instance of TAO_POA when RTTI is not enabled. + */ + virtual TAO_POA* _tao_poa_downcast (void); PortableServer::POA_ptr create_POA (const char *adapter_name, PortableServer::POAManager_ptr poa_manager, diff --git a/TAO/tao/PortableServer/PortableServerC.h b/TAO/tao/PortableServer/PortableServerC.h index d670f353bc7..ad14f533806 100644 --- a/TAO/tao/PortableServer/PortableServerC.h +++ b/TAO/tao/PortableServer/PortableServerC.h @@ -63,6 +63,7 @@ class TAO_ServantBase_var; class TAO_RefCountServantBase; class TAO_Local_ServantBase; class TAO_DynamicImplementation; +class TAO_POA; TAO_NAMESPACE PortableServer { @@ -2253,6 +2254,7 @@ class TAO_PortableServer_Export ServantLocator: public virtual ServantManager #if !defined (_PORTABLESERVER_POA_CH_) #define _PORTABLESERVER_POA_CH_ + class TAO_PortableServer_Export POA : public virtual CORBA_Object { public: @@ -2278,6 +2280,7 @@ class TAO_PortableServer_Export POA : public virtual CORBA_Object return (POA_ptr)0; } + virtual TAO_POA* _tao_poa_downcast(void) {return 0;} #if !defined (_PORTABLESERVER_POA_ADAPTERALREADYEXISTS_CH_) #define _PORTABLESERVER_POA_ADAPTERALREADYEXISTS_CH_ @@ -2309,6 +2312,7 @@ class TAO_PortableServer_Export POA : public virtual CORBA_Object CORBA::Environment & ); + static AdapterAlreadyExists *_downcast (CORBA::Exception *); |