From 678ff11e8a31e9c1f22e7ff53b92d627965b2277 Mon Sep 17 00:00:00 2001 From: coryan Date: Thu, 24 Jun 1999 17:37:41 +0000 Subject: ChangeLogTag:Thu Jun 24 12:20:36 1999 Carlos O'Ryan --- TAO/ChangeLog-99c | 16 ++++++++ TAO/orbsvcs/Event_Service/Event_Service.cpp | 8 ++-- TAO/tao/IORC.cpp | 12 +++--- TAO/tao/MessagingS_T.cpp | 60 ++++++++++++++--------------- TAO/tao/PolicyC.cpp | 30 +++++++-------- TAO/tao/PollableC.cpp | 24 ++++++------ TAO/tao/Sequence_T.cpp | 8 ++-- TAO/tao/Typecode.cpp | 60 ++++++++--------------------- TAO/tao/varout.cpp | 6 +-- 9 files changed, 104 insertions(+), 120 deletions(-) diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c index 635ce669eb4..f40e578b01e 100644 --- a/TAO/ChangeLog-99c +++ b/TAO/ChangeLog-99c @@ -1,3 +1,19 @@ +Thu Jun 24 12:20:36 1999 Carlos O'Ryan + + * orbsvcs/Event_Service/Event_Service.cpp: + Use the new Event Service by default. + Activate the POA before doing anything else, thanks to Byron + Harris for figuring this out. + + * tao/IORC.cpp: + * tao/MessagingS_T.cpp: + * tao/PolicyC.cpp: + * tao/PollableC.cpp: + * tao/Sequence_T.cpp: + * tao/Typecode.cpp: + * tao/varout.cpp: + Fixed several exception handling problems. + Thu Jun 24 10:12:56 1999 Carlos O'Ryan * orbsvcs/orbsvcs/IR_Helper.cpp: diff --git a/TAO/orbsvcs/Event_Service/Event_Service.cpp b/TAO/orbsvcs/Event_Service/Event_Service.cpp index 1c6c3a6b62d..0d07dfb60a5 100644 --- a/TAO/orbsvcs/Event_Service/Event_Service.cpp +++ b/TAO/orbsvcs/Event_Service/Event_Service.cpp @@ -33,7 +33,7 @@ Event_Service::Event_Service (void) service_name_ (0), ior_file_name_ (0), pid_file_name_ (0), - event_service_type_ (ES_OLD_MT), + event_service_type_ (ES_NEW), global_scheduler_ (0) { } @@ -76,6 +76,9 @@ Event_Service::run (int argc, char* argv[]) root_poa->the_POAManager (ACE_TRY_ENV); ACE_TRY_CHECK; + poa_manager->activate (ACE_TRY_ENV); + ACE_TRY_CHECK; + CORBA::Object_var naming_obj = this->orb_->resolve_initial_references ("NameService"); if (CORBA::is_nil (naming_obj.in ())) @@ -191,9 +194,6 @@ Event_Service::run (int argc, char* argv[]) naming_context->rebind (channel_name, ec.in (), ACE_TRY_ENV); ACE_TRY_CHECK; - poa_manager->activate (ACE_TRY_ENV); - ACE_TRY_CHECK; - ACE_DEBUG ((LM_DEBUG, "%s; running event service\n", __FILE__)); if (this->orb_->run () == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "run"), 1); diff --git a/TAO/tao/IORC.cpp b/TAO/tao/IORC.cpp index 3f9ed79f135..396703dde59 100644 --- a/TAO/tao/IORC.cpp +++ b/TAO/tao/IORC.cpp @@ -22,14 +22,14 @@ ACE_RCSID(tao, IORC, "$Id$") TAO_IOP::TAO_IOR_Manipulation_ptr TAO_IOP::TAO_IOR_Manipulation::_narrow ( CORBA::Object_ptr obj, - CORBA::Environment &env + CORBA::Environment &ACE_TRY_ENV ) { if (CORBA::is_nil (obj)) return TAO_IOP::TAO_IOR_Manipulation::_nil (); - if (!obj->_is_a ("IDL:omg.org/TAO_IOP/TAO_IOR_Manipulation:1.0", env)) + if (!obj->_is_a ("IDL:omg.org/TAO_IOP/TAO_IOR_Manipulation:1.0", ACE_TRY_ENV)) return TAO_IOP::TAO_IOR_Manipulation::_nil (); - return TAO_IOP::TAO_IOR_Manipulation::_unchecked_narrow (obj, env); + return TAO_IOP::TAO_IOR_Manipulation::_unchecked_narrow (obj, ACE_TRY_ENV); } TAO_IOP::TAO_IOR_Manipulation_ptr TAO_IOP::TAO_IOR_Manipulation::_unchecked_narrow ( @@ -788,14 +788,14 @@ CORBA::ULong TAO_IOP::TAO_IOR_Manipulation::get_profile_count ( return _tao_retval; } -CORBA::Boolean TAO_IOP::TAO_IOR_Manipulation::_is_a (const CORBA::Char *value, CORBA::Environment &env) +CORBA::Boolean TAO_IOP::TAO_IOR_Manipulation::_is_a (const CORBA::Char *value, CORBA::Environment &ACE_TRY_ENV) { if ( (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/TAO_IOP/TAO_IOR_Manipulation:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env)))) + (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Object:1.0"))) return 1; // success using local knowledge else - return this->CORBA_Object::_is_a (value, env); + return this->CORBA_Object::_is_a (value, ACE_TRY_ENV); } const char* TAO_IOP::TAO_IOR_Manipulation::_interface_repository_id (void) const diff --git a/TAO/tao/MessagingS_T.cpp b/TAO/tao/MessagingS_T.cpp index db15d875142..0ae3a1f8db0 100644 --- a/TAO/tao/MessagingS_T.cpp +++ b/TAO/tao/MessagingS_T.cpp @@ -24,140 +24,140 @@ #endif /* !defined INLINE */ template PortableServer::POA_ptr -POA_Messaging::RebindPolicy_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::RebindPolicy_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->RebindPolicy::_default_POA (env); + return this->RebindPolicy::_default_POA (ACE_TRY_ENV); } template PortableServer::POA_ptr -POA_Messaging::SyncScopePolicy_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::SyncScopePolicy_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->SyncScopePolicy::_default_POA (env); + return this->SyncScopePolicy::_default_POA (ACE_TRY_ENV); } template PortableServer::POA_ptr -POA_Messaging::RequestPriorityPolicy_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::RequestPriorityPolicy_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->RequestPriorityPolicy::_default_POA (env); + return this->RequestPriorityPolicy::_default_POA (ACE_TRY_ENV); } template PortableServer::POA_ptr -POA_Messaging::ReplyPriorityPolicy_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::ReplyPriorityPolicy_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->ReplyPriorityPolicy::_default_POA (env); + return this->ReplyPriorityPolicy::_default_POA (ACE_TRY_ENV); } template PortableServer::POA_ptr -POA_Messaging::RequestStartTimePolicy_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::RequestStartTimePolicy_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->RequestStartTimePolicy::_default_POA (env); + return this->RequestStartTimePolicy::_default_POA (ACE_TRY_ENV); } template PortableServer::POA_ptr -POA_Messaging::RequestEndTimePolicy_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::RequestEndTimePolicy_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->RequestEndTimePolicy::_default_POA (env); + return this->RequestEndTimePolicy::_default_POA (ACE_TRY_ENV); } template PortableServer::POA_ptr -POA_Messaging::ReplyStartTimePolicy_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::ReplyStartTimePolicy_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->ReplyStartTimePolicy::_default_POA (env); + return this->ReplyStartTimePolicy::_default_POA (ACE_TRY_ENV); } template PortableServer::POA_ptr -POA_Messaging::ReplyEndTimePolicy_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::ReplyEndTimePolicy_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->ReplyEndTimePolicy::_default_POA (env); + return this->ReplyEndTimePolicy::_default_POA (ACE_TRY_ENV); } template PortableServer::POA_ptr -POA_Messaging::RelativeRequestTimeoutPolicy_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::RelativeRequestTimeoutPolicy_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->RelativeRequestTimeoutPolicy::_default_POA (env); + return this->RelativeRequestTimeoutPolicy::_default_POA (ACE_TRY_ENV); } template PortableServer::POA_ptr -POA_Messaging::RelativeRoundtripTimeoutPolicy_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::RelativeRoundtripTimeoutPolicy_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->RelativeRoundtripTimeoutPolicy::_default_POA (env); + return this->RelativeRoundtripTimeoutPolicy::_default_POA (ACE_TRY_ENV); } template PortableServer::POA_ptr -POA_Messaging::RoutingPolicy_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::RoutingPolicy_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->RoutingPolicy::_default_POA (env); + return this->RoutingPolicy::_default_POA (ACE_TRY_ENV); } template PortableServer::POA_ptr -POA_Messaging::MaxHopsPolicy_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::MaxHopsPolicy_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->MaxHopsPolicy::_default_POA (env); + return this->MaxHopsPolicy::_default_POA (ACE_TRY_ENV); } template PortableServer::POA_ptr -POA_Messaging::QueueOrderPolicy_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::QueueOrderPolicy_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->QueueOrderPolicy::_default_POA (env); + return this->QueueOrderPolicy::_default_POA (ACE_TRY_ENV); } #if defined (TAO_POLLER) template PortableServer::POA_ptr -POA_Messaging::ReplyHandler_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::ReplyHandler_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->ReplyHandler::_default_POA (env); + return this->ReplyHandler::_default_POA (ACE_TRY_ENV); } template PortableServer::POA_ptr -POA_Messaging::Poller_tie::_default_POA (CORBA::Environment &env) +POA_Messaging::Poller_tie::_default_POA (CORBA::Environment &ACE_TRY_ENV) { if (!CORBA::is_nil (this->poa_.in ())) return PortableServer::POA::_duplicate (this->poa_.in ()); - return this->Poller::_default_POA (env); + return this->Poller::_default_POA (ACE_TRY_ENV); } #endif /* TAO_POLLER */ diff --git a/TAO/tao/PolicyC.cpp b/TAO/tao/PolicyC.cpp index 836f5417911..bf769e7f3cd 100644 --- a/TAO/tao/PolicyC.cpp +++ b/TAO/tao/PolicyC.cpp @@ -166,12 +166,12 @@ CORBA_InvalidPolicies::CORBA_InvalidPolicies( CORBA_Policy_ptr CORBA_Policy::_narrow ( CORBA::Object_ptr obj, - CORBA::Environment &env + CORBA::Environment &ACE_TRY_ENV ) { if (CORBA::is_nil (obj)) return CORBA_Policy::_nil (); - if (!obj->_is_a ("IDL:omg.org/CORBA/Policy:1.0", env)) + if (!obj->_is_a ("IDL:omg.org/CORBA/Policy:1.0", ACE_TRY_ENV)) return CORBA_Policy::_nil (); TAO_Stub* stub = obj->_stubobj (); stub->_incr_refcnt (); @@ -354,14 +354,14 @@ void CORBA_Policy::destroy ( } #endif /* !TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ -CORBA::Boolean CORBA_Policy::_is_a (const CORBA::Char *value, CORBA::Environment &env) +CORBA::Boolean CORBA_Policy::_is_a (const CORBA::Char *value, CORBA::Environment &ACE_TRY_ENV) { if ( (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Policy:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env)))) + (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Object:1.0"))) return 1; // success using local knowledge else - return this->CORBA_Object::_is_a (value, env); // remote call + return this->CORBA_Object::_is_a (value, ACE_TRY_ENV); // remote call } const char* CORBA_Policy::_interface_repository_id (void) const @@ -424,12 +424,12 @@ CORBA_PolicyTypeSeq::~CORBA_PolicyTypeSeq (void) CORBA::PolicyManager_ptr CORBA_PolicyManager::_narrow ( CORBA::Object_ptr obj, - CORBA::Environment &env + CORBA::Environment &ACE_TRY_ENV ) { if (CORBA::is_nil (obj)) return CORBA_PolicyManager::_nil (); - if (!obj->_is_a ("IDL:omg.org/CORBA/PolicyManager:1.0", env)) + if (!obj->_is_a ("IDL:omg.org/CORBA/PolicyManager:1.0", ACE_TRY_ENV)) return CORBA_PolicyManager::_nil (); TAO_Stub* stub = obj->_stubobj (); stub->_incr_refcnt (); @@ -487,14 +487,14 @@ void CORBA_PolicyManager::set_policy_overrides ( ACE_THROW (CORBA::MARSHAL ()); } -CORBA::Boolean CORBA_PolicyManager::_is_a (const CORBA::Char *value, CORBA::Environment &env) +CORBA::Boolean CORBA_PolicyManager::_is_a (const CORBA::Char *value, CORBA::Environment &ACE_TRY_ENV) { if ( (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/PolicyManager:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env)))) + (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Object:1.0"))) return 1; // success using local knowledge else - return this->CORBA_Object::_is_a (value, env); // remote call + return this->CORBA_Object::_is_a (value, ACE_TRY_ENV); // remote call } const char* CORBA_PolicyManager::_interface_repository_id (void) const @@ -507,12 +507,12 @@ const char* CORBA_PolicyManager::_interface_repository_id (void) const CORBA_PolicyCurrent_ptr CORBA_PolicyCurrent::_narrow ( CORBA::Object_ptr obj, - CORBA::Environment &env + CORBA::Environment &ACE_TRY_ENV ) { if (CORBA::is_nil (obj)) return CORBA_PolicyCurrent::_nil (); - if (!obj->_is_a ("IDL:omg.org/CORBA/PolicyCurrent:1.0", env)) + if (!obj->_is_a ("IDL:omg.org/CORBA/PolicyCurrent:1.0", ACE_TRY_ENV)) return CORBA_PolicyCurrent::_nil (); TAO_Stub* stub = obj->_stubobj (); stub->_incr_refcnt (); @@ -547,16 +547,16 @@ CORBA_PolicyCurrent_ptr CORBA_PolicyCurrent::_unchecked_narrow ( ); } -CORBA::Boolean CORBA_PolicyCurrent::_is_a (const CORBA::Char *value, CORBA::Environment &env) +CORBA::Boolean CORBA_PolicyCurrent::_is_a (const CORBA::Char *value, CORBA::Environment &ACE_TRY_ENV) { if ( (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/PolicyCurrent:1.0")) || (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/PolicyManager:1.0")) || (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Current:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env)))) + (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Object:1.0"))) return 1; // success using local knowledge else - return this->CORBA_Object::_is_a (value, env); // remote call + return this->CORBA_Object::_is_a (value, ACE_TRY_ENV); // remote call } const char* CORBA_PolicyCurrent::_interface_repository_id (void) const diff --git a/TAO/tao/PollableC.cpp b/TAO/tao/PollableC.cpp index feaef39ab1f..2e934e5b702 100644 --- a/TAO/tao/PollableC.cpp +++ b/TAO/tao/PollableC.cpp @@ -36,7 +36,7 @@ CORBA_Pollable_ptr CORBA_Pollable::_narrow ( { if (CORBA::is_nil (obj)) return CORBA_Pollable::_nil (); - if (!obj->_is_a ("IDL:omg.org/CORBA/Pollable:1.0", env)) + if (!obj->_is_a ("IDL:omg.org/CORBA/Pollable:1.0", ACE_TRY_ENV)) return CORBA_Pollable::_nil (); TAO_Stub* stub = obj->_stubobj (); stub->_incr_refcnt (); @@ -174,14 +174,14 @@ CORBA_PollableSet_ptr CORBA_Pollable::create_pollable_set ( return _tao_retval; } -CORBA::Boolean CORBA_Pollable::_is_a (const CORBA::Char *value, CORBA::Environment &env) +CORBA::Boolean CORBA_Pollable::_is_a (const CORBA::Char *value, CORBA::Environment &ACE_TRY_ENV) { if ( (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Pollable:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env)))) + (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Object:1.0"))) return 1; // success using local knowledge else - return this->CORBA_Object::_is_a (value, env); // remote call + return this->CORBA_Object::_is_a (value, ACE_TRY_ENV); // remote call } const char* CORBA_Pollable::_interface_repository_id (void) const @@ -196,7 +196,7 @@ CORBA::DIIPollable_ptr CORBA::DIIPollable::_narrow ( { if (CORBA::is_nil (obj)) return CORBA::DIIPollable::_nil (); - if (!obj->_is_a ("IDL:omg.org/CORBA/DIIPollable:1.0", env)) + if (!obj->_is_a ("IDL:omg.org/CORBA/DIIPollable:1.0", ACE_TRY_ENV)) return CORBA::DIIPollable::_nil (); TAO_Stub* stub = obj->_stubobj (); stub->_incr_refcnt (); @@ -231,15 +231,15 @@ CORBA::DIIPollable_ptr CORBA::DIIPollable::_unchecked_narrow ( ); } -CORBA::Boolean CORBA::DIIPollable::_is_a (const CORBA::Char *value, CORBA::Environment &env) +CORBA::Boolean CORBA::DIIPollable::_is_a (const CORBA::Char *value, CORBA::Environment &ACE_TRY_ENV) { if ( (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/DIIPollable:1.0")) || (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Pollable:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env)))) + (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Object:1.0"))) return 1; // success using local knowledge else - return this->CORBA_Object::_is_a (value, env); // remote call + return this->CORBA_Object::_is_a (value, ACE_TRY_ENV); // remote call } const char* CORBA::DIIPollable::_interface_repository_id (void) const @@ -254,7 +254,7 @@ CORBA_PollableSet_ptr CORBA_PollableSet::_narrow ( { if (CORBA::is_nil (obj)) return CORBA_PollableSet::_nil (); - if (!obj->_is_a ("IDL:omg.org/CORBA/PollableSet:1.0", env)) + if (!obj->_is_a ("IDL:omg.org/CORBA/PollableSet:1.0", ACE_TRY_ENV)) return CORBA_PollableSet::_nil (); TAO_Stub* stub = obj->_stubobj (); stub->_incr_refcnt (); @@ -664,14 +664,14 @@ CORBA::UShort CORBA_PollableSet::number_left ( return _tao_retval; } -CORBA::Boolean CORBA_PollableSet::_is_a (const CORBA::Char *value, CORBA::Environment &env) +CORBA::Boolean CORBA_PollableSet::_is_a (const CORBA::Char *value, CORBA::Environment &ACE_TRY_ENV) { if ( (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/PollableSet:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env)))) + (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Object:1.0"))) return 1; // success using local knowledge else - return this->CORBA_Object::_is_a (value, env); // remote call + return this->CORBA_Object::_is_a (value, ACE_TRY_ENV); // remote call } const char* CORBA_PollableSet::_interface_repository_id (void) const diff --git a/TAO/tao/Sequence_T.cpp b/TAO/tao/Sequence_T.cpp index fc628f5381f..23e5ff3df87 100644 --- a/TAO/tao/Sequence_T.cpp +++ b/TAO/tao/Sequence_T.cpp @@ -409,11 +409,11 @@ TAO_Unbounded_Object_Sequence::_shrink_buffer (CORBA::ULong nl, template void TAO_Unbounded_Object_Sequence::_downcast (void* target, CORBA_Object* src, - CORBA_Environment &env) + CORBA_Environment &ACE_TRY_ENV) { T **tmp = ACE_static_cast (T**, target); - *tmp = T::_narrow (src, env); + *tmp = T::_narrow (src, ACE_TRY_ENV); } template CORBA_Object* @@ -545,11 +545,11 @@ TAO_Bounded_Object_Sequence::_shrink_buffer (CORBA::ULong nl, template void TAO_Bounded_Object_Sequence::_downcast (void* target, CORBA_Object* src, - CORBA_Environment &env) + CORBA_Environment &ACE_TRY_ENV) { T **tmp = ACE_static_cast (T**, target); - *tmp = T::_narrow (src, env); + *tmp = T::_narrow (src, ACE_TRY_ENV); } template CORBA_Object* diff --git a/TAO/tao/Typecode.cpp b/TAO/tao/Typecode.cpp index 35d569dbd74..072f02f0c3b 100644 --- a/TAO/tao/Typecode.cpp +++ b/TAO/tao/Typecode.cpp @@ -747,7 +747,6 @@ CORBA::Boolean CORBA_TypeCode::private_equal_objref (CORBA::TypeCode_ptr tc, CORBA::Environment &ACE_TRY_ENV) const { - // ACE_TRY_ENV.clear (); // compare the repoID and name, of which the name is optional as per GIOP // spec. However, the repoID is mandatory. const char *my_id = this->id (ACE_TRY_ENV); @@ -783,8 +782,6 @@ CORBA::Boolean CORBA_TypeCode::private_equal_struct (CORBA::TypeCode_ptr tc, CORBA::Environment &ACE_TRY_ENV) const { - // ACE_TRY_ENV.clear (); - // for structs the repoID and names are optional. However, if provided, we // must compare them const char *my_id = this->id (ACE_TRY_ENV); @@ -857,8 +854,6 @@ CORBA::Boolean CORBA_TypeCode::private_equal_union (CORBA::TypeCode_ptr tc, CORBA::Environment &ACE_TRY_ENV) const { - // ACE_TRY_ENV.clear (); - // For unions the repoID and names are optional. However, if // provided, we must compare them. const char *my_id = this->id (ACE_TRY_ENV); @@ -954,8 +949,6 @@ CORBA::Boolean CORBA_TypeCode::private_equal_enum (CORBA::TypeCode_ptr tc, CORBA::Environment &ACE_TRY_ENV) const { - // ACE_TRY_ENV.clear (); - // for enum the repoID and names are optional. However, if provided, we // must compare them const char *my_id = this->id (ACE_TRY_ENV); @@ -1076,8 +1069,6 @@ CORBA::Boolean CORBA_TypeCode::private_equal_alias (CORBA::TypeCode_ptr tc, CORBA::Environment &ACE_TRY_ENV) const { - // ACE_TRY_ENV.clear (); - // for structs the repoID and names are optional. However, if provided, we // must compare them const char *my_id = this->id (ACE_TRY_ENV); @@ -1117,7 +1108,6 @@ CORBA_TypeCode::private_equal_except (CORBA::TypeCode_ptr tc, CORBA::Environment &ACE_TRY_ENV) const { // exactly similar to structs, except that the repository ID is mandatory - // ACE_TRY_ENV.clear (); const char *my_id = this->id (ACE_TRY_ENV); ACE_CHECK_RETURN (0); @@ -1189,8 +1179,6 @@ CORBA_TypeCode::private_equal_except (CORBA::TypeCode_ptr tc, const char * CORBA_TypeCode::private_id (CORBA::Environment &ACE_TRY_ENV) const { - // ACE_TRY_ENV.clear (); - switch (this->kind_) { // These are all complex typecodes, which have as their first @@ -1229,8 +1217,6 @@ CORBA_TypeCode::private_id (CORBA::Environment &ACE_TRY_ENV) const const char * CORBA_TypeCode::private_name (CORBA::Environment &ACE_TRY_ENV) const { - // ACE_TRY_ENV.clear (); - switch (this->kind_) { // These are all complex typecodes, which have as their second @@ -1284,8 +1270,6 @@ CORBA_TypeCode::private_name (CORBA::Environment &ACE_TRY_ENV) const CORBA::ULong CORBA_TypeCode::private_member_count (CORBA::Environment &ACE_TRY_ENV) const { - // ACE_TRY_ENV.clear (); - switch (kind_) { case CORBA::tk_alias: @@ -1375,8 +1359,6 @@ CORBA_TypeCode::private_member_type (CORBA::ULong slot, case CORBA::tk_except: case CORBA::tk_struct: // index from 0 mcount = this->member_count (ACE_TRY_ENV); - // @@EXC@@ Why are we rethrowing a different exception here? - // if (ACE_TRY_ENV.exception ()) ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), (CORBA::TypeCode_ptr)0); ACE_CHECK_RETURN ((CORBA::TypeCode_ptr)0); { @@ -1387,16 +1369,16 @@ CORBA_TypeCode::private_member_type (CORBA::ULong slot, if (slot < mcount) return this->private_state_->tc_member_type_list_[slot]; else - ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), CORBA::TypeCode::_nil ()); + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), + CORBA::TypeCode::_nil ()); // the first time in. Precompute and store types of all members // Allocate a list to hold the member typecodes - // @@EXC@@ Need to check for allocation failure here. - this->private_state_->tc_member_type_list_ = new CORBA::TypeCode_ptr [mcount]; - - if (this->private_state_->tc_member_type_list_ == 0) - ACE_THROW_RETURN (CORBA::NO_MEMORY (), (CORBA::TypeCode_ptr)0); + ACE_NEW_THROW_EX (this->private_state_->tc_member_type_list_, + CORBA::TypeCode_ptr [mcount], + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); // skip the id, name, and member_count part if (!stream.skip_string () // type ID, hidden @@ -1444,9 +1426,7 @@ CORBA_TypeCode::private_member_type (CORBA::ULong slot, ACE_NOTREACHED (break;) case CORBA::tk_union: // index from 0 - mcount = this->member_count (ACE_TRY_ENV); // clears ACE_TRY_ENV - // @@EXC@@ Why are we rethrowing a different exception here? - // if (ACE_TRY_ENV.exception ()) ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), (CORBA::TypeCode_ptr)0); + mcount = this->member_count (ACE_TRY_ENV); ACE_CHECK_RETURN ((CORBA::TypeCode_ptr)0); { @@ -1459,11 +1439,11 @@ CORBA_TypeCode::private_member_type (CORBA::ULong slot, else ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), CORBA::TypeCode::_nil ()); - // the first time in. Precompute and store types of all members - // @@EXC@@ Need to check allocation failure. - this->private_state_->tc_member_type_list_ = new CORBA::TypeCode_ptr [mcount]; - if (this->private_state_->tc_member_type_list_ == 0) - ACE_THROW_RETURN (CORBA::NO_MEMORY (), (CORBA::TypeCode_ptr)0); + // the first time in. Precompute and store types of all members + ACE_NEW_THROW_EX (this->private_state_->tc_member_type_list_, + CORBA::TypeCode_ptr [mcount], + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); // skip the id, name, and discrimant type part if (!stream.skip_string () // type ID, hidden @@ -1539,9 +1519,8 @@ CORBA_TypeCode::private_member_name (CORBA::ULong slot, switch (kind_) { case CORBA::tk_enum: - mcount = this->member_count (ACE_TRY_ENV); // clears ACE_TRY_ENV + mcount = this->member_count (ACE_TRY_ENV); // out of bounds - // if (ACE_TRY_ENV.exception ()) ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), (char *)0); ACE_CHECK_RETURN ((char *)0); { @@ -1586,9 +1565,8 @@ CORBA_TypeCode::private_member_name (CORBA::ULong slot, case CORBA::tk_except: case CORBA::tk_struct: // index from 0 - mcount = this->member_count (ACE_TRY_ENV); // clears ACE_TRY_ENV + mcount = this->member_count (ACE_TRY_ENV); // out of bounds - // if (ACE_TRY_ENV.exception ()) ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), (char *)0); ACE_CHECK_RETURN ((char *)0); { @@ -1632,9 +1610,8 @@ CORBA_TypeCode::private_member_name (CORBA::ULong slot, ACE_NOTREACHED (break;) case CORBA::tk_union: // index from 0 - mcount = this->member_count (ACE_TRY_ENV); // clears ACE_TRY_ENV + mcount = this->member_count (ACE_TRY_ENV); // out of bounds - // if (ACE_TRY_ENV.exception ()) ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), (char *)0); ACE_CHECK_RETURN ((char *)0); { @@ -1799,7 +1776,6 @@ CORBA_TypeCode::private_member_label (CORBA::ULong n, if (retval != CORBA::TypeCode::TRAVERSE_CONTINUE) return 0; - // @@EXC@@ Need to check memory allocation failure. ACE_NEW_THROW_EX (label_list[i], CORBA::Any (tc, 0, out.begin ()), CORBA::NO_MEMORY ()); @@ -2036,8 +2012,6 @@ CORBA_TypeCode::private_discrim_pad_size (CORBA::Environment &ACE_TRY_ENV) CORBA::ULong CORBA_TypeCode::param_count (CORBA::Environment &ACE_TRY_ENV) const { - // ACE_TRY_ENV.clear (); - switch (this->kind_) { default: @@ -2126,8 +2100,6 @@ CORBA::TypeCode::private_size (CORBA::Environment &ACE_TRY_ENV) if (kind_ >= CORBA::TC_KIND_COUNT) ACE_THROW_RETURN (CORBA::BAD_TYPECODE (), 0); - // ACE_TRY_ENV.clear (); - // Double checked locking... ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, this->private_state_->mutex_, 0); @@ -2159,8 +2131,6 @@ CORBA::TypeCode::private_size (CORBA::Environment &ACE_TRY_ENV) size_t CORBA::TypeCode::private_alignment (CORBA::Environment &ACE_TRY_ENV) { - // ACE_TRY_ENV.clear (); - if (kind_ >= CORBA::TC_KIND_COUNT) ACE_THROW_RETURN (CORBA::BAD_TYPECODE (), 0); diff --git a/TAO/tao/varout.cpp b/TAO/tao/varout.cpp index 30a5e36aac4..87c644a975f 100644 --- a/TAO/tao/varout.cpp +++ b/TAO/tao/varout.cpp @@ -31,13 +31,11 @@ ACE_RCSID(tao, varout, "$Id$") template void TAO_Object_Field_T::_downcast (CORBA_Object* base_ptr, - CORBA_Environment &env) + CORBA_Environment &ACE_TRY_ENV) { CORBA::release (this->ptr_); this->ptr_ = 0; - this->ptr_ = T::_narrow (base_ptr, env); - if (env.exception () != 0) - return; + this->ptr_ = T::_narrow (base_ptr, ACE_TRY_ENV); } template CORBA_Object* -- cgit v1.2.1