diff options
Diffstat (limited to 'TAO/tao/POAC.cpp')
-rw-r--r-- | TAO/tao/POAC.cpp | 576 |
1 files changed, 129 insertions, 447 deletions
diff --git a/TAO/tao/POAC.cpp b/TAO/tao/POAC.cpp index 9efdc84207d..277ac7d3f6f 100644 --- a/TAO/tao/POAC.cpp +++ b/TAO/tao/POAC.cpp @@ -120,20 +120,12 @@ PortableServer::ForwardRequest::_narrow (CORBA::Exception *exc) // = TAO extension CORBA::Exception *PortableServer::ForwardRequest::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::ForwardRequest, - 0); - - return retval; + return new PortableServer::ForwardRequest; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::ForwardRequest &_tao_elem) // copying { - PortableServer::ForwardRequest *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::ForwardRequest (_tao_elem)); + PortableServer::ForwardRequest *_tao_any_val = new PortableServer::ForwardRequest (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -291,42 +283,22 @@ PortableServer::ThreadPolicy_ptr PortableServer::ThreadPolicy::_narrow ( ACE_CHECK_RETURN (PortableServer::ThreadPolicy::_nil ()); if (check) return PortableServer::ThreadPolicy::_nil (); - void* servant = 0; TAO_Stub* stub = obj->_stubobj (); + stub->_incr_refcnt (); + void* servant = 0; if (obj->_is_collocated () && obj->_servant() != 0) servant = obj->_servant()->_downcast ("IDL:omg.org/PortableServer/ThreadPolicy:1.0"); #if defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) - if (servant == 0) + else ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::ThreadPolicy::_nil ()); #else - stub->_incr_refcnt (); if (servant == 0) - { - PortableServer::ThreadPolicy_ptr rval = - PortableServer::ThreadPolicy::_nil (); - - ACE_NEW_RETURN (rval, - PortableServer::ThreadPolicy (stub), - PortableServer::ThreadPolicy::_nil ()); - - return rval; - } + return new PortableServer::ThreadPolicy(stub); #endif /* TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ - - PortableServer::ThreadPolicy_ptr retval = - PortableServer::ThreadPolicy::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_ThreadPolicy ( - ACE_reinterpret_cast (POA_PortableServer::ThreadPolicy_ptr, - servant), - stub - ), - PortableServer::ThreadPolicy::_nil () + return new POA_PortableServer::_tao_collocated_ThreadPolicy( + ACE_reinterpret_cast(POA_PortableServer::ThreadPolicy_ptr, servant), + stub ); - - return retval; } #if !defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) @@ -449,41 +421,21 @@ PortableServer::LifespanPolicy_ptr PortableServer::LifespanPolicy::_narrow ( if (check) return PortableServer::LifespanPolicy::_nil (); TAO_Stub* stub = obj->_stubobj (); + stub->_incr_refcnt (); void* servant = 0; if (obj->_is_collocated () && obj->_servant() != 0) servant = obj->_servant()->_downcast ("IDL:omg.org/PortableServer/LifespanPolicy:1.0"); #if defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) - if (servant == 0) + else ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::LifespanPolicy::_nil ()); #else - stub->_incr_refcnt (); if (servant == 0) - { - PortableServer::LifespanPolicy_ptr rval = - PortableServer::LifespanPolicy::_nil (); - - ACE_NEW_RETURN (rval, - PortableServer::LifespanPolicy (stub), - PortableServer::LifespanPolicy::_nil ()); - - return rval; - } + return new PortableServer::LifespanPolicy(stub); #endif /* TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ - - PortableServer::LifespanPolicy_ptr retval = - PortableServer::LifespanPolicy::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_LifespanPolicy ( - ACE_reinterpret_cast (POA_PortableServer::LifespanPolicy_ptr, - servant), - stub - ), - PortableServer::LifespanPolicy::_nil () + return new POA_PortableServer::_tao_collocated_LifespanPolicy( + ACE_reinterpret_cast(POA_PortableServer::LifespanPolicy_ptr, servant), + stub ); - - return retval; } #if !defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) @@ -606,41 +558,21 @@ PortableServer::IdUniquenessPolicy_ptr PortableServer::IdUniquenessPolicy::_narr if (check) return PortableServer::IdUniquenessPolicy::_nil (); TAO_Stub* stub = obj->_stubobj (); + stub->_incr_refcnt (); void* servant = 0; if (obj->_is_collocated () && obj->_servant() != 0) servant = obj->_servant()->_downcast ("IDL:omg.org/PortableServer/IdUniquenessPolicy:1.0"); #if defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) - if (servant == 0) + else ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::IdUniquenessPolicy::_nil ()); #else - stub->_incr_refcnt (); if (servant == 0) - { - PortableServer::IdUniquenessPolicy_ptr rval = - PortableServer::IdUniquenessPolicy::_nil (); - - ACE_NEW_RETURN (rval, - PortableServer::IdUniquenessPolicy (stub), - PortableServer::IdUniquenessPolicy::_nil ()); - - return rval; - } + return new PortableServer::IdUniquenessPolicy(stub); #endif /* TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ - - PortableServer::IdUniquenessPolicy_ptr retval = - PortableServer::IdUniquenessPolicy::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_IdUniquenessPolicy ( - ACE_reinterpret_cast (POA_PortableServer::IdUniquenessPolicy_ptr, - servant), - stub - ), - PortableServer::IdUniquenessPolicy::_nil () + return new POA_PortableServer::_tao_collocated_IdUniquenessPolicy( + ACE_reinterpret_cast(POA_PortableServer::IdUniquenessPolicy_ptr, servant), + stub ); - - return retval; } #if !defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) @@ -762,41 +694,21 @@ PortableServer::IdAssignmentPolicy_ptr PortableServer::IdAssignmentPolicy::_narr if (check) return PortableServer::IdAssignmentPolicy::_nil (); TAO_Stub* stub = obj->_stubobj (); + stub->_incr_refcnt (); void* servant = 0; if (obj->_is_collocated () && obj->_servant() != 0) servant = obj->_servant()->_downcast ("IDL:omg.org/PortableServer/IdAssignmentPolicy:1.0"); #if defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) - if (servant == 0) + else ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::IdAssignmentPolicy::_nil ()); #else - stub->_incr_refcnt (); if (servant == 0) - { - PortableServer::IdAssignmentPolicy_ptr rval = - PortableServer::IdAssignmentPolicy::_nil (); - - ACE_NEW_RETURN (rval, - PortableServer::IdAssignmentPolicy (stub), - PortableServer::IdAssignmentPolicy::_nil ()); - - return rval; - } + return new PortableServer::IdAssignmentPolicy(stub); #endif /* TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ - - PortableServer::IdAssignmentPolicy_ptr retval = - PortableServer::IdAssignmentPolicy::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_IdAssignmentPolicy ( - ACE_reinterpret_cast (POA_PortableServer::IdAssignmentPolicy_ptr, - servant), - stub - ), - PortableServer::IdAssignmentPolicy::_nil () + return new POA_PortableServer::_tao_collocated_IdAssignmentPolicy( + ACE_reinterpret_cast(POA_PortableServer::IdAssignmentPolicy_ptr, servant), + stub ); - - return retval; } #if !defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) @@ -921,41 +833,21 @@ PortableServer::ImplicitActivationPolicy_ptr PortableServer::ImplicitActivationP if (check) return PortableServer::ImplicitActivationPolicy::_nil (); TAO_Stub* stub = obj->_stubobj (); + stub->_incr_refcnt (); void* servant = 0; if (obj->_is_collocated () && obj->_servant() != 0) servant = obj->_servant()->_downcast ("IDL:omg.org/PortableServer/ImplicitActivationPolicy:1.0"); #if defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) - if (servant == 0) + else ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::ImplicitActivationPolicy::_nil ()); #else - stub->_incr_refcnt (); if (servant == 0) - { - PortableServer::ImplicitActivationPolicy_ptr rval = - PortableServer::ImplicitActivationPolicy::_nil (); - - ACE_NEW_RETURN (rval, - PortableServer::ImplicitActivationPolicy (stub), - PortableServer::ImplicitActivationPolicy::_nil ()); - - return rval; - } + return new PortableServer::ImplicitActivationPolicy(stub); #endif /* TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ - - PortableServer::ImplicitActivationPolicy_ptr retval = - PortableServer::ImplicitActivationPolicy::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_ImplicitActivationPolicy ( - ACE_reinterpret_cast (POA_PortableServer::ImplicitActivationPolicy_ptr, - servant), - stub - ), - PortableServer::ImplicitActivationPolicy::_nil () + return new POA_PortableServer::_tao_collocated_ImplicitActivationPolicy( + ACE_reinterpret_cast(POA_PortableServer::ImplicitActivationPolicy_ptr, servant), + stub ); - - return retval; } #if !defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) @@ -1078,41 +970,21 @@ PortableServer::ServantRetentionPolicy_ptr PortableServer::ServantRetentionPolic if (check) return PortableServer::ServantRetentionPolicy::_nil (); TAO_Stub* stub = obj->_stubobj (); + stub->_incr_refcnt (); void* servant = 0; if (obj->_is_collocated () && obj->_servant() != 0) servant = obj->_servant()->_downcast ("IDL:omg.org/PortableServer/ServantRetentionPolicy:1.0"); #if defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) - if (servant == 0) + else ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::ServantRetentionPolicy::_nil ()); #else - stub->_incr_refcnt (); if (servant == 0) - { - PortableServer::ServantRetentionPolicy_ptr rval = - PortableServer::ServantRetentionPolicy::_nil (); - - ACE_NEW_RETURN (rval, - PortableServer::ServantRetentionPolicy (stub), - PortableServer::ServantRetentionPolicy::_nil ()); - - return rval; - } + return new PortableServer::ServantRetentionPolicy(stub); #endif /* TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ - - PortableServer::ServantRetentionPolicy_ptr retval = - PortableServer::ServantRetentionPolicy::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_ServantRetentionPolicy ( - ACE_reinterpret_cast (POA_PortableServer::ServantRetentionPolicy_ptr, - servant), - stub - ), - PortableServer::ServantRetentionPolicy::_nil () + return new POA_PortableServer::_tao_collocated_ServantRetentionPolicy( + ACE_reinterpret_cast(POA_PortableServer::ServantRetentionPolicy_ptr, servant), + stub ); - - return retval; } #if !defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) @@ -1235,41 +1107,21 @@ PortableServer::RequestProcessingPolicy_ptr PortableServer::RequestProcessingPol if (check) return PortableServer::RequestProcessingPolicy::_nil (); TAO_Stub* stub = obj->_stubobj (); + stub->_incr_refcnt (); void* servant = 0; if (obj->_is_collocated () && obj->_servant() != 0) servant = obj->_servant()->_downcast ("IDL:omg.org/PortableServer/RequestProcessingPolicy:1.0"); #if defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) - if (servant == 0) + else ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::RequestProcessingPolicy::_nil ()); #else - stub->_incr_refcnt (); if (servant == 0) - { - PortableServer::RequestProcessingPolicy_ptr rval = - PortableServer::RequestProcessingPolicy::_nil (); - - ACE_NEW_RETURN (rval, - PortableServer::RequestProcessingPolicy (stub), - PortableServer::RequestProcessingPolicy::_nil ()); - - return rval; - } + return new PortableServer::RequestProcessingPolicy(stub); #endif /* TAO_HAS_LOCALITY_CONSTRAINT_POLICIES */ - - PortableServer::RequestProcessingPolicy_ptr retval = - PortableServer::RequestProcessingPolicy::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_RequestProcessingPolicy ( - ACE_reinterpret_cast (POA_PortableServer::RequestProcessingPolicy_ptr, - servant), - stub - ), - PortableServer::RequestProcessingPolicy::_nil () + return new POA_PortableServer::_tao_collocated_RequestProcessingPolicy( + ACE_reinterpret_cast(POA_PortableServer::RequestProcessingPolicy_ptr, servant), + stub ); - - return retval; } #if !defined (TAO_HAS_LOCALITY_CONSTRAINT_POLICIES) @@ -1373,27 +1225,17 @@ PortableServer::POAManager_ptr PortableServer::POAManager::_narrow ( ACE_CHECK_RETURN (PortableServer::POAManager::_nil ()); if (check) return PortableServer::POAManager::_nil (); - void* servant = 0; - if (!obj->_is_collocated () - || !obj->_servant() - || (servant = obj->_servant ()->_downcast ("IDL:omg.org/PortableServer/POAManager:1.0")) == 0) + if (!obj->_is_collocated () || !obj->_servant()) // This can only be colocated ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::POAManager::_nil ()); - PortableServer::POAManager_ptr retval = - PortableServer::POAManager::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_POAManager ( - ACE_reinterpret_cast (POA_PortableServer::POAManager_ptr, - servant), - 0 - ), - PortableServer::POAManager::_nil () - ); - - return retval; + TAO_Stub *stub = obj->_stubobj (); + stub->_incr_refcnt (); + void* servant = obj->_servant ()->_downcast ("IDL:omg.org/PortableServer/POAManager:1.0"); + return new POA_PortableServer::_tao_collocated_POAManager( + ACE_reinterpret_cast(POA_PortableServer::POAManager_ptr, servant), + stub + ); } // default constructor @@ -1439,20 +1281,12 @@ PortableServer::POAManager::AdapterInactive::_narrow (CORBA::Exception *exc) // TAO extension - the _alloc method CORBA::Exception *PortableServer::POAManager::AdapterInactive::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::POAManager::AdapterInactive, - 0); - - return retval; + return new PortableServer::POAManager::AdapterInactive; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::POAManager::AdapterInactive &_tao_elem) // copying { - PortableServer::POAManager::AdapterInactive *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::POAManager::AdapterInactive (_tao_elem)); + PortableServer::POAManager::AdapterInactive *_tao_any_val = new PortableServer::POAManager::AdapterInactive (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -1581,26 +1415,17 @@ PortableServer::AdapterActivator_ptr PortableServer::AdapterActivator::_narrow ( ACE_CHECK_RETURN (PortableServer::AdapterActivator::_nil ()); if (check) return PortableServer::AdapterActivator::_nil (); - void *servant = 0; - if (!obj->_is_collocated () || !obj->_servant() || - (servant = obj->_servant ()->_downcast ("IDL:omg.org/PortableServer/AdapterActivator:1.0")) == 0) + if (!obj->_is_collocated () || !obj->_servant()) // This can only be colocated ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::AdapterActivator::_nil ()); - PortableServer::AdapterActivator_ptr retval = - PortableServer::AdapterActivator::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_AdapterActivator ( - ACE_reinterpret_cast (POA_PortableServer::AdapterActivator_ptr, - servant), - 0 - ), - PortableServer::AdapterActivator::_nil () - ); - - return retval; + TAO_Stub *stub = obj->_stubobj (); + stub->_incr_refcnt (); + void* servant = obj->_servant ()->_downcast ("IDL:omg.org/PortableServer/AdapterActivator:1.0"); + return new POA_PortableServer::_tao_collocated_AdapterActivator( + ACE_reinterpret_cast(POA_PortableServer::AdapterActivator_ptr, servant), + stub + ); } CORBA::Boolean PortableServer::AdapterActivator::_is_a (const CORBA::Char *value, CORBA::Environment &_tao_environment) @@ -1654,26 +1479,17 @@ PortableServer::ServantManager_ptr PortableServer::ServantManager::_narrow ( ACE_CHECK_RETURN (PortableServer::ServantManager::_nil ()); if (check) return PortableServer::ServantManager::_nil (); - void *servant = 0; - if (!obj->_is_collocated () || !obj->_servant() || - (servant = obj->_servant ()->_downcast ("IDL:omg.org/PortableServer/ServantManager:1.0")) == 0) + if (!obj->_is_collocated () || !obj->_servant()) // This can only be colocated ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::ServantManager::_nil ()); - PortableServer::ServantManager_ptr retval = - PortableServer::ServantManager::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_ServantManager ( - ACE_reinterpret_cast (POA_PortableServer::ServantManager_ptr, - servant), - 0 - ), - PortableServer::ServantManager::_nil () - ); - - return retval; + TAO_Stub *stub = obj->_stubobj (); + stub->_incr_refcnt (); + void* servant = obj->_servant ()->_downcast ("IDL:omg.org/PortableServer/ServantManager:1.0"); + return new POA_PortableServer::_tao_collocated_ServantManager( + ACE_reinterpret_cast(POA_PortableServer::ServantManager_ptr, servant), + stub + ); } CORBA::Boolean PortableServer::ServantManager::_is_a (const CORBA::Char *value, CORBA::Environment &_tao_environment) @@ -1727,26 +1543,17 @@ PortableServer::ServantActivator_ptr PortableServer::ServantActivator::_narrow ( ACE_CHECK_RETURN (PortableServer::ServantActivator::_nil ()); if (check) return PortableServer::ServantActivator::_nil (); - void *servant = 0; - if (!obj->_is_collocated () || !obj->_servant() || - (servant = obj->_servant ()->_downcast ("IDL:omg.org/PortableServer/ServantActivator:1.0")) == 0) + if (!obj->_is_collocated () || !obj->_servant()) // This can only be colocated ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::ServantActivator::_nil ()); - PortableServer::ServantActivator_ptr retval = - PortableServer::ServantActivator::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_ServantActivator ( - ACE_reinterpret_cast (POA_PortableServer::ServantActivator_ptr, - servant), - 0 - ), - PortableServer::ServantActivator::_nil () - ); - - return retval; + TAO_Stub *stub = obj->_stubobj (); + stub->_incr_refcnt (); + void* servant = obj->_servant ()->_downcast ("IDL:omg.org/PortableServer/ServantActivator:1.0"); + return new POA_PortableServer::_tao_collocated_ServantActivator( + ACE_reinterpret_cast(POA_PortableServer::ServantActivator_ptr, servant), + stub + ); } CORBA::Boolean PortableServer::ServantActivator::_is_a (const CORBA::Char *value, CORBA::Environment &_tao_environment) @@ -1801,26 +1608,17 @@ PortableServer::ServantLocator_ptr PortableServer::ServantLocator::_narrow ( ACE_CHECK_RETURN (PortableServer::ServantLocator::_nil ()); if (check) return PortableServer::ServantLocator::_nil (); - void *servant = 0; - if (!obj->_is_collocated () || !obj->_servant() || - (servant = obj->_servant ()->_downcast ("IDL:omg.org/PortableServer/ServantLocator:1.0")) == 0) + if (!obj->_is_collocated () || !obj->_servant()) // This can only be colocated ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::ServantLocator::_nil ()); - PortableServer::ServantLocator_ptr retval = - PortableServer::ServantLocator::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_ServantLocator ( - ACE_reinterpret_cast (POA_PortableServer::ServantLocator_ptr, - servant), - 0 - ), - PortableServer::ServantLocator::_nil () - ); - - return retval; + TAO_Stub *stub = obj->_stubobj (); + stub->_incr_refcnt (); + void* servant = obj->_servant ()->_downcast ("IDL:omg.org/PortableServer/ServantLocator:1.0"); + return new POA_PortableServer::_tao_collocated_ServantLocator( + ACE_reinterpret_cast(POA_PortableServer::ServantLocator_ptr, servant), + stub + ); } CORBA::Boolean PortableServer::ServantLocator::_is_a (const CORBA::Char *value, CORBA::Environment &_tao_environment) @@ -1877,26 +1675,17 @@ PortableServer::POA_ptr PortableServer::POA::_narrow ( ACE_CHECK_RETURN (PortableServer::POA::_nil ()); if (check) return PortableServer::POA::_nil (); - void *servant = 0; - if (!obj->_is_collocated () || !obj->_servant() || - (servant = obj->_servant ()->_downcast ("IDL:omg.org/PortableServer/POA:1.0")) == 0) + if (!obj->_is_collocated () || !obj->_servant()) // This can only be colocated ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::POA::_nil ()); - PortableServer::POA_ptr retval = - PortableServer::POA::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_POA ( - ACE_reinterpret_cast (POA_PortableServer::POA_ptr, - servant), - 0 - ), - PortableServer::POA::_nil () - ); - - return retval; + TAO_Stub *stub = obj->_stubobj (); + stub->_incr_refcnt (); + void* servant = obj->_servant ()->_downcast ("IDL:omg.org/PortableServer/POA:1.0"); + return new POA_PortableServer::_tao_collocated_POA( + ACE_reinterpret_cast(POA_PortableServer::POA_ptr, servant), + stub + ); } // default constructor @@ -1942,20 +1731,12 @@ PortableServer::POA::AdapterAlreadyExists::_narrow (CORBA::Exception *exc) // TAO extension - the _alloc method CORBA::Exception *PortableServer::POA::AdapterAlreadyExists::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::POA::AdapterAlreadyExists, - 0); - - return retval; + return new PortableServer::POA::AdapterAlreadyExists; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::POA::AdapterAlreadyExists &_tao_elem) // copying { - PortableServer::POA::AdapterAlreadyExists *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::POA::AdapterAlreadyExists (_tao_elem)); + PortableServer::POA::AdapterAlreadyExists *_tao_any_val = new PortableServer::POA::AdapterAlreadyExists (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -2076,20 +1857,12 @@ PortableServer::POA::AdapterInactive::_narrow (CORBA::Exception *exc) // TAO extension - the _alloc method CORBA::Exception *PortableServer::POA::AdapterInactive::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::POA::AdapterInactive, - 0); - - return retval; + return new PortableServer::POA::AdapterInactive; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::POA::AdapterInactive &_tao_elem) // copying { - PortableServer::POA::AdapterInactive *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::POA::AdapterInactive (_tao_elem)); + PortableServer::POA::AdapterInactive *_tao_any_val = new PortableServer::POA::AdapterInactive (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -2210,20 +1983,12 @@ PortableServer::POA::AdapterNonExistent::_narrow (CORBA::Exception *exc) // TAO extension - the _alloc method CORBA::Exception *PortableServer::POA::AdapterNonExistent::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::POA::AdapterNonExistent, - 0); - - return retval; + return new PortableServer::POA::AdapterNonExistent; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::POA::AdapterNonExistent &_tao_elem) // copying { - PortableServer::POA::AdapterNonExistent *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::POA::AdapterNonExistent (_tao_elem));; + PortableServer::POA::AdapterNonExistent *_tao_any_val = new PortableServer::POA::AdapterNonExistent (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -2351,20 +2116,12 @@ PortableServer::POA::InvalidPolicy::_narrow (CORBA::Exception *exc) // TAO extension - the _alloc method CORBA::Exception *PortableServer::POA::InvalidPolicy::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::POA::InvalidPolicy, - 0); - - return retval; + return new PortableServer::POA::InvalidPolicy; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::POA::InvalidPolicy &_tao_elem) // copying { - PortableServer::POA::InvalidPolicy *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::POA::InvalidPolicy (_tao_elem)); + PortableServer::POA::InvalidPolicy *_tao_any_val = new PortableServer::POA::InvalidPolicy (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -2488,20 +2245,12 @@ PortableServer::POA::NoServant::_narrow (CORBA::Exception *exc) // TAO extension - the _alloc method CORBA::Exception *PortableServer::POA::NoServant::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::POA::NoServant, - 0); - - return retval; + return new PortableServer::POA::NoServant; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::POA::NoServant &_tao_elem) // copying { - PortableServer::POA::NoServant *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::POA::NoServant (_tao_elem)); + PortableServer::POA::NoServant *_tao_any_val = new PortableServer::POA::NoServant (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -2624,20 +2373,12 @@ PortableServer::POA::ObjectAlreadyActive::_narrow (CORBA::Exception *exc) // TAO extension - the _alloc method CORBA::Exception *PortableServer::POA::ObjectAlreadyActive::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::POA::ObjectAlreadyActive, - 0); - - return retval; + return new PortableServer::POA::ObjectAlreadyActive; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::POA::ObjectAlreadyActive &_tao_elem) // copying { - PortableServer::POA::ObjectAlreadyActive *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::POA::ObjectAlreadyActive (_tao_elem)); + PortableServer::POA::ObjectAlreadyActive *_tao_any_val = new PortableServer::POA::ObjectAlreadyActive (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -2756,20 +2497,12 @@ PortableServer::POA::ObjectNotActive::_narrow (CORBA::Exception *exc) // TAO extension - the _alloc method CORBA::Exception *PortableServer::POA::ObjectNotActive::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::POA::ObjectNotActive, - 0); - - return retval; + return new PortableServer::POA::ObjectNotActive; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::POA::ObjectNotActive &_tao_elem) // copying { - PortableServer::POA::ObjectNotActive *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::POA::ObjectNotActive (_tao_elem)); + PortableServer::POA::ObjectNotActive *_tao_any_val = new PortableServer::POA::ObjectNotActive (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -2888,20 +2621,12 @@ PortableServer::POA::ServantAlreadyActive::_narrow (CORBA::Exception *exc) // TAO extension - the _alloc method CORBA::Exception *PortableServer::POA::ServantAlreadyActive::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::POA::ServantAlreadyActive, - 0); - - return retval; + return new PortableServer::POA::ServantAlreadyActive; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::POA::ServantAlreadyActive &_tao_elem) // copying { - PortableServer::POA::ServantAlreadyActive *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::POA::ServantAlreadyActive (_tao_elem)); + PortableServer::POA::ServantAlreadyActive *_tao_any_val = new PortableServer::POA::ServantAlreadyActive (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -3020,20 +2745,12 @@ PortableServer::POA::ServantNotActive::_narrow (CORBA::Exception *exc) // TAO extension - the _alloc method CORBA::Exception *PortableServer::POA::ServantNotActive::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::POA::ServantNotActive, - 0); - - return retval; + return new PortableServer::POA::ServantNotActive; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::POA::ServantNotActive &_tao_elem) // copying { - PortableServer::POA::ServantNotActive *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::POA::ServantNotActive (_tao_elem)); + PortableServer::POA::ServantNotActive *_tao_any_val = new PortableServer::POA::ServantNotActive (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -3152,20 +2869,12 @@ PortableServer::POA::WrongAdapter::_narrow (CORBA::Exception *exc) // TAO extension - the _alloc method CORBA::Exception *PortableServer::POA::WrongAdapter::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::POA::WrongAdapter, - 0); - - return retval; + return new PortableServer::POA::WrongAdapter; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::POA::WrongAdapter &_tao_elem) // copying { - PortableServer::POA::WrongAdapter *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::POA::WrongAdapter (_tao_elem)); + PortableServer::POA::WrongAdapter *_tao_any_val = new PortableServer::POA::WrongAdapter (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -3284,20 +2993,12 @@ PortableServer::POA::WrongPolicy::_narrow (CORBA::Exception *exc) // TAO extension - the _alloc method CORBA::Exception *PortableServer::POA::WrongPolicy::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::POA::WrongPolicy, - 0); - - return retval; + return new PortableServer::POA::WrongPolicy; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::POA::WrongPolicy &_tao_elem) // copying { - PortableServer::POA::WrongPolicy *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::POA::WrongPolicy (_tao_elem)); + PortableServer::POA::WrongPolicy *_tao_any_val = new PortableServer::POA::WrongPolicy (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -3424,26 +3125,17 @@ PortableServer::Current_ptr PortableServer::Current::_narrow ( ACE_CHECK_RETURN (PortableServer::Current::_nil ()); if (check) return PortableServer::Current::_nil (); - void *servant = 0; - if (!obj->_is_collocated () || !obj->_servant() || - (servant = obj->_servant ()->_downcast ("IDL:omg.org/PortableServer/Current:1.0")) == 0) - // This can only be colocated - ACE_THROW_RETURN (CORBA::MARSHAL (), PortableServer::Current::_nil ()); - - PortableServer::Current_ptr retval = - PortableServer::Current::_nil (); - - ACE_NEW_RETURN ( - retval, - POA_PortableServer::_tao_collocated_Current ( - ACE_reinterpret_cast (POA_PortableServer::Current_ptr, - servant), - 0 - ), - PortableServer::Current::_nil () + TAO_Stub* stub = obj->_stubobj (); + stub->_incr_refcnt (); + void* servant = 0; + if (obj->_is_collocated () && obj->_servant() != 0) + servant = obj->_servant()->_downcast ("IDL:omg.org/PortableServer/Current:1.0"); + if (servant == 0) + return new PortableServer::Current(stub); + return new POA_PortableServer::_tao_collocated_Current( + ACE_reinterpret_cast(POA_PortableServer::Current_ptr, servant), + stub ); - - return retval; } // default constructor @@ -3489,20 +3181,12 @@ PortableServer::Current::NoContext::_narrow (CORBA::Exception *exc) // TAO extension - the _alloc method CORBA::Exception *PortableServer::Current::NoContext::_alloc (void) { - CORBA::Exception *retval = 0; - - ACE_NEW_RETURN (retval, - PortableServer::Current::NoContext, - 0); - - return retval; + return new PortableServer::Current::NoContext; } void operator<<= (CORBA::Any &_tao_any, const PortableServer::Current::NoContext &_tao_elem) // copying { - PortableServer::Current::NoContext *_tao_any_val = 0; - ACE_NEW (_tao_any_val, - PortableServer::Current::NoContext (_tao_elem)); + PortableServer::Current::NoContext *_tao_any_val = new PortableServer::Current::NoContext (_tao_elem); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -3585,8 +3269,6 @@ PortableServer::POA_ptr PortableServer::Current::get_POA (CORBA::Environment &A PortableServer::ObjectId * PortableServer::Current::get_object_id (CORBA::Environment &ACE_TRY_ENV) { - // @@ This doesn't look right at all. - nw. - static TAO_Exception_Data _tao_PortableServer_Current_get_object_id_exceptiondata [] = { {PortableServer::Current::_tc_NoContext, PortableServer::Current::NoContext::_alloc} |