diff options
98 files changed, 1984 insertions, 1863 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 62a2278d1b1..12460497014 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -360,8 +360,8 @@ Thu Feb 20 09:07:56 2003 Ossama Othman <ossama@uci.edu> * tao/Connection_Handler.h (~TAO_Connection_Handler): * tao/IIOP_Transport.h (~TAO_IIOP_Transport): - Made this destructor to enforce proper memory management through - the reference counting mechanism. + Made this destructor protected to enforce proper memory + management through the reference counting mechanism. * tao/Default_Thread_Lane_Resources_Manager.h: * tao/Dynamic_Adapter.h: diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.cpp index a97c0e3d383..d4582346d99 100644 --- a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.cpp +++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.cpp @@ -81,10 +81,10 @@ TAO_FT_Invocation_Endpoint_Selector::forward (TAO_GIOP_Invocation // get created on a per-call basis. For now we'll play it safe. if (invocation->stub ()->next_profile () == 0) ACE_THROW (CORBA::TRANSIENT ( - CORBA_SystemException::_tao_minor_code ( - TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE, - errno), - CORBA::COMPLETED_NO)); + CORBA::SystemException::_tao_minor_code ( + TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE, + errno), + CORBA::COMPLETED_NO)); } void diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp index 57dfa9cfa59..7ed1582393d 100644 --- a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp +++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp @@ -395,7 +395,7 @@ TAO_FT_Service_Callbacks::raise_comm_failure ( // exception invoke->close_connection (); ACE_THROW_RETURN (CORBA::COMM_FAILURE ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_INVOCATION_RECV_REQUEST_MINOR_CODE, errno), CORBA::COMPLETED_MAYBE), @@ -428,7 +428,7 @@ TAO_FT_Service_Callbacks::raise_transient_failure ( // As the right tags are not found close the connection and throw an // exception ACE_THROW_RETURN (CORBA::TRANSIENT ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_INVOCATION_RECV_REQUEST_MINOR_CODE, errno), CORBA::COMPLETED_MAYBE), diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp index 146b1fb66ca..c61a4969310 100644 --- a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp +++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp @@ -78,7 +78,8 @@ TAO_LB_CPU_Monitor::loads (ACE_ENV_SINGLE_ARG_DECL) // Obtain the number of processors each time a load is computed. // The idea is to take into account the processor failures that can - // on platforms that continue running with the remaining processors. + // occur on platforms that continue running with the remaining + // processors. // // @@ Is this a realistic scenario? Perhaps we should just cache // the number of processors and assume that any processor failure diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.cpp index a4374826e49..3c51e755ee5 100644 --- a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.cpp +++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.cpp @@ -10,7 +10,8 @@ ACE_RCSID (LoadBalancer, #endif /* __ACE_INLINE__ */ TAO_LB_LoadAlert::TAO_LB_LoadAlert (void) - : alerted_ (0) + : alerted_ (0), + lock_ () { } @@ -22,6 +23,8 @@ void TAO_LB_LoadAlert::enable_alert (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { + ACE_GUARD (TAO_SYNCH_MUTEX, monitor, this->lock_); + this->alerted_ = 1; } @@ -29,5 +32,7 @@ void TAO_LB_LoadAlert::disable_alert (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { + ACE_GUARD (TAO_SYNCH_MUTEX, monitor, this->lock_); + this->alerted_ = 0; } diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.h index b7b83230c43..8d71b76e2e7 100644 --- a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.h +++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.h @@ -71,6 +71,9 @@ private: /// by the LoadManager? CORBA::Boolean alerted_; + /// Lock used to synchronized access to the LoadAlert state. + mutable TAO_SYNCH_MUTEX lock_; + }; diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.inl b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.inl index 37cd8d00e4d..0f574a49206 100644 --- a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.inl +++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.inl @@ -6,5 +6,7 @@ ACE_INLINE CORBA::Boolean TAO_LB_LoadAlert::alerted (void) const { + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, monitor, this->lock_, 0); + return this->alerted_; } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Service.h b/TAO/orbsvcs/orbsvcs/Notify/Service.h index af8a28a2fd2..93c2c63b50e 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Service.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Service.h @@ -1,4 +1,4 @@ -/* -*- C++ -*- */ +// -*- C++ -*- /** * @file Service.h * @@ -6,7 +6,6 @@ * * @author Pradeep Gore <pradeep@oomworks.com> * - * */ #ifndef TAO_NS_SERVICE_H @@ -20,6 +19,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Service_Config.h" +#include "ace/Service_Object.h" #include "orbsvcs/CosNotifyChannelAdminS.h" #include "tao/PortableServer/PortableServer.h" diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup.idl b/TAO/orbsvcs/orbsvcs/PortableGroup.idl index 3d3a4aab0b3..e9351869313 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup.idl +++ b/TAO/orbsvcs/orbsvcs/PortableGroup.idl @@ -16,9 +16,9 @@ #include <tao/GIOP.pidl> #include <orb.idl> -#pragma prefix "omg.org" - -module PortableGroup { +module PortableGroup +{ + typeprefix PortableGroup "omg.org"; // Specification for Interoperable Object Group References typedef string GroupDomainId; diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.cpp index facd5510116..ee70b502a4f 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.cpp @@ -379,7 +379,7 @@ TAO_PG_GenericFactory::populate_object_group ( PortableGroup::ObjectGroup_ptr object_group, const char * type_id, const PortableGroup::FactoryInfos & factory_infos, - const PortableGroup::InitialNumberMembersValue initial_number_members, + PortableGroup::InitialNumberMembersValue initial_number_members, TAO_PG_Factory_Set & factory_set ACE_ENV_ARG_DECL) { diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.h index e42b0a411bd..6ff59316028 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.h +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.h @@ -164,7 +164,7 @@ private: PortableGroup::ObjectGroup_ptr object_group, const char * type_id, const PortableGroup::FactoryInfos &factory_infos, - const PortableGroup::InitialNumberMembersValue initial_number_members, + PortableGroup::InitialNumberMembersValue initial_number_members, TAO_PG_Factory_Set & factory_set ACE_ENV_ARG_DECL); diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.cpp index f11d1328a0d..17ea0ad811b 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.cpp @@ -118,7 +118,7 @@ TAO_PortableGroup_Acceptor_Registry::open_i (const TAO_Profile* profile, "")); ACE_THROW (CORBA::BAD_PARAM ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_ACCEPTOR_REGISTRY_OPEN_LOCATION_CODE, EINVAL), CORBA::COMPLETED_NO)); @@ -143,7 +143,7 @@ TAO_PortableGroup_Acceptor_Registry::open_i (const TAO_Profile* profile, "")); ACE_THROW (CORBA::BAD_PARAM ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_ACCEPTOR_REGISTRY_OPEN_LOCATION_CODE, EINVAL), CORBA::COMPLETED_NO)); @@ -158,7 +158,7 @@ TAO_PortableGroup_Acceptor_Registry::open_i (const TAO_Profile* profile, )); ACE_THROW (CORBA::BAD_PARAM ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_ACCEPTOR_REGISTRY_OPEN_LOCATION_CODE, EINVAL), CORBA::COMPLETED_NO)); diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp index d64270a8a82..cb086a2e65a 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp @@ -29,7 +29,7 @@ TAO_PortableGroup_Loader::init (int /*argc*/, ACE_NEW_THROW_EX (temp_orb_initializer, TAO_PortableGroup_ORBInitializer (), CORBA::NO_MEMORY ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, ENOMEM), CORBA::COMPLETED_NO)); diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.h index a1fed2a2c82..f2e6f40fcdb 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.h +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.h @@ -18,7 +18,8 @@ #include "portablegroup_export.h" #include "ace/Service_Config.h" -#include "tao/corbafwd.h" +#include "ace/Service_Object.h" + #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -32,7 +33,8 @@ * This class acts as a facade for the PortableGroup library to the * ORB. */ -class TAO_PortableGroup_Export TAO_PortableGroup_Loader : public ACE_Service_Object +class TAO_PortableGroup_Export TAO_PortableGroup_Loader + : public ACE_Service_Object { friend class TAO_POA_Hooks; @@ -42,7 +44,7 @@ public: /// Initialize the PortableGroup loader hooks. virtual int init (int argc, - char* []); + char *[]); /// Used to force the initialization of the ORB code. static int Initializer (void); diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/Portable_Group_Map.h b/TAO/orbsvcs/orbsvcs/PortableGroup/Portable_Group_Map.h index 07b842eaa10..7eb59f3d7e4 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/Portable_Group_Map.h +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/Portable_Group_Map.h @@ -24,6 +24,9 @@ #include "orbsvcs/PortableGroupC.h" #include "tao/Object_KeyC.h" + +class TAO_ServerRequest; + /** * @class TAO_GroupId_Hash * diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.cpp index 07c0fb70f31..ebb06f5e2ff 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.cpp @@ -193,7 +193,7 @@ TAO_UIPMC_Profile::parse_string (const char *string string[2] != '0') { ACE_THROW (CORBA::INV_OBJREF ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EINVAL), CORBA::COMPLETED_NO)); @@ -227,7 +227,7 @@ TAO_UIPMC_Profile::parse_string (const char *string minor > TAO_DEF_MIOP_MINOR) { ACE_THROW (CORBA::INV_OBJREF ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EINVAL), CORBA::COMPLETED_NO)); @@ -240,7 +240,7 @@ TAO_UIPMC_Profile::parse_string (const char *string { // The group component version is mandatory. ACE_THROW (CORBA::INV_OBJREF ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EINVAL), CORBA::COMPLETED_NO)); @@ -260,7 +260,7 @@ TAO_UIPMC_Profile::parse_string (const char *string // The group_domain_id is mandatory, so throw an // exception if it isn't found. ACE_THROW (CORBA::INV_OBJREF ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EINVAL), CORBA::COMPLETED_NO)); @@ -293,7 +293,7 @@ TAO_UIPMC_Profile::parse_string (const char *string { // The Group ID is mandatory, so throw an exception. ACE_THROW (CORBA::INV_OBJREF ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EINVAL), CORBA::COMPLETED_NO)); @@ -320,7 +320,7 @@ TAO_UIPMC_Profile::parse_string (const char *string // The group version was expected but not found, // so throw an exception. ACE_THROW (CORBA::INV_OBJREF ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EINVAL), CORBA::COMPLETED_NO)); @@ -342,7 +342,7 @@ TAO_UIPMC_Profile::parse_string (const char *string // The multicast address is mandatory, so throw an exception, // since it wasn't found. ACE_THROW (CORBA::INV_OBJREF ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EINVAL), CORBA::COMPLETED_NO)); @@ -359,7 +359,7 @@ TAO_UIPMC_Profile::parse_string (const char *string // The multicast port is mandatory, so throw an exception, // since it wasn't found. ACE_THROW (CORBA::INV_OBJREF ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EINVAL), CORBA::COMPLETED_NO)); @@ -716,7 +716,7 @@ TAO_UIPMC_Profile::addressing_mode (CORBA::Short addr_mode default: ACE_THROW (CORBA::BAD_PARAM ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EINVAL), CORBA::COMPLETED_NO)); diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp index aaf411c813f..e31be772f21 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp @@ -333,7 +333,7 @@ TAO_SSLIOP_Connector::iiop_connect (TAO_SSLIOP_Endpoint *ssl_endpoint, if (ACE_BIT_DISABLED (ssl_component.target_supports, Security::NoProtection)) ACE_THROW_RETURN (CORBA::NO_PERMISSION ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EPERM), CORBA::COMPLETED_NO), @@ -377,7 +377,7 @@ TAO_SSLIOP_Connector::ssliop_connect (TAO_SSLIOP_Endpoint *ssl_endpoint, if (ACE_BIT_ENABLED (ssl_component.target_requires, Security::NoProtection)) ACE_THROW_RETURN (CORBA::NO_PERMISSION ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EPERM), CORBA::COMPLETED_NO), diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.cpp index b7289fb5256..c579340c5e4 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.cpp @@ -47,7 +47,7 @@ TAO_SSLIOP_Current::get_peer_certificate ( ACE_NEW_THROW_EX (c, SSLIOP::ASN_1_Cert, CORBA::NO_MEMORY ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, ENOMEM), CORBA::COMPLETED_NO)); @@ -81,7 +81,7 @@ TAO_SSLIOP_Current::get_peer_certificate_chain ( ACE_NEW_THROW_EX (c, SSLIOP::SSL_Cert, CORBA::NO_MEMORY ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, ENOMEM), CORBA::COMPLETED_NO)); diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.cpp index 129bc080131..16c1ab0da2e 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.cpp @@ -52,7 +52,7 @@ TAO_SSLIOP_ORBInitializer::pre_init ( ACE_NEW_THROW_EX (current, TAO_SSLIOP_Current (orb_core), CORBA::NO_MEMORY ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, ENOMEM), CORBA::COMPLETED_NO)); @@ -116,7 +116,7 @@ TAO_SSLIOP_ORBInitializer::post_init ( ssliop_current.in (), this->qop_), CORBA::NO_MEMORY ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, ENOMEM), CORBA::COMPLETED_NO)); diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp index baa8bc86b66..2035aee4208 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp @@ -91,12 +91,6 @@ TAO_SSLIOP_Transport::send_i (iovec *iov, size_t &bytes_transferred, const ACE_Time_Value *max_wait_time) { - // @@ We should not be attempting to send an iovec with an iovcnt - // greater than 1! Proper iovec non-blocking send semantics - // cannot be maintained with SSL. Either send an iovec with an - // iovcnt of one or just send a single buffer. - // -Ossama - ssize_t retval = this->connection_handler_->peer ().sendv (iov, iovcnt, max_wait_time); diff --git a/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp index 552bd7a9e6f..2ea9438589c 100644 --- a/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp +++ b/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp @@ -52,7 +52,7 @@ TAO_Security_ORBInitializer::pre_init ( ACE_NEW_THROW_EX (current, TAO_Security_Current (tss_slot, orb_id.in ()), CORBA::NO_MEMORY ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, ENOMEM), CORBA::COMPLETED_NO)); @@ -73,7 +73,7 @@ TAO_Security_ORBInitializer::pre_init ( ACE_NEW_THROW_EX (manager, TAO_SecurityManager, CORBA::NO_MEMORY ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, ENOMEM), CORBA::COMPLETED_NO)); diff --git a/TAO/tao/AbstractBase.cpp b/TAO/tao/AbstractBase.cpp index 7563f673f5f..1b7f65f89fd 100644 --- a/TAO/tao/AbstractBase.cpp +++ b/TAO/tao/AbstractBase.cpp @@ -1,20 +1,5 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO -// -// = FILENAME -// AbstractBase.cpp -// -// = AUTHOR -// Jeff Parsons <parsons@cs.wustl.edu> -// -// ============================================================================ - #include "tao/AbstractBase.h" -#include "tao/Any.h" + #include "tao/Stub.h" #include "tao/Profile.h" #include "tao/ValueFactory.h" @@ -24,13 +9,15 @@ # include "tao/AbstractBase.inl" #endif /* ! __ACE_INLINE__ */ + ACE_RCSID (tao, AbstractBase, "$Id$") -int CORBA_AbstractBase::_tao_class_id = 0; -CORBA_AbstractBase::CORBA_AbstractBase (void) +int CORBA::AbstractBase::_tao_class_id = 0; + +CORBA::AbstractBase::AbstractBase (void) : is_objref_ (0), concrete_stubobj_ (0), is_collocated_ (0), @@ -39,7 +26,7 @@ CORBA_AbstractBase::CORBA_AbstractBase (void) { } -CORBA_AbstractBase::CORBA_AbstractBase (const CORBA_AbstractBase &rhs) +CORBA::AbstractBase::AbstractBase (const CORBA::AbstractBase &rhs) : is_objref_ (rhs.is_objref_), concrete_stubobj_ (rhs.concrete_stubobj_), is_collocated_ (rhs.is_collocated_), @@ -52,9 +39,9 @@ CORBA_AbstractBase::CORBA_AbstractBase (const CORBA_AbstractBase &rhs) } } -CORBA_AbstractBase::CORBA_AbstractBase (TAO_Stub * protocol_proxy, - CORBA::Boolean collocated, - TAO_Abstract_ServantBase * servant) +CORBA::AbstractBase::AbstractBase (TAO_Stub * protocol_proxy, + CORBA::Boolean collocated, + TAO_Abstract_ServantBase * servant) : is_objref_ (1), concrete_stubobj_ (protocol_proxy), is_collocated_ (collocated), @@ -67,7 +54,7 @@ CORBA_AbstractBase::CORBA_AbstractBase (TAO_Stub * protocol_proxy, } } -CORBA_AbstractBase::~CORBA_AbstractBase (void) +CORBA::AbstractBase::~AbstractBase (void) { if (this->concrete_stubobj_ != 0) { @@ -76,13 +63,13 @@ CORBA_AbstractBase::~CORBA_AbstractBase (void) } void * -CORBA_AbstractBase::_tao_QueryInterface (ptr_arith_t type) +CORBA::AbstractBase::_tao_QueryInterface (ptr_arith_t type) { void *retv = 0; if (type == ACE_reinterpret_cast ( ptr_arith_t, - &CORBA_AbstractBase::_tao_class_id) + &CORBA::AbstractBase::_tao_class_id) ) { retv = ACE_reinterpret_cast (void*, this); @@ -100,17 +87,17 @@ CORBA_AbstractBase::_tao_QueryInterface (ptr_arith_t type) // class in the CDR extraction operator. The actual management // of the refcount will always be done in the derived class. void -CORBA_AbstractBase::_add_ref (void) +CORBA::AbstractBase::_add_ref (void) { } void -CORBA_AbstractBase::_remove_ref (void) +CORBA::AbstractBase::_remove_ref (void) { } CORBA::Object_ptr -CORBA_AbstractBase::_to_object (void) +CORBA::AbstractBase::_to_object (void) { if (this->concrete_stubobj_ == 0) { @@ -124,7 +111,7 @@ CORBA_AbstractBase::_to_object (void) } CORBA::ValueBase * -CORBA_AbstractBase::_to_value (void) +CORBA::AbstractBase::_to_value (void) { if (this->is_objref_) { @@ -143,7 +130,7 @@ CORBA_AbstractBase::_to_value (void) } CORBA::Boolean -operator<< (TAO_OutputCDR &strm, const CORBA_AbstractBase_ptr abs) +operator<< (TAO_OutputCDR &strm, const CORBA::AbstractBase_ptr abs) { CORBA::Boolean discriminator = 0; @@ -223,7 +210,7 @@ operator<< (TAO_OutputCDR &strm, const CORBA_AbstractBase_ptr abs) } CORBA::Boolean -operator>> (TAO_InputCDR &strm, CORBA_AbstractBase_ptr &abs) +operator>> (TAO_InputCDR &strm, CORBA::AbstractBase_ptr &abs) { abs = 0; CORBA::Boolean discriminator = 0; @@ -272,8 +259,8 @@ operator>> (TAO_InputCDR &strm, CORBA_AbstractBase_ptr &abs) if (TAO_debug_level > 0) { ACE_DEBUG ((LM_WARNING, - "TAO (%P|%t) WARNING: extracting valuetype using " - "default ORB_Core\n")); + "TAO (%P|%t) WARNING: extracting " + "valuetype using default ORB_Core\n")); } } @@ -315,9 +302,10 @@ operator>> (TAO_InputCDR &strm, CORBA_AbstractBase_ptr &abs) && generic_objref->_is_collocated (); ACE_NEW_RETURN (abs, - CORBA_AbstractBase (concrete_stubobj, - collocated, - generic_objref->_servant ()), + CORBA::AbstractBase ( + concrete_stubobj, + collocated, + generic_objref->_servant ()), 0); return 1; } @@ -328,19 +316,19 @@ operator>> (TAO_InputCDR &strm, CORBA_AbstractBase_ptr &abs) } CORBA::Boolean -CORBA_AbstractBase::_tao_marshal_v (TAO_OutputCDR &) +CORBA::AbstractBase::_tao_marshal_v (TAO_OutputCDR &) { return 0; } CORBA::Boolean -CORBA_AbstractBase::_tao_unmarshal_v (TAO_InputCDR &) +CORBA::AbstractBase::_tao_unmarshal_v (TAO_InputCDR &) { return 0; } CORBA::ValueBase * -CORBA_AbstractBase::_tao_to_value (void) +CORBA::AbstractBase::_tao_to_value (void) { return 0; } diff --git a/TAO/tao/AbstractBase.h b/TAO/tao/AbstractBase.h index 7231c22f9d0..5d52bfc81da 100644 --- a/TAO/tao/AbstractBase.h +++ b/TAO/tao/AbstractBase.h @@ -21,152 +21,166 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/Object.h" -#include "tao/ValueBase.h" -#include "tao/ValueFactory.h" +#include "ace/CORBA_macros.h" -/** - * @class CORBA_AbstractBase - * - * @brief Abstract base class for Interfaces and Valuetypes - * - * Allows the determination of whether an object has been - * passed by reference or by value to be deferred until runtime. - */ -class TAO_Export CORBA_AbstractBase -{ -public: - /// So the extraction operator can call the protectec constructor. - friend TAO_Export CORBA::Boolean - operator<< (TAO_OutputCDR &, const CORBA_AbstractBase_ptr); - - friend TAO_Export CORBA::Boolean - operator>> (TAO_InputCDR &, CORBA_AbstractBase_ptr &); - typedef CORBA_AbstractBase_ptr _ptr_type; - typedef CORBA_AbstractBase_var _var_type; +class TAO_Stub; +class TAO_Abstract_ServantBase; - static int _tao_class_id; - - static CORBA::AbstractBase_ptr _narrow (CORBA::AbstractBase_ptr obj - ACE_ENV_ARG_DECL_WITH_DEFAULTS); - static CORBA::AbstractBase_ptr _unchecked_narrow ( +namespace CORBA +{ + /** + * @class AbstractBase + * + * @brief Abstract base class for Interfaces and Valuetypes + * + * Allows the determination of whether an object has been passed by + * reference or by value to be deferred until runtime. + */ + class TAO_Export AbstractBase + { + public: + + /// Constructor. + /** + * This constructor is only meant to be called by the + * corresponding CDR stream extraction operator. + */ + AbstractBase (TAO_Stub *p, + CORBA::Boolean collocated, + TAO_Abstract_ServantBase *servant); + + typedef CORBA::AbstractBase_ptr _ptr_type; + typedef CORBA::AbstractBase_var _var_type; + + static int _tao_class_id; + + static CORBA::AbstractBase_ptr _narrow (CORBA::AbstractBase_ptr obj + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + static CORBA::AbstractBase_ptr _unchecked_narrow ( CORBA::AbstractBase_ptr obj ACE_ENV_ARG_DECL_WITH_DEFAULTS - ); - - static CORBA::AbstractBase_ptr _duplicate (CORBA::AbstractBase_ptr obj); - static CORBA::AbstractBase_ptr _nil (void); - - CORBA::Object_ptr _to_object (void); - CORBA::ValueBase *_to_value (void); - - virtual CORBA::Boolean _is_a (const char *type_id - ACE_ENV_ARG_DECL_WITH_DEFAULTS); - virtual void *_tao_QueryInterface (ptr_arith_t type); - virtual const char* _interface_repository_id (void) const; - virtual const char* _tao_obv_repository_id (void) const; - virtual void *_tao_obv_narrow (ptr_arith_t type_id); - virtual CORBA::Boolean _tao_marshal_v (TAO_OutputCDR &strm); - virtual CORBA::Boolean _tao_unmarshal_v (TAO_InputCDR &strm); - - virtual void _add_ref (void); - virtual void _remove_ref (void); - - CORBA::Boolean _is_objref (void) const; - TAO_Stub *_stubobj (void) const; - CORBA::Boolean _is_collocated (void) const; - TAO_Abstract_ServantBase *_servant (void) const; - CORBA::Boolean _is_local (void) const; - -protected: - CORBA_AbstractBase (void); - CORBA_AbstractBase (const CORBA_AbstractBase &); - CORBA_AbstractBase (TAO_Stub *p, - CORBA::Boolean collocated, - TAO_Abstract_ServantBase *servant); - - virtual ~CORBA_AbstractBase (void); - -protected: - CORBA::Boolean is_objref_; - -private: - CORBA_AbstractBase & operator= (const CORBA_AbstractBase &); - - virtual CORBA::ValueBase *_tao_to_value (void); - -private: - TAO_Stub *concrete_stubobj_; - CORBA::Boolean is_collocated_; - TAO_Abstract_ServantBase *servant_; - CORBA::Boolean is_local_; -}; - -/** - * @class CORBA_AbstractBase_var - * - * @brief _var class for AbstractBase - */ -class TAO_Export CORBA_AbstractBase_var -{ -public: - CORBA_AbstractBase_var (void); - CORBA_AbstractBase_var (CORBA::AbstractBase_ptr); - CORBA_AbstractBase_var (const CORBA_AbstractBase_var &); - ~CORBA_AbstractBase_var (void); - - CORBA_AbstractBase_var &operator= (CORBA::AbstractBase_ptr); - CORBA_AbstractBase_var &operator= (const CORBA_AbstractBase_var &); - CORBA::AbstractBase_ptr operator-> (void) const; - - /// in, inout, out, _retn - operator const CORBA::AbstractBase_ptr &() const; - operator CORBA::AbstractBase_ptr &(); - CORBA::AbstractBase_ptr in (void) const; - CORBA::AbstractBase_ptr &inout (void); - CORBA::AbstractBase_ptr &out (void); - CORBA::AbstractBase_ptr _retn (void); - CORBA::AbstractBase_ptr ptr (void) const; - - static CORBA::AbstractBase_ptr tao_duplicate (CORBA::AbstractBase_ptr); - static void tao_release (CORBA::AbstractBase_ptr); - static CORBA::AbstractBase_ptr tao_nil (void); - static CORBA::AbstractBase_ptr tao_narrow (CORBA::AbstractBase * - ACE_ENV_ARG_DECL_NOT_USED); - static CORBA::AbstractBase * tao_upcast (void *); - -private: - CORBA::AbstractBase_ptr ptr_; -}; - -/** - * @class CORBA_AbstractBase_out - * - * @brief _out class for AbstractBase - */ -class TAO_Export CORBA_AbstractBase_out -{ -public: - CORBA_AbstractBase_out (CORBA::AbstractBase_ptr &); - CORBA_AbstractBase_out (CORBA_AbstractBase_var &); - CORBA_AbstractBase_out (const CORBA_AbstractBase_out &); - CORBA_AbstractBase_out &operator= (const CORBA_AbstractBase_out &); - CORBA_AbstractBase_out &operator= (const CORBA_AbstractBase_var &); - CORBA_AbstractBase_out &operator= (CORBA::AbstractBase_ptr); - operator CORBA::AbstractBase_ptr &(); - CORBA::AbstractBase_ptr &ptr (void); - CORBA::AbstractBase_ptr operator-> (void); - -private: - CORBA::AbstractBase_ptr &ptr_; -}; + ); + + static CORBA::AbstractBase_ptr _duplicate (CORBA::AbstractBase_ptr obj); + static CORBA::AbstractBase_ptr _nil (void); + + CORBA::Object_ptr _to_object (void); + CORBA::ValueBase *_to_value (void); + + virtual CORBA::Boolean _is_a (const char *type_id + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + virtual void *_tao_QueryInterface (ptr_arith_t type); + virtual const char* _interface_repository_id (void) const; + virtual const char* _tao_obv_repository_id (void) const; + virtual void *_tao_obv_narrow (ptr_arith_t type_id); + virtual CORBA::Boolean _tao_marshal_v (TAO_OutputCDR &strm); + virtual CORBA::Boolean _tao_unmarshal_v (TAO_InputCDR &strm); + + virtual void _add_ref (void); + virtual void _remove_ref (void); + + CORBA::Boolean _is_objref (void) const; + TAO_Stub *_stubobj (void) const; + CORBA::Boolean _is_collocated (void) const; + TAO_Abstract_ServantBase *_servant (void) const; + CORBA::Boolean _is_local (void) const; + + protected: + + AbstractBase (void); + AbstractBase (const AbstractBase &); + + virtual ~AbstractBase (void); + + protected: + + CORBA::Boolean is_objref_; + + private: + + AbstractBase & operator= (const AbstractBase &); + + virtual CORBA::ValueBase *_tao_to_value (void); + + private: + + TAO_Stub *concrete_stubobj_; + CORBA::Boolean is_collocated_; + TAO_Abstract_ServantBase *servant_; + CORBA::Boolean is_local_; + }; + + /** + * @class AbstractBase_var + * + * @brief _var class for AbstractBase + * + * _var class for AbstractBase + */ + class TAO_Export AbstractBase_var + { + public: + AbstractBase_var (void); + AbstractBase_var (CORBA::AbstractBase_ptr); + AbstractBase_var (const AbstractBase_var &); + ~AbstractBase_var (void); + + AbstractBase_var &operator= (CORBA::AbstractBase_ptr); + AbstractBase_var &operator= (const AbstractBase_var &); + CORBA::AbstractBase_ptr operator-> (void) const; + + /// in, inout, out, _retn + operator const CORBA::AbstractBase_ptr &() const; + operator CORBA::AbstractBase_ptr &(); + CORBA::AbstractBase_ptr in (void) const; + CORBA::AbstractBase_ptr &inout (void); + CORBA::AbstractBase_ptr &out (void); + CORBA::AbstractBase_ptr _retn (void); + CORBA::AbstractBase_ptr ptr (void) const; + + static CORBA::AbstractBase_ptr tao_duplicate (CORBA::AbstractBase_ptr); + static void tao_release (CORBA::AbstractBase_ptr); + static CORBA::AbstractBase_ptr tao_nil (void); + static CORBA::AbstractBase_ptr tao_narrow (CORBA::AbstractBase * + ACE_ENV_ARG_DECL_NOT_USED); + static CORBA::AbstractBase * tao_upcast (void *); + + private: + CORBA::AbstractBase_ptr ptr_; + }; + + /** + * @class AbstractBase_out + * + * @brief _out class for AbstractBase + * + * _out class for AbstractBase + */ + class TAO_Export AbstractBase_out + { + public: + AbstractBase_out (CORBA::AbstractBase_ptr &); + AbstractBase_out (AbstractBase_var &); + AbstractBase_out (const AbstractBase_out &); + AbstractBase_out &operator= (const AbstractBase_out &); + AbstractBase_out &operator= (const AbstractBase_var &); + AbstractBase_out &operator= (CORBA::AbstractBase_ptr); + operator CORBA::AbstractBase_ptr &(); + CORBA::AbstractBase_ptr &ptr (void); + CORBA::AbstractBase_ptr operator-> (void); + + private: + CORBA::AbstractBase_ptr &ptr_; + }; +} TAO_Export CORBA::Boolean -operator<< (TAO_OutputCDR &, const CORBA_AbstractBase_ptr); +operator<< (TAO_OutputCDR &, const CORBA::AbstractBase_ptr); TAO_Export CORBA::Boolean -operator>> (TAO_InputCDR &, CORBA_AbstractBase_ptr &); +operator>> (TAO_InputCDR &, CORBA::AbstractBase_ptr &); + #if defined (__ACE_INLINE__) # include "tao/AbstractBase.inl" diff --git a/TAO/tao/AbstractBase.inl b/TAO/tao/AbstractBase.inl index 4bf3d55f36c..f100f7f3c4d 100644 --- a/TAO/tao/AbstractBase.inl +++ b/TAO/tao/AbstractBase.inl @@ -1,16 +1,17 @@ -// This may not look like C++, but it's really -*- C++ -*- +// -*- C++ -*- +// // $Id$ ACE_INLINE CORBA::AbstractBase_ptr -CORBA_AbstractBase::_nil (void) +CORBA::AbstractBase::_nil (void) { return 0; } ACE_INLINE -CORBA_AbstractBase_ptr -CORBA_AbstractBase::_duplicate (CORBA_AbstractBase_ptr obj) +CORBA::AbstractBase_ptr +CORBA::AbstractBase::_duplicate (CORBA::AbstractBase_ptr obj) { if (obj) { @@ -23,25 +24,25 @@ CORBA_AbstractBase::_duplicate (CORBA_AbstractBase_ptr obj) /// Just call _duplicate and let it decide what to do. ACE_INLINE CORBA::AbstractBase_ptr -CORBA_AbstractBase::_narrow (CORBA::AbstractBase_ptr obj - ACE_ENV_ARG_DECL_NOT_USED) +CORBA::AbstractBase::_narrow (CORBA::AbstractBase_ptr obj + ACE_ENV_ARG_DECL_NOT_USED) { - return CORBA_AbstractBase::_duplicate (obj); + return CORBA::AbstractBase::_duplicate (obj); } /// Same for this one. ACE_INLINE CORBA::AbstractBase_ptr -CORBA_AbstractBase::_unchecked_narrow (CORBA::AbstractBase_ptr obj - ACE_ENV_ARG_DECL_NOT_USED) +CORBA::AbstractBase::_unchecked_narrow (CORBA::AbstractBase_ptr obj + ACE_ENV_ARG_DECL_NOT_USED) { - return CORBA_AbstractBase::_duplicate (obj); + return CORBA::AbstractBase::_duplicate (obj); } ACE_INLINE CORBA::Boolean -CORBA_AbstractBase::_is_a (const char *type_id - ACE_ENV_ARG_DECL_NOT_USED) +CORBA::AbstractBase::_is_a (const char *type_id + ACE_ENV_ARG_DECL_NOT_USED) { return ! ACE_OS::strcmp (type_id, "IDL:omg.org/CORBA/AbstractBase:1.0"); @@ -49,56 +50,56 @@ CORBA_AbstractBase::_is_a (const char *type_id ACE_INLINE const char * -CORBA_AbstractBase::_interface_repository_id (void) const +CORBA::AbstractBase::_interface_repository_id (void) const { return "IDL:omg.org/CORBA/AbstractBase:1.0"; } ACE_INLINE const char * -CORBA_AbstractBase::_tao_obv_repository_id (void) const +CORBA::AbstractBase::_tao_obv_repository_id (void) const { return "IDL:omg.org/CORBA/AbstractBase:1.0"; } ACE_INLINE void * -CORBA_AbstractBase::_tao_obv_narrow (ptr_arith_t /* type_id */) +CORBA::AbstractBase::_tao_obv_narrow (ptr_arith_t /* type_id */) { return this; } ACE_INLINE CORBA::Boolean -CORBA_AbstractBase::_is_objref (void) const +CORBA::AbstractBase::_is_objref (void) const { return this->is_objref_; } ACE_INLINE TAO_Stub * -CORBA_AbstractBase::_stubobj (void) const +CORBA::AbstractBase::_stubobj (void) const { return this->concrete_stubobj_; } ACE_INLINE CORBA::Boolean -CORBA_AbstractBase::_is_collocated (void) const +CORBA::AbstractBase::_is_collocated (void) const { return this->is_collocated_; } ACE_INLINE TAO_Abstract_ServantBase * -CORBA_AbstractBase::_servant (void) const +CORBA::AbstractBase::_servant (void) const { return this->servant_; } ACE_INLINE CORBA::Boolean -CORBA_AbstractBase::_is_local (void) const +CORBA::AbstractBase::_is_local (void) const { return this->is_local_; } @@ -124,203 +125,201 @@ CORBA::is_nil (CORBA::AbstractBase_ptr obj) } // ************************************************************* -// Inline operations for class CORBA_AbstractBase_var +// Inline operations for class CORBA::AbstractBase_var // ************************************************************* ACE_INLINE -CORBA_AbstractBase_var::CORBA_AbstractBase_var (void) +CORBA::AbstractBase_var::AbstractBase_var (void) : ptr_ (CORBA::AbstractBase::_nil ()) { } ACE_INLINE -CORBA_AbstractBase_var::CORBA_AbstractBase_var (CORBA::AbstractBase_ptr p) +CORBA::AbstractBase_var::AbstractBase_var (CORBA::AbstractBase_ptr p) : ptr_ (p) { } ACE_INLINE -CORBA_AbstractBase_var::~CORBA_AbstractBase_var (void) +CORBA::AbstractBase_var::~AbstractBase_var (void) { CORBA::release (this->ptr_); } ACE_INLINE CORBA::AbstractBase_ptr -CORBA_AbstractBase_var::ptr (void) const +CORBA::AbstractBase_var::ptr (void) const { return this->ptr_; } ACE_INLINE -CORBA_AbstractBase_var::CORBA_AbstractBase_var (const CORBA_AbstractBase_var &p) - : ptr_ (CORBA_AbstractBase::_duplicate (p.ptr ())) +CORBA::AbstractBase_var::AbstractBase_var (const CORBA::AbstractBase_var &p) + : ptr_ (CORBA::AbstractBase::_duplicate (p.ptr ())) { } -ACE_INLINE CORBA_AbstractBase_var & -CORBA_AbstractBase_var::operator= (CORBA::AbstractBase_ptr p) +ACE_INLINE CORBA::AbstractBase_var & +CORBA::AbstractBase_var::operator= (CORBA::AbstractBase_ptr p) { CORBA::release (this->ptr_); this->ptr_ = p; return *this; } -ACE_INLINE CORBA_AbstractBase_var & -CORBA_AbstractBase_var::operator= (const CORBA_AbstractBase_var &p) +ACE_INLINE CORBA::AbstractBase_var & +CORBA::AbstractBase_var::operator= (const CORBA::AbstractBase_var &p) { if (this != &p) { CORBA::release (this->ptr_); - this->ptr_ = CORBA_AbstractBase::_duplicate (p.ptr ()); + this->ptr_ = CORBA::AbstractBase::_duplicate (p.ptr ()); } return *this; } ACE_INLINE -CORBA_AbstractBase_var::operator const CORBA::AbstractBase_ptr &() const // cast +CORBA::AbstractBase_var::operator const CORBA::AbstractBase_ptr &() const // cast { return this->ptr_; } ACE_INLINE -CORBA_AbstractBase_var::operator CORBA::AbstractBase_ptr &() // cast +CORBA::AbstractBase_var::operator CORBA::AbstractBase_ptr &() // cast { return this->ptr_; } ACE_INLINE CORBA::AbstractBase_ptr -CORBA_AbstractBase_var::operator-> (void) const +CORBA::AbstractBase_var::operator-> (void) const { return this->ptr_; } ACE_INLINE CORBA::AbstractBase_ptr -CORBA_AbstractBase_var::in (void) const +CORBA::AbstractBase_var::in (void) const { return this->ptr_; } ACE_INLINE CORBA::AbstractBase_ptr & -CORBA_AbstractBase_var::inout (void) +CORBA::AbstractBase_var::inout (void) { return this->ptr_; } ACE_INLINE CORBA::AbstractBase_ptr & -CORBA_AbstractBase_var::out (void) +CORBA::AbstractBase_var::out (void) { CORBA::release (this->ptr_); - this->ptr_ = CORBA_AbstractBase::_nil (); + this->ptr_ = CORBA::AbstractBase::_nil (); return this->ptr_; } ACE_INLINE CORBA::AbstractBase_ptr -CORBA_AbstractBase_var::_retn (void) +CORBA::AbstractBase_var::_retn (void) { // Yield ownership of valuebase. CORBA::AbstractBase_ptr val = this->ptr_; - this->ptr_ = CORBA_AbstractBase::_nil (); + this->ptr_ = CORBA::AbstractBase::_nil (); return val; } ACE_INLINE CORBA::AbstractBase_ptr -CORBA_AbstractBase_var::tao_duplicate (CORBA::AbstractBase_ptr p) +CORBA::AbstractBase_var::tao_duplicate (CORBA::AbstractBase_ptr p) { - return CORBA_AbstractBase::_duplicate (p); + return CORBA::AbstractBase::_duplicate (p); } ACE_INLINE void -CORBA_AbstractBase_var::tao_release (CORBA::AbstractBase_ptr p) +CORBA::AbstractBase_var::tao_release (CORBA::AbstractBase_ptr p) { CORBA::release (p); } ACE_INLINE CORBA::AbstractBase_ptr -CORBA_AbstractBase_var::tao_nil (void) +CORBA::AbstractBase_var::tao_nil (void) { - return CORBA_AbstractBase::_nil (); + return CORBA::AbstractBase::_nil (); } ACE_INLINE CORBA::AbstractBase_ptr -CORBA_AbstractBase_var::tao_narrow ( +CORBA::AbstractBase_var::tao_narrow ( CORBA::AbstractBase *p ACE_ENV_ARG_DECL_NOT_USED ) { - return CORBA_AbstractBase::_duplicate (p); + return CORBA::AbstractBase::_duplicate (p); } ACE_INLINE CORBA::AbstractBase * -CORBA_AbstractBase_var::tao_upcast (void *src) +CORBA::AbstractBase_var::tao_upcast (void *src) { - CORBA_AbstractBase **tmp = - ACE_static_cast (CORBA_AbstractBase **, src); + CORBA::AbstractBase **tmp = + ACE_static_cast (CORBA::AbstractBase **, src); return *tmp; } // ************************************************************* -// Inline operations for class CORBA_AbstractBase_out +// Inline operations for class CORBA::AbstractBase_out // ************************************************************* ACE_INLINE -CORBA_AbstractBase_out::CORBA_AbstractBase_out (CORBA::AbstractBase_ptr &p) +CORBA::AbstractBase_out::AbstractBase_out (CORBA::AbstractBase_ptr &p) : ptr_ (p) { - this->ptr_ = CORBA_AbstractBase::_nil (); + this->ptr_ = CORBA::AbstractBase::_nil (); } ACE_INLINE -CORBA_AbstractBase_out::CORBA_AbstractBase_out (CORBA_AbstractBase_var &p) +CORBA::AbstractBase_out::AbstractBase_out (CORBA::AbstractBase_var &p) : ptr_ (p.out ()) { CORBA::release (this->ptr_); - this->ptr_ = CORBA_AbstractBase::_nil (); + this->ptr_ = CORBA::AbstractBase::_nil (); } ACE_INLINE -CORBA_AbstractBase_out::CORBA_AbstractBase_out (const CORBA_AbstractBase_out &p) +CORBA::AbstractBase_out::AbstractBase_out (const CORBA::AbstractBase_out &p) : ptr_ (p.ptr_) { } -ACE_INLINE CORBA_AbstractBase_out & -CORBA_AbstractBase_out::operator= (const CORBA_AbstractBase_out &p) +ACE_INLINE CORBA::AbstractBase_out & +CORBA::AbstractBase_out::operator= (const CORBA::AbstractBase_out &p) { this->ptr_ = p.ptr_; return *this; } -ACE_INLINE CORBA_AbstractBase_out & -CORBA_AbstractBase_out::operator= (const CORBA_AbstractBase_var &p) +ACE_INLINE CORBA::AbstractBase_out & +CORBA::AbstractBase_out::operator= (const CORBA::AbstractBase_var &p) { - this->ptr_ = CORBA_AbstractBase::_duplicate (p.ptr ()); + this->ptr_ = CORBA::AbstractBase::_duplicate (p.ptr ()); return *this; } -ACE_INLINE CORBA_AbstractBase_out & -CORBA_AbstractBase_out::operator= (CORBA::AbstractBase_ptr p) +ACE_INLINE CORBA::AbstractBase_out & +CORBA::AbstractBase_out::operator= (CORBA::AbstractBase_ptr p) { this->ptr_ = p; return *this; } ACE_INLINE -CORBA_AbstractBase_out::operator CORBA::AbstractBase_ptr &() // cast +CORBA::AbstractBase_out::operator CORBA::AbstractBase_ptr &() // cast { return this->ptr_; } ACE_INLINE CORBA::AbstractBase_ptr & -CORBA_AbstractBase_out::ptr (void) // ptr +CORBA::AbstractBase_out::ptr (void) // ptr { return this->ptr_; } ACE_INLINE CORBA::AbstractBase_ptr -CORBA_AbstractBase_out::operator-> (void) +CORBA::AbstractBase_out::operator-> (void) { return this->ptr_; } - - diff --git a/TAO/tao/Any.cpp b/TAO/tao/Any.cpp index 604eff409e0..d52980b7664 100644 --- a/TAO/tao/Any.cpp +++ b/TAO/tao/Any.cpp @@ -5,10 +5,8 @@ // All Rights Reserved #include "tao/Any.h" -#include "tao/Typecode.h" #include "tao/Marshal.h" #include "tao/ORB_Core.h" -#include "tao/Object.h" #include "tao/AbstractBase.h" #include "tao/debug.h" @@ -22,7 +20,7 @@ ACE_RCSID (tao, CORBA::TypeCode_ptr -CORBA_Any::type (void) const +CORBA::Any::type (void) const { return CORBA::TypeCode::_duplicate (this->type_.in ()); } @@ -31,8 +29,8 @@ CORBA_Any::type (void) const // otherwise raises an exception. void -CORBA_Any::type (CORBA::TypeCode_ptr tc - ACE_ENV_ARG_DECL) +CORBA::Any::type (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) { CORBA::Boolean equiv = this->type_->equivalent (tc ACE_ENV_ARG_PARAMETER); @@ -54,7 +52,7 @@ CORBA_Any::type (CORBA::TypeCode_ptr tc // Any contains a value or not. Use of >>= is recommended for anything else. const void * -CORBA_Any::value (void) const +CORBA::Any::value (void) const { if (this->any_owns_data_) { @@ -72,7 +70,7 @@ CORBA_Any::value (void) const // NOTE: null (zero) typecode pointers are also treated as the null // typecode ... -CORBA_Any::CORBA_Any (void) +CORBA::Any::Any (void) : type_ (CORBA::TypeCode::_duplicate (CORBA::_tc_null)), byte_order_ (TAO_ENCAP_BYTE_ORDER), cdr_ (0), @@ -83,7 +81,7 @@ CORBA_Any::CORBA_Any (void) { } -CORBA_Any::CORBA_Any (CORBA::TypeCode_ptr tc) +CORBA::Any::Any (CORBA::TypeCode_ptr tc) : type_ (CORBA::TypeCode::_duplicate (tc)), byte_order_ (TAO_ENCAP_BYTE_ORDER), cdr_ (0), @@ -95,10 +93,10 @@ CORBA_Any::CORBA_Any (CORBA::TypeCode_ptr tc) } // Constructor using a message block. -CORBA_Any::CORBA_Any (CORBA::TypeCode_ptr type, - CORBA::UShort, - int byte_order, - const ACE_Message_Block* mb) +CORBA::Any::Any (CORBA::TypeCode_ptr type, + CORBA::UShort, + int byte_order, + const ACE_Message_Block* mb) : type_ (CORBA::TypeCode::_duplicate (type)), byte_order_ (byte_order), any_owns_data_ (0), @@ -113,7 +111,7 @@ CORBA_Any::CORBA_Any (CORBA::TypeCode_ptr type, } // Copy constructor for "Any". -CORBA_Any::CORBA_Any (const CORBA_Any &src) +CORBA::Any::Any (const CORBA::Any &src) : cdr_ (0), any_owns_data_ (0), contains_local_ (src.contains_local_), @@ -146,8 +144,8 @@ CORBA_Any::CORBA_Any (const CORBA_Any &src) // assignment operator -CORBA_Any & -CORBA_Any::operator= (const CORBA_Any &src) +CORBA::Any & +CORBA::Any::operator= (const CORBA::Any &src) { // Check if it is a self assignment if (this == &src) @@ -192,7 +190,7 @@ CORBA_Any::operator= (const CORBA_Any &src) } // Destructor for an "Any" deep-frees memory if needed. -CORBA_Any::~CORBA_Any (void) +CORBA::Any::~Any (void) { // Decrement the refcount on the Message_Block we hold, it does not // matter if we own the data or not, because we always own the @@ -208,9 +206,9 @@ CORBA_Any::~CORBA_Any (void) // <<= operators. void -CORBA_Any::_tao_replace (CORBA::TypeCode_ptr tc, - int byte_order, - const ACE_Message_Block *mb) +CORBA::Any::_tao_replace (CORBA::TypeCode_ptr tc, + int byte_order, + const ACE_Message_Block *mb) { // Decrement the refcount on the Message_Block we hold, it does not // matter if we own the data or not, because we always own the @@ -234,12 +232,12 @@ CORBA_Any::_tao_replace (CORBA::TypeCode_ptr tc, } void -CORBA_Any::_tao_replace (CORBA::TypeCode_ptr tc, - int byte_order, - const ACE_Message_Block *mb, - CORBA::Boolean any_owns_data, - void* value, - CORBA::Any::_tao_destructor destructor) +CORBA::Any::_tao_replace (CORBA::TypeCode_ptr tc, + int byte_order, + const ACE_Message_Block *mb, + CORBA::Boolean any_owns_data, + void* value, + CORBA::Any::_tao_destructor destructor) { // Decrement the refcount on the Message_Block we hold, it does not // matter if we own the data or not, because we always own the @@ -264,10 +262,10 @@ CORBA_Any::_tao_replace (CORBA::TypeCode_ptr tc, } void -CORBA_Any::_tao_replace (CORBA::TypeCode_ptr tc, - CORBA::Boolean any_owns_data, - void* value, - CORBA::Any::_tao_destructor destructor) +CORBA::Any::_tao_replace (CORBA::TypeCode_ptr tc, + CORBA::Boolean any_owns_data, + void* value, + CORBA::Any::_tao_destructor destructor) { this->free_value (); @@ -281,7 +279,7 @@ CORBA_Any::_tao_replace (CORBA::TypeCode_ptr tc, // Free internal data. void -CORBA_Any::free_value (void) +CORBA::Any::free_value (void) { if (this->any_owns_data_ && this->value_ != 0 @@ -295,9 +293,9 @@ CORBA_Any::free_value (void) } void -CORBA_Any::_tao_encode (TAO_OutputCDR &cdr, - TAO_ORB_Core *orb_core - ACE_ENV_ARG_DECL) +CORBA::Any::_tao_encode (TAO_OutputCDR &cdr, + TAO_ORB_Core *orb_core + ACE_ENV_ARG_DECL) { // Always append the CDR stream, even when the value_. if (this->cdr_ == 0) @@ -315,8 +313,8 @@ CORBA_Any::_tao_encode (TAO_OutputCDR &cdr, } void -CORBA_Any::_tao_decode (TAO_InputCDR &cdr - ACE_ENV_ARG_DECL) +CORBA::Any::_tao_decode (TAO_InputCDR &cdr + ACE_ENV_ARG_DECL) { // Just read into the CDR stream... @@ -368,7 +366,7 @@ CORBA_Any::_tao_decode (TAO_InputCDR &cdr // Insertion operators. void -CORBA_Any::operator<<= (CORBA::Short s) +CORBA::Any::operator<<= (CORBA::Short s) { TAO_OutputCDR stream; stream << s; @@ -378,7 +376,7 @@ CORBA_Any::operator<<= (CORBA::Short s) } void -CORBA_Any::operator<<= (CORBA::UShort s) +CORBA::Any::operator<<= (CORBA::UShort s) { TAO_OutputCDR stream; stream << s; @@ -388,7 +386,7 @@ CORBA_Any::operator<<= (CORBA::UShort s) } void -CORBA_Any::operator<<= (CORBA::Long l) +CORBA::Any::operator<<= (CORBA::Long l) { TAO_OutputCDR stream; stream << l; @@ -398,7 +396,7 @@ CORBA_Any::operator<<= (CORBA::Long l) } void -CORBA_Any::operator<<= (CORBA::ULong l) +CORBA::Any::operator<<= (CORBA::ULong l) { TAO_OutputCDR stream; stream << l; @@ -408,7 +406,7 @@ CORBA_Any::operator<<= (CORBA::ULong l) } void -CORBA_Any::operator<<= (CORBA::LongLong l) +CORBA::Any::operator<<= (CORBA::LongLong l) { TAO_OutputCDR stream; stream << l; @@ -418,7 +416,7 @@ CORBA_Any::operator<<= (CORBA::LongLong l) } void -CORBA_Any::operator<<= (CORBA::ULongLong l) +CORBA::Any::operator<<= (CORBA::ULongLong l) { TAO_OutputCDR stream; stream << l; @@ -428,7 +426,7 @@ CORBA_Any::operator<<= (CORBA::ULongLong l) } void -CORBA_Any::operator<<= (CORBA::Float f) +CORBA::Any::operator<<= (CORBA::Float f) { TAO_OutputCDR stream; stream << f; @@ -438,7 +436,7 @@ CORBA_Any::operator<<= (CORBA::Float f) } void -CORBA_Any::operator<<= (CORBA::Double d) +CORBA::Any::operator<<= (CORBA::Double d) { TAO_OutputCDR stream; stream << d; @@ -448,7 +446,7 @@ CORBA_Any::operator<<= (CORBA::Double d) } void -CORBA_Any::operator<<= (CORBA::LongDouble d) +CORBA::Any::operator<<= (CORBA::LongDouble d) { TAO_OutputCDR stream; stream << d; @@ -459,7 +457,7 @@ CORBA_Any::operator<<= (CORBA::LongDouble d) // Insertion of Any - copying. void -CORBA_Any::operator<<= (const CORBA_Any &a) +CORBA::Any::operator<<= (const CORBA::Any &a) { TAO_OutputCDR stream; stream << a; @@ -492,7 +490,7 @@ CORBA::Any::operator<<= (CORBA::Any *a) // implementing the special types void -CORBA_Any::operator<<= (from_boolean b) +CORBA::Any::operator<<= (from_boolean b) { TAO_OutputCDR stream; stream << b; @@ -502,7 +500,7 @@ CORBA_Any::operator<<= (from_boolean b) } void -CORBA_Any::operator<<= (from_octet o) +CORBA::Any::operator<<= (from_octet o) { TAO_OutputCDR stream; stream << o; @@ -512,7 +510,7 @@ CORBA_Any::operator<<= (from_octet o) } void -CORBA_Any::operator<<= (from_char c) +CORBA::Any::operator<<= (from_char c) { TAO_OutputCDR stream; stream << c; @@ -522,7 +520,7 @@ CORBA_Any::operator<<= (from_char c) } void -CORBA_Any::operator<<= (from_wchar wc) +CORBA::Any::operator<<= (from_wchar wc) { TAO_OutputCDR stream; stream << wc; @@ -532,7 +530,7 @@ CORBA_Any::operator<<= (from_wchar wc) } void -CORBA_Any::operator<<= (CORBA::TypeCode_ptr tc) +CORBA::Any::operator<<= (CORBA::TypeCode_ptr tc) { TAO_OutputCDR stream; stream << tc; @@ -543,7 +541,7 @@ CORBA_Any::operator<<= (CORBA::TypeCode_ptr tc) // Insertion of CORBA::Exception - copying. void -CORBA_Any::operator<<= (const CORBA_Exception &exception) +CORBA::Any::operator<<= (const CORBA::Exception &exception) { ACE_DECLARE_NEW_CORBA_ENV; @@ -571,7 +569,7 @@ CORBA_Any::operator<<= (const CORBA_Exception &exception) // Insertion of CORBA::Exception - non-copying. void -CORBA_Any::operator<<= (CORBA_Exception *exception) +CORBA::Any::operator<<= (CORBA::Exception *exception) { ACE_DECLARE_NEW_CORBA_ENV; @@ -587,7 +585,7 @@ CORBA_Any::operator<<= (CORBA_Exception *exception) stream.begin (), 1, exception, - CORBA_Exception::_tao_any_destructor); + CORBA::Exception::_tao_any_destructor); } ACE_CATCHANY { @@ -628,7 +626,7 @@ CORBA::Any::operator<<= (CORBA::Object_ptr *objptr) // Insertion of from_string. void -CORBA_Any::operator<<= (from_string s) +CORBA::Any::operator<<= (from_string s) { TAO_OutputCDR stream; stream << s; @@ -684,7 +682,7 @@ CORBA_Any::operator<<= (from_string s) } void -CORBA_Any::operator<<= (from_wstring ws) +CORBA::Any::operator<<= (from_wstring ws) { TAO_OutputCDR stream; stream << ws; @@ -742,7 +740,7 @@ CORBA_Any::operator<<= (from_wstring ws) // into. CORBA::Boolean -CORBA_Any::operator>>= (CORBA::Short &s) const +CORBA::Any::operator>>= (CORBA::Short &s) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -773,7 +771,7 @@ CORBA_Any::operator>>= (CORBA::Short &s) const } CORBA::Boolean -CORBA_Any::operator>>= (CORBA::UShort &s) const +CORBA::Any::operator>>= (CORBA::UShort &s) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -807,7 +805,7 @@ CORBA_Any::operator>>= (CORBA::UShort &s) const } CORBA::Boolean -CORBA_Any::operator>>= (CORBA::Long &l) const +CORBA::Any::operator>>= (CORBA::Long &l) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -841,7 +839,7 @@ CORBA_Any::operator>>= (CORBA::Long &l) const } CORBA::Boolean -CORBA_Any::operator>>= (CORBA::ULong &l) const +CORBA::Any::operator>>= (CORBA::ULong &l) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -875,7 +873,7 @@ CORBA_Any::operator>>= (CORBA::ULong &l) const } CORBA::Boolean -CORBA_Any::operator>>= (CORBA::LongLong &l) const +CORBA::Any::operator>>= (CORBA::LongLong &l) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -909,7 +907,7 @@ CORBA_Any::operator>>= (CORBA::LongLong &l) const } CORBA::Boolean -CORBA_Any::operator>>= (CORBA::ULongLong &l) const +CORBA::Any::operator>>= (CORBA::ULongLong &l) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -952,7 +950,7 @@ CORBA_Any::operator>>= (CORBA::ULongLong &l) const } CORBA::Boolean -CORBA_Any::operator>>= (CORBA::Float &f) const +CORBA::Any::operator>>= (CORBA::Float &f) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -986,7 +984,7 @@ CORBA_Any::operator>>= (CORBA::Float &f) const } CORBA::Boolean -CORBA_Any::operator>>= (CORBA::Double &d) const +CORBA::Any::operator>>= (CORBA::Double &d) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1020,7 +1018,7 @@ CORBA_Any::operator>>= (CORBA::Double &d) const } CORBA::Boolean -CORBA_Any::operator>>= (CORBA::LongDouble &ld) const +CORBA::Any::operator>>= (CORBA::LongDouble &ld) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1054,7 +1052,7 @@ CORBA_Any::operator>>= (CORBA::LongDouble &ld) const } CORBA::Boolean -CORBA_Any::operator>>= (CORBA::Any &a) const +CORBA::Any::operator>>= (CORBA::Any &a) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1090,7 +1088,7 @@ CORBA_Any::operator>>= (CORBA::Any &a) const } CORBA::Boolean -CORBA_Any::operator>>= (const CORBA::Any *&a) const +CORBA::Any::operator>>= (const CORBA::Any *&a) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1150,7 +1148,7 @@ CORBA_Any::operator>>= (const CORBA::Any *&a) const } CORBA::Boolean -CORBA_Any::operator>>= (const char *&s) const +CORBA::Any::operator>>= (const char *&s) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1203,7 +1201,7 @@ CORBA_Any::operator>>= (const char *&s) const } void -CORBA_Any::_tao_any_string_destructor (void *x) +CORBA::Any::_tao_any_string_destructor (void *x) { char *tmp = ACE_static_cast (char *, x); CORBA::string_free (tmp); @@ -1217,7 +1215,7 @@ CORBA::Any::_tao_any_wstring_destructor (void *x) } CORBA::Boolean -CORBA_Any::operator>>= (const CORBA::WChar *&s) const +CORBA::Any::operator>>= (const CORBA::WChar *&s) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1279,7 +1277,7 @@ CORBA::Any::_tao_any_tc_destructor (void *x) } CORBA::Boolean -CORBA_Any::operator>>= (CORBA::TypeCode_ptr &tc) const +CORBA::Any::operator>>= (CORBA::TypeCode_ptr &tc) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1334,7 +1332,7 @@ CORBA_Any::operator>>= (CORBA::TypeCode_ptr &tc) const // = extraction into the special types CORBA::Boolean -CORBA_Any::operator>>= (to_boolean b) const +CORBA::Any::operator>>= (to_boolean b) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1368,7 +1366,7 @@ CORBA_Any::operator>>= (to_boolean b) const } CORBA::Boolean -CORBA_Any::operator>>= (to_octet o) const +CORBA::Any::operator>>= (to_octet o) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1402,7 +1400,7 @@ CORBA_Any::operator>>= (to_octet o) const } CORBA::Boolean -CORBA_Any::operator>>= (to_char c) const +CORBA::Any::operator>>= (to_char c) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1436,7 +1434,7 @@ CORBA_Any::operator>>= (to_char c) const } CORBA::Boolean -CORBA_Any::operator>>= (to_wchar wc) const +CORBA::Any::operator>>= (to_wchar wc) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1470,7 +1468,7 @@ CORBA_Any::operator>>= (to_wchar wc) const } CORBA::Boolean -CORBA_Any::operator>>= (to_string s) const +CORBA::Any::operator>>= (to_string s) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1543,7 +1541,7 @@ CORBA_Any::operator>>= (to_string s) const } CORBA::Boolean -CORBA_Any::operator>>= (to_wstring ws) const +CORBA::Any::operator>>= (to_wstring ws) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1616,7 +1614,7 @@ CORBA_Any::operator>>= (to_wstring ws) const } CORBA::Boolean -CORBA_Any::operator>>= (to_object obj) const +CORBA::Any::operator>>= (to_object obj) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1690,7 +1688,7 @@ CORBA_Any::operator>>= (to_object obj) const } CORBA::Boolean -CORBA_Any::operator>>= (to_abstract_base obj) const +CORBA::Any::operator>>= (to_abstract_base obj) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1718,8 +1716,8 @@ CORBA_Any::operator>>= (to_abstract_base obj) const } // @@ This uses ORB_Core instance because we need one to - // demarshal objects (to create the right profiles for that - // object), but the Any does not belong to any ORB. + // demarshal objects (to create the right profiles for that + // object), but the Any does not belong to any ORB. TAO_InputCDR stream (this->cdr_, this->byte_order_, TAO_DEF_GIOP_MAJOR, @@ -1744,7 +1742,7 @@ CORBA_Any::operator>>= (to_abstract_base obj) const } CORBA::Boolean -CORBA_Any::operator>>= (to_value obj) const +CORBA::Any::operator>>= (to_value obj) const { ACE_DECLARE_NEW_CORBA_ENV; @@ -1795,7 +1793,7 @@ CORBA_Any::operator>>= (to_value obj) const // avoid use in Any.i before definition in ORB.i. void -CORBA_Any::operator<<= (const char* s) +CORBA::Any::operator<<= (const char* s) { TAO_OutputCDR stream; stream << s; @@ -1806,7 +1804,7 @@ CORBA_Any::operator<<= (const char* s) // And the version for unbounded wide string. void -CORBA_Any::operator<<= (const CORBA::WChar* s) +CORBA::Any::operator<<= (const CORBA::WChar* s) { TAO_OutputCDR stream; stream << s; @@ -1850,7 +1848,7 @@ operator<< (TAO_OutputCDR& cdr, return 0; } } - ACE_CATCH (CORBA_Exception, ex) + ACE_CATCH (CORBA::Exception, ex) { return 0; } @@ -1912,7 +1910,7 @@ operator>> (TAO_InputCDR &cdr, CORBA::Any &x) cdr.byte_order (), &mb); } - ACE_CATCH (CORBA_Exception, ex) + ACE_CATCH (CORBA::Exception, ex) { return 0; } @@ -1924,7 +1922,7 @@ operator>> (TAO_InputCDR &cdr, CORBA::Any &x) // **************************************************************** CORBA::Any_var & -CORBA_Any_var::operator= (CORBA::Any *p) +CORBA::Any_var::operator= (CORBA::Any *p) { if (this->ptr_ != p) { @@ -1937,9 +1935,9 @@ CORBA_Any_var::operator= (CORBA::Any *p) } CORBA::Any_var & -CORBA_Any_var::operator= (const CORBA::Any_var& r) +CORBA::Any_var::operator= (const CORBA::Any_var& r) { - CORBA_Any_ptr tmp; + CORBA::Any_ptr tmp; ACE_NEW_RETURN (tmp, CORBA::Any (*r.ptr_), diff --git a/TAO/tao/Any.h b/TAO/tao/Any.h index 89e4adf2d91..74c43bf7d24 100644 --- a/TAO/tao/Any.h +++ b/TAO/tao/Any.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -14,506 +14,521 @@ #ifndef TAO_ANY_H #define TAO_ANY_H + #include "ace/pre.h" -#include "tao/CDR.h" +#include "ace/CDR_Stream.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/Environment.h" #include "tao/Object.h" #include "tao/Typecode.h" -/** - * @class CORBA_Any - * - * @brief Class "Any" can wrap values of any type, with the assistance - * of a TypeCode to describe that type. - * - * This includes three constructors, a destructor, and a "replace" - * method for the "Any" data type. "Any" values pair a pointer to - * a data structure in the native binary representation (e.g. C - * struct) with a TypeCode that describes that data structure. - * The copy constructor and the destructor each use the TypeCode - * interpreter with specialized "visit" callback routines. The - * "visit" routines are used respectively to make "deep copies" - * and perform "deep frees" of the aritrary values as described by - * the "Any" value's typecode. - * Note that these "visit" routines are called directly, and they - * choose whether or not to use the TypeCode interpreter to - * examine constituents. In the simple cases, the "visit" - * routines can do their work without any further calls; only for - * constructed types is the interpreter's knowledge really - * required. - * THREADING NOTE: "Any" is a data structure which must be - * protected by external critical sections. Like simpler numeric - * types, "Any" instances are accessed and modified atomically. - * This implementation is reentrant, so that independent "Any" - * values may be manipulated concurrently when the underlying - * programming environment is itself reentrant. - */ -class TAO_Export CORBA_Any -{ -public: - // = Minor codes for exceptional returns - enum +namespace CORBA +{ + /** + * @class Any + * + * @brief Class "Any" can wrap values of any type, with the assistance + * of a TypeCode to describe that type. + * + * This includes three constructors, a destructor, and a "replace" + * method for the "Any" data type. "Any" values pair a pointer to + * a data structure in the native binary representation (e.g. C + * struct) with a TypeCode that describes that data structure. + * The copy constructor and the destructor each use the TypeCode + * interpreter with specialized "visit" callback routines. The + * "visit" routines are used respectively to make "deep copies" + * and perform "deep frees" of the aritrary values as described by + * the "Any" value's typecode. + * Note that these "visit" routines are called directly, and they + * choose whether or not to use the TypeCode interpreter to + * examine constituents. In the simple cases, the "visit" + * routines can do their work without any further calls; only for + * constructed types is the interpreter's knowledge really + * required. + * @par + * THREADING NOTE: "Any" is a data structure which must be + * protected by external critical sections. Like simpler numeric + * types, "Any" instances are accessed and modified atomically. + * This implementation is reentrant, so that independent "Any" + * values may be manipulated concurrently when the underlying + * programming environment is itself reentrant. + */ + class TAO_Export Any { - UNINITIALIZED_type = 0xf000, - VALUE_WITHOUT_TYPE, - UNSUPPORTED_OPERATION - }; + public: - // = Initialization and termination operations. + // = Minor codes for exceptional returns + enum + { + UNINITIALIZED_type = 0xf000, + VALUE_WITHOUT_TYPE, + UNSUPPORTED_OPERATION + }; - /// Default constructor. - CORBA_Any (void); + // = Initialization and termination operations. - /// Constructor. - CORBA_Any (CORBA::TypeCode_ptr type); + /// Default constructor. + Any (void); - // = TAO extension - /** - * Constructor. Used by DynAny and others to optimize Any activities - * by using CDR. The dummy arg is to keep calls like CORBA_Any foo - * (CORBA::TypeCode_ptr bar (NULL), NULL) from being confused with - * the constructor above. - */ - CORBA_Any (CORBA::TypeCode_ptr type, - CORBA::UShort dummy, - int byte_order, - const ACE_Message_Block* mb); + /// Constructor. + Any (CORBA::TypeCode_ptr type); - /// Copy constructor. - CORBA_Any (const CORBA_Any &a); + /// Constructor. + /** + * Constructor used by DynAny and others to optimize Any + * activities by using CDR. The dummy arg is to keep calls like + * CORBA::Any foo (CORBA::TypeCode_ptr bar (0), 0) from being + * confused with the constructor above. + * + * @note This is a TAO-specific constructor. + */ + Any (CORBA::TypeCode_ptr type, + CORBA::UShort dummy, + int byte_order, + const ACE_Message_Block* mb); - /// Destructor. - ~CORBA_Any (void); + /// Copy constructor. + Any (const Any &a); - /// assignment operator - CORBA_Any &operator= (const CORBA_Any &); + /// Destructor. + ~Any (void); - // = NOTE: 94-9-14 has assignment operator plus many insertion, as - // specified below. + /// assignment operator + Any & operator= (const Any &); - // =type safe insertion + // = NOTE: 94-9-14 has assignment operator plus many insertion, as + // specified below. - /// Insert a short. - void operator<<= (CORBA::Short); + // =type safe insertion - /// Insert an unsigned short. - void operator<<= (CORBA::UShort); + /// Insert a short. + void operator<<= (CORBA::Short); - /// Insert a long. - void operator<<= (CORBA::Long); + /// Insert an unsigned short. + void operator<<= (CORBA::UShort); - /// Insert an unsigned long. - void operator<<= (CORBA::ULong); + /// Insert a long. + void operator<<= (CORBA::Long); - /// Insert a long long. - void operator<<= (CORBA::LongLong); + /// Insert an unsigned long. + void operator<<= (CORBA::ULong); - /// Insert an unsigned long long. - void operator<<= (CORBA::ULongLong); + /// Insert a long long. + void operator<<= (CORBA::LongLong); - /// Insert a float. - void operator<<= (CORBA::Float); + /// Insert an unsigned long long. + void operator<<= (CORBA::ULongLong); - /// Insert a double. - void operator<<= (CORBA::Double); + /// Insert a float. + void operator<<= (CORBA::Float); - /// Insert a long double. - void operator<<= (CORBA::LongDouble); + /// Insert a double. + void operator<<= (CORBA::Double); - /// Insert an Any, copying. - void operator<<= (const CORBA_Any&); + /// Insert a long double. + void operator<<= (CORBA::LongDouble); - /// Insert an Any, non-copying. - void operator<<= (CORBA_Any_ptr); + /// Insert an Any, copying. + void operator<<= (const Any &); - /// Insert unbounded string - void operator<<= (const char*); + /// Insert an Any, non-copying. + void operator<<= (CORBA::Any_ptr); - /// Insert unbounded wide string. - void operator<<= (const CORBA::WChar*); + /// Insert unbounded string + void operator<<= (const char*); - /// Insert a TypeCode. - void operator<<= (CORBA::TypeCode_ptr); + /// Insert unbounded wide string. + void operator<<= (const CORBA::WChar *); - /// Insert an object reference, copying. - void operator<<= (const CORBA::Object_ptr); + /// Insert a TypeCode. + void operator<<= (CORBA::TypeCode_ptr); - /// Insert an object reference, non-copying. Any assumes the ownership - /// of the object. - void operator<<= (CORBA::Object_ptr *); + /// Insert an object reference, copying. + void operator<<= (const CORBA::Object_ptr); - // =Type safe extraction. + /// Insert an object reference, non-copying. Any assumes the + /// ownership of the object. + void operator<<= (CORBA::Object_ptr *); - /// Extract a short. - CORBA::Boolean operator>>= (CORBA::Short&) const; + // =Type safe extraction. - /// Extract an unsigned short. - CORBA::Boolean operator>>= (CORBA::UShort&) const; + /// Extract a short. + CORBA::Boolean operator>>= (CORBA::Short&) const; - /// Extract a long. - CORBA::Boolean operator>>= (CORBA::Long&) const; + /// Extract an unsigned short. + CORBA::Boolean operator>>= (CORBA::UShort&) const; - /// Extract an unsigned long. - CORBA::Boolean operator>>= (CORBA::ULong&) const; + /// Extract a long. + CORBA::Boolean operator>>= (CORBA::Long&) const; - /// Extract a long long. - CORBA::Boolean operator>>= (CORBA::LongLong&) const; + /// Extract an unsigned long. + CORBA::Boolean operator>>= (CORBA::ULong&) const; - /// Extract an unsigned long long. - CORBA::Boolean operator>>= (CORBA::ULongLong&) const; + /// Extract a long long. + CORBA::Boolean operator>>= (CORBA::LongLong&) const; - /// Extract a float. - CORBA::Boolean operator>>= (CORBA::Float&) const; + /// Extract an unsigned long long. + CORBA::Boolean operator>>= (CORBA::ULongLong&) const; - /// Extract a double. - CORBA::Boolean operator>>= (CORBA::Double&) const; + /// Extract a float. + CORBA::Boolean operator>>= (CORBA::Float&) const; - /// Extract a long double. - CORBA::Boolean operator>>= (CORBA::LongDouble&) const; + /// Extract a double. + CORBA::Boolean operator>>= (CORBA::Double&) const; - /// Extract an Any. - CORBA::Boolean operator>>= (CORBA_Any&) const; // non-spec - CORBA::Boolean operator>>= (const CORBA_Any*&) const; + /// Extract a long double. + CORBA::Boolean operator>>= (CORBA::LongDouble&) const; - /// Extract a TypeCode. - CORBA::Boolean operator>>= (CORBA::TypeCode_ptr&) const; + /// Extract an Any. + CORBA::Boolean operator>>= (Any &) const; // non-spec + CORBA::Boolean operator>>= (const Any *&) const; - /// Extract an unbounded string - CORBA::Boolean operator>>= (const char*&) const; + /// Extract a TypeCode. + CORBA::Boolean operator>>= (CORBA::TypeCode_ptr&) const; - /// Extract an unbounded wide string. - CORBA::Boolean operator>>= (const CORBA::WChar*&) const; + /// Extract an unbounded string + CORBA::Boolean operator>>= (const char*&) const; - // = Special types. + /// Extract an unbounded wide string. + CORBA::Boolean operator>>= (const CORBA::WChar*&) const; - // These are needed for insertion and extraction of booleans, - // octets, chars, and bounded strings. CORBA spec requires - // that they be here, we just typedef to the already-defined - // ACE_OutputCDR types. + // = Special types. - typedef ACE_OutputCDR::from_boolean from_boolean; - typedef ACE_OutputCDR::from_octet from_octet; - typedef ACE_OutputCDR::from_char from_char; - typedef ACE_OutputCDR::from_wchar from_wchar; - typedef ACE_OutputCDR::from_string from_string; - typedef ACE_OutputCDR::from_wstring from_wstring; + // These are needed for insertion and extraction of booleans, + // octets, chars, and bounded strings. CORBA spec requires + // that they be here, we just typedef to the already-defined + // ACE_OutputCDR types. - /// Insert a boolean. - void operator<<= (from_boolean); + typedef ACE_OutputCDR::from_boolean from_boolean; + typedef ACE_OutputCDR::from_octet from_octet; + typedef ACE_OutputCDR::from_char from_char; + typedef ACE_OutputCDR::from_wchar from_wchar; + typedef ACE_OutputCDR::from_string from_string; + typedef ACE_OutputCDR::from_wstring from_wstring; - /// Insert a char. - void operator<<= (from_char); + /// Insert a boolean. + void operator<<= (from_boolean); - /// Insert a wchar. - void operator<<= (from_wchar); + /// Insert a char. + void operator<<= (from_char); - /// Insert an octet. - void operator<<= (from_octet); + /// Insert a wchar. + void operator<<= (from_wchar); - /// Insert a bounded string. - void operator<<= (from_string); + /// Insert an octet. + void operator<<= (from_octet); - /// Insert a bounded wide string. - void operator<<= (from_wstring); + /// Insert a bounded string. + void operator<<= (from_string); - /// Insert an exception into the Any (copying) - void operator<<= (const CORBA_Exception &exception); + /// Insert a bounded wide string. + void operator<<= (from_wstring); - /// Insert an exception into the Any (non-copying). - void operator<<= (CORBA_Exception *exception); + /// Insert an exception into the Any (copying) + void operator<<= (const CORBA::Exception &exception); - // = Special types. + /// Insert an exception into the Any (non-copying). + void operator<<= (CORBA::Exception *exception); - // These extract octets, chars, booleans, bounded strings, and - // object references. All these are defined in ACE_InputCDR. + // = Special types. - typedef ACE_InputCDR::to_boolean to_boolean; - typedef ACE_InputCDR::to_char to_char; - typedef ACE_InputCDR::to_wchar to_wchar; - typedef ACE_InputCDR::to_octet to_octet; - typedef ACE_InputCDR::to_string to_string; - typedef ACE_InputCDR::to_wstring to_wstring; + // These extract octets, chars, booleans, bounded strings, and + // object references. All these are defined in ACE_InputCDR. - // These are not in ACE. + typedef ACE_InputCDR::to_boolean to_boolean; + typedef ACE_InputCDR::to_char to_char; + typedef ACE_InputCDR::to_wchar to_wchar; + typedef ACE_InputCDR::to_octet to_octet; + typedef ACE_InputCDR::to_string to_string; + typedef ACE_InputCDR::to_wstring to_wstring; - struct TAO_Export to_object - { - // This signature reflects the change set out in - // issue 154 of the 1.3 RTF. - to_object (CORBA_Object_out obj); - CORBA::Object_ptr &ref_; - }; + // These are not in ACE. - struct TAO_Export to_abstract_base - { - to_abstract_base (CORBA_AbstractBase_ptr &obj); - CORBA::AbstractBase_ptr &ref_; + struct TAO_Export to_object + { + // This signature reflects the change set out in + // issue 154 of the 1.3 RTF. + to_object (CORBA::Object_out obj); + CORBA::Object_ptr &ref_; }; - struct TAO_Export to_value - { - to_value (CORBA_ValueBase *&base); - CORBA::ValueBase *&ref_; - }; + struct TAO_Export to_abstract_base + { + to_abstract_base (CORBA::AbstractBase_ptr &obj); + CORBA::AbstractBase_ptr &ref_; + }; + + struct TAO_Export to_value + { + to_value (CORBA::ValueBase *&base); + CORBA::ValueBase *&ref_; + }; + + // Extraction of the special types. + + /// extract a boolean + CORBA::Boolean operator>>= (to_boolean) const; + + /// extract an octet + CORBA::Boolean operator>>= (to_octet) const; + + /// extract a char + CORBA::Boolean operator>>= (to_char) const; + + /// extract a wchar + CORBA::Boolean operator>>= (to_wchar) const; + + /// extract a bounded string + CORBA::Boolean operator>>= (to_string) const; + + /// extract a bounded wide string + CORBA::Boolean operator>>= (to_wstring) const; + + /// extract an object reference + CORBA::Boolean operator>>= (to_object) const; + + /// extract an abstract interface + CORBA::Boolean operator>>= (to_abstract_base) const; + + /// extract a valuetype + CORBA::Boolean operator>>= (to_value) const; + + // the following are unsafe operations + // ORBOS/90-01-11, pg 672: For C++ mapping using the + // CORBA::Environment parameter, two forms of the replace method + // are provided. + + /// Return TypeCode of the element stored in the Any. + CORBA::TypeCode_ptr type (void) const; + + /// For use along with <<= of a value of aliased type when the + /// alias must be preserved. + void type (CORBA::TypeCode_ptr type + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + /** + * Returns 0 if the Any has not been assigned a value, following + * the CORBA spec (ORBOS/98-01-11) it returns a non-zero value + * otherwise. TAO does *not* guarantee that this value may be + * casted to the contained type safely. + */ + const void *value (void) const; + + /** + * @name TAO Extensions + * + * TAO-specific methods. + */ + //@{ + + /** + * Reports whether the Any own the data or not. This is used by the + * >>= operators generated by the IDL compiler. The >>= operator + * checks if the Any owns the data. If it does, then it will simply + * retrieve the data from internal cache. Otherwise, the operator + * will have to decode the cdr string. + */ + CORBA::Boolean any_owns_data (void) const; + + /// Reports whether the Any contains (at some level) a local type. + CORBA::Boolean contains_local (void) const; + + /// Set the member contains_local_. + void contains_local (CORBA::Boolean val); + + /// Message block accessor. + /// Get the byte order inside the CDR stream. + ACE_Message_Block* _tao_get_cdr (void) const; + int _tao_byte_order (void) const; + + /// Generated data types define a 'destructor' function that + /// correctly destroys an object stored in the Any. + typedef void (*_tao_destructor)(void*); + + /// Replace via message block instead of <value_>. + void _tao_replace (CORBA::TypeCode_ptr, + int byte_order, + const ACE_Message_Block *mb); + + /// Replace all the contents of the any, used in the <<= operators. + void _tao_replace (CORBA::TypeCode_ptr type, + int byte_order, + const ACE_Message_Block *mb, + CORBA::Boolean any_owns_data, + void* value, + CORBA::Any::_tao_destructor destructor); + + /// Replace the value of the Any, used in the >>= operators. + void _tao_replace (CORBA::TypeCode_ptr type, + CORBA::Boolean any_owns_data, + void* value, + CORBA::Any::_tao_destructor destructor); + + /// Encode the contents of the Any into <cdr> + void _tao_encode (TAO_OutputCDR &cdr, + TAO_ORB_Core *orb_core + ACE_ENV_ARG_DECL); + + /// Decode the <cdr> using the typecode in the Any object. + void _tao_decode (TAO_InputCDR &cdr + ACE_ENV_ARG_DECL); - // Extraction of the special types. +#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8 + // Useful for template programming. + typedef CORBA::Any_ptr _ptr_type; + typedef CORBA::Any_var _var_type; +#endif /* __GNUC__ */ - /// extract a boolean - CORBA::Boolean operator>>= (to_boolean) const; + // Used to release Anys contained into anys. + static void _tao_any_destructor (void*); + static void _tao_any_string_destructor (void*); + static void _tao_any_wstring_destructor (void*); + static void _tao_any_tc_destructor (void*); - /// extract an octet - CORBA::Boolean operator>>= (to_octet) const; + //@} - /// extract a char - CORBA::Boolean operator>>= (to_char) const; + protected: - /// extract a wchar - CORBA::Boolean operator>>= (to_wchar) const; + /// Release the @c value_. + void free_value (void); - /// extract a bounded string - CORBA::Boolean operator>>= (to_string) const; + private: - /// extract a bounded wide string - CORBA::Boolean operator>>= (to_wstring) const; + /// Typecode for the @c Any. + CORBA::TypeCode_var type_; - /// extract an object reference - CORBA::Boolean operator>>= (to_object) const; + int byte_order_; - /// extract an abstract interface - CORBA::Boolean operator>>= (to_abstract_base) const; + /// encoded value. + ACE_Message_Block *cdr_; - /// extract a valuetype - CORBA::Boolean operator>>= (to_value) const; + /// Flag that indicates the ORB is responsible for deleting the data. + CORBA::Boolean any_owns_data_; - // the following are unsafe operations - // ORBOS/90-01-11, pg 672: For C++ mapping using the CORBA_Environment - // parameter, two forms of the replace method are provided. + /// Flag that indicates the Any contains (at some level) a + /// locality-constrained type, and so cannot be marshaled. + CORBA::Boolean contains_local_; - /// Return TypeCode of the element stored in the Any. - CORBA::TypeCode_ptr type (void) const; + /// Value for the <Any>. + void *value_; - /// For use along with <<= of a value of aliased type when the alias must - /// be preserved. - void type (CORBA::TypeCode_ptr type - ACE_ENV_ARG_DECL_WITH_DEFAULTS); + /// If not zero this is the function used to destroy objects. + CORBA::Any::_tao_destructor destructor_; - /** - * Returns 0 if the Any has not been assigned a value, following the - * CORBA spec (ORBOS/98-01-11) it returns a non-zero value - * otherwise. TAO does *not* guarantee that this value may be casted - * to the contained type safely. - */ - const void *value (void) const; + // 94-9-14 hides unsigned char insert/extract + void operator<<= (unsigned char); + CORBA::Boolean operator>>= (unsigned char&) const; + + friend class CORBA::NVList; + friend class TAO_Marshal_Any; + }; - // = TAO extensions /** - * Reports whether the Any own the data or not. This is used by the - * >>= operators generated by the IDL compiler. The >>= operator - * checks if the Any owns the data. If it does, then it will simply - * retrieve the data from internal cache. Otherwise, the operator - * will have to decode the cdr string. + * @class Any_var + * + * @brief Provide for automatic storage deallocation on going out of + * scope. */ - CORBA::Boolean any_owns_data (void) const; - - /// Reports whether the Any contains (at some level) a local type. - CORBA::Boolean contains_local (void) const; - - /// Set the member contains_local_. - void contains_local (CORBA::Boolean val); - - /// Message block accessor. - /// Get the byte order inside the CDR stream. - ACE_Message_Block* _tao_get_cdr (void) const; - int _tao_byte_order (void) const; - - /// Generated data types define a 'destructor' function that - /// correctly destroys an object stored in the Any. - typedef void (*_tao_destructor)(void*); - - /// Replace via message block instead of <value_>. - void _tao_replace (CORBA::TypeCode_ptr, - int byte_order, - const ACE_Message_Block *mb); - - /// Replace all the contents of the any, used in the <<= operators. - void _tao_replace (CORBA::TypeCode_ptr type, - int byte_order, - const ACE_Message_Block *mb, - CORBA::Boolean any_owns_data, - void* value, - CORBA::Any::_tao_destructor destructor); - - /// Replace the value of the Any, used in the >>= operators. - void _tao_replace (CORBA::TypeCode_ptr type, - CORBA::Boolean any_owns_data, - void* value, - CORBA::Any::_tao_destructor destructor); - - /// Encode the contents of the Any into <cdr> - void _tao_encode (TAO_OutputCDR &cdr, - TAO_ORB_Core *orb_core - ACE_ENV_ARG_DECL); - - /// Decode the <cdr> using the typecode in the Any object. - void _tao_decode (TAO_InputCDR &cdr - ACE_ENV_ARG_DECL); - -#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8 - typedef CORBA_Any_ptr _ptr_type; - typedef CORBA_Any_var _var_type; -#endif /* __GNUC__ */ - // Useful for template programming. - - /// Used to release Anys contained into anys. - static void _tao_any_destructor (void*); - static void _tao_any_string_destructor (void*); - static void _tao_any_wstring_destructor (void*); - static void _tao_any_tc_destructor (void*); - -protected: - /// Release the <value_>. - void free_value (void); + class TAO_Export Any_var + { + public: + /// default constructor + Any_var (void); -private: - /// Typecode for the <Any>. - CORBA::TypeCode_var type_; + /// Construct from an Any pointer + Any_var (CORBA::Any *a); - /// encoded value. - int byte_order_; - ACE_Message_Block *cdr_; + /// Copy constructor + Any_var (const Any_var &a); - /// Flag that indicates the ORB is responsible for deleting the data. - CORBA::Boolean any_owns_data_; + /// destructor + ~Any_var (void); - /// Flag that indicates the Any contains (at some level) a locality- - // constrained type, and so cannot be marshaled. - CORBA::Boolean contains_local_; + /// assignment from a pointer to Any + Any_var &operator= (CORBA::Any *a); - /// Value for the <Any>. - void *value_; + /// assignment from an Any_var + /** + * This operation requires memory allocation. If the allocation + * fails, (*this) is returned unmodified. + */ + Any_var &operator= (const Any_var &a); - /// If not zero this is the function used to destroy objects. - CORBA::Any::_tao_destructor destructor_; + /// arrow operator (smart pointer) + CORBA::Any *operator-> (void); - // 94-9-14 hides unsigned char insert/extract - void operator<<= (unsigned char); - CORBA::Boolean operator>>= (unsigned char&) const; + /// cast + operator CORBA::Any &(); - friend class CORBA_NVList; - friend class TAO_Marshal_Any; -}; + /// cast + operator const CORBA::Any *() const; -/** - * @class CORBA_Any_var - * - * @brief Provide for automatic storage deallocation on going out of - * scope. - */ -class TAO_Export CORBA_Any_var -{ -public: - /// default constructor - CORBA_Any_var (void); + /// cast + operator CORBA::Any *&(); - /// construct from an Any pointer - CORBA_Any_var (CORBA_Any *a); + /// for in Any parameter + const CORBA::Any &in (void) const; - /// copy constructor - CORBA_Any_var (const CORBA_Any_var &a); + /// for inout Any parameter + CORBA::Any &inout (void); - /// destructor - ~CORBA_Any_var (void); + /// for out Any parameter + CORBA::Any *&out (void); - /// assignment from a pointer to Any - CORBA_Any_var &operator= (CORBA_Any *a); + CORBA::Any *_retn (void); + private: + /// Holds the Any. + CORBA::Any *ptr_; + }; /** - * assignment from an Any_var - * This operation requires memory allocation. - * If the allocation fails, *this is returned - * unmodified. + * @class Any_out + * + * @brief Any_out + * + * The _out class for CORBA::Any. This is used to help in managing + * the out parameters. */ - CORBA_Any_var &operator= (const CORBA_Any_var &a); - - /// arrow operator (smart pointer) - CORBA_Any *operator-> (void); - - /// cast - operator CORBA_Any &(); - - /// cast - operator const CORBA_Any *() const; - - /// cast - operator CORBA_Any *&(); - - /// for in Any parameter - const CORBA_Any &in (void) const; - - /// for inout Any parameter - CORBA_Any &inout (void); - - /// for out Any parameter - CORBA_Any *&out (void); - - /// for Any return types - CORBA_Any *_retn (void); - -private: - /// Holds the Any. - CORBA_Any *ptr_; -}; - -/** - * @class CORBA_Any_out - * - * @brief CORBA_Any_out - * - * The _out class for CORBA_Any. This is used to help in - * managing the out parameters. - */ -class TAO_Export CORBA_Any_out -{ -public: - // = operations. + class TAO_Export Any_out + { + public: - /// construction from a reference to a CORBA_Any - CORBA_Any_out (CORBA_Any *&p); + /// construction from a reference to a CORBA::Any + Any_out (CORBA::Any *&p); - /// construction from a var - CORBA_Any_out (CORBA_Any_var &p); + /// construction from a var + Any_out (CORBA::Any_var &p); - /// copy constructor - CORBA_Any_out (const CORBA_Any_out &s); + /// copy constructor + Any_out (const Any_out &s); - /// assignment from a CORBA_Any_out - CORBA_Any_out &operator= (const CORBA_Any_out &s); + /// assignment from a CORBA::Any_out + Any_out &operator= (const Any_out &s); - /// assignment from a CORBA_Any - CORBA_Any_out &operator= (CORBA_Any *p); + /// assignment from a CORBA::Any + Any_out &operator= (CORBA::Any *p); - /// cast - operator CORBA_Any *&(); + /// cast + operator CORBA::Any *&(); - /// return underlying instance - CORBA_Any *& ptr (void); + /// return underlying instance + CORBA::Any *& ptr (void); - CORBA_Any *operator-> (void); + CORBA::Any *operator-> (void); -private: - /// Instance - CORBA_Any *&ptr_; + private: + /// Instance + CORBA::Any *&ptr_; - /// assignment from _var disallowed - void operator= (const CORBA_Any_var &); -}; + /// assignment from _var disallowed + void operator= (const CORBA::Any_var &); + }; +} // End namespace CORBA // These operators are too complex to be inline.... TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR& cdr, @@ -528,85 +543,86 @@ TAO_Export CORBA::Boolean operator>> (TAO_InputCDR& cdr, // Copying versions of insertion // operators which are defined as members of the Any class // must also be defined for Any_var. -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::Short); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::UShort); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::Long); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::ULong); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::LongLong); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::ULongLong); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::Float); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::Double); -TAO_Export void operator<<= (CORBA_Any_var &, - const CORBA_Any&); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, + const CORBA::Any&); +TAO_Export void operator<<= (CORBA::Any_var &, const char*); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::TypeCode_ptr); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, const CORBA::Object_ptr); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::Any::from_boolean); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::Any::from_char); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::Any::from_wchar); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::Any::from_octet); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::Any::from_string); -TAO_Export void operator<<= (CORBA_Any_var &, +TAO_Export void operator<<= (CORBA::Any_var &, CORBA::Any::from_wstring); // These are not required by the spec, but will make users // of other ORBs that are used to them more comfortable. -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::Short&); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::UShort&); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::Long&); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::ULong&); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::LongLong&); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::ULongLong&); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::Float&); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::Double&); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, - CORBA_Any&); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, + CORBA::Any&); +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::TypeCode_ptr&); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, const char*&); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, const CORBA::WChar*&); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::Any::to_boolean); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::Any::to_octet); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::Any::to_char); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::Any::to_wchar); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::Any::to_string); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::Any::to_wstring); -TAO_Export CORBA::Boolean operator>>= (CORBA_Any_var &, +TAO_Export CORBA::Boolean operator>>= (CORBA::Any_var &, CORBA::Any::to_object); #endif /* __ACE_INLINE__ */ #include "ace/post.h" + #endif /* TAO_ANY_H */ diff --git a/TAO/tao/Any.i b/TAO/tao/Any.i index 7afc3814c12..3b3cac24321 100644 --- a/TAO/tao/Any.i +++ b/TAO/tao/Any.i @@ -1,420 +1,421 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- +// // $Id$ // Insertion from special types. ACE_INLINE CORBA::Boolean -CORBA_Any::any_owns_data (void) const +CORBA::Any::any_owns_data (void) const { return (this->any_owns_data_ != 0 && this->value_ != 0); } ACE_INLINE CORBA::Boolean -CORBA_Any::contains_local (void) const +CORBA::Any::contains_local (void) const { return this->contains_local_; } ACE_INLINE void -CORBA_Any::contains_local (CORBA::Boolean val) +CORBA::Any::contains_local (CORBA::Boolean val) { this->contains_local_ = val; } ACE_INLINE ACE_Message_Block* -CORBA_Any::_tao_get_cdr (void) const +CORBA::Any::_tao_get_cdr (void) const { return this->cdr_; } ACE_INLINE int -CORBA_Any::_tao_byte_order (void) const +CORBA::Any::_tao_byte_order (void) const { return this->byte_order_; } ACE_INLINE -CORBA_Any::to_object::to_object (CORBA_Object_out obj) +CORBA::Any::to_object::to_object (CORBA::Object_out obj) : ref_ (obj.ptr ()) { } ACE_INLINE -CORBA_Any::to_abstract_base::to_abstract_base (CORBA_AbstractBase_ptr &obj) +CORBA::Any::to_abstract_base::to_abstract_base (CORBA::AbstractBase_ptr &obj) : ref_ (obj) { } ACE_INLINE -CORBA_Any::to_value::to_value (CORBA_ValueBase *&obj) +CORBA::Any::to_value::to_value (CORBA::ValueBase *&obj) : ref_ (obj) { } // ************************************************************* -// Inline operations for class CORBA_Any_var +// Inline operations for class CORBA::Any_var // ************************************************************* ACE_INLINE -CORBA_Any_var::CORBA_Any_var (void) +CORBA::Any_var::Any_var (void) : ptr_ (0) { } ACE_INLINE -CORBA_Any_var::CORBA_Any_var (CORBA_Any *p) +CORBA::Any_var::Any_var (CORBA::Any *p) : ptr_ (p) { } ACE_INLINE -CORBA_Any_var::CORBA_Any_var (const CORBA_Any_var& r) +CORBA::Any_var::Any_var (const CORBA::Any_var& r) { - CORBA_Any_ptr nptr; + CORBA::Any_ptr nptr; ACE_NEW (nptr, CORBA::Any (*r.ptr_)); this->ptr_ = nptr; } ACE_INLINE -CORBA_Any_var::~CORBA_Any_var (void) +CORBA::Any_var::~Any_var (void) { delete this->ptr_; } ACE_INLINE -CORBA_Any_var::operator CORBA_Any &() +CORBA::Any_var::operator CORBA::Any &() { return *this->ptr_; } ACE_INLINE -CORBA_Any_var::operator CORBA_Any *&() +CORBA::Any_var::operator CORBA::Any *&() { return this->ptr_; } ACE_INLINE -CORBA_Any_var::operator const CORBA_Any *() const +CORBA::Any_var::operator const CORBA::Any *() const { return this->ptr_; } ACE_INLINE CORBA::Any * -CORBA_Any_var::operator-> (void) +CORBA::Any_var::operator-> (void) { return this->ptr_; } -ACE_INLINE const CORBA_Any & -CORBA_Any_var::in (void) const +ACE_INLINE const CORBA::Any & +CORBA::Any_var::in (void) const { return *this->ptr_; } -ACE_INLINE CORBA_Any & -CORBA_Any_var::inout (void) +ACE_INLINE CORBA::Any & +CORBA::Any_var::inout (void) { return *this->ptr_; } -ACE_INLINE CORBA_Any *& -CORBA_Any_var::out (void) +ACE_INLINE CORBA::Any *& +CORBA::Any_var::out (void) { delete this->ptr_; this->ptr_ = 0; return this->ptr_; } -ACE_INLINE CORBA_Any * -CORBA_Any_var::_retn (void) +ACE_INLINE CORBA::Any * +CORBA::Any_var::_retn (void) { - CORBA_Any *temp = this->ptr_; + CORBA::Any *temp = this->ptr_; this->ptr_ = 0; return temp; } // ************************************************************* -// CORBA_Any_var insertion operators +// CORBA::Any_var insertion operators // ************************************************************* ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::Short rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::Short rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::UShort rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::UShort rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::Long rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::Long rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::ULong rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::ULong rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::LongLong rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::LongLong rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::ULongLong rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::ULongLong rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::Float rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::Float rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::Double rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::Double rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, const CORBA_Any& rhs) +operator <<= (CORBA::Any_var &lhs, const CORBA::Any& rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, const char* rhs) +operator <<= (CORBA::Any_var &lhs, const char* rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::TypeCode_ptr rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::TypeCode_ptr rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, const CORBA::Object_ptr rhs) +operator <<= (CORBA::Any_var &lhs, const CORBA::Object_ptr rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::Any::from_boolean rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::Any::from_boolean rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::Any::from_char rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::Any::from_char rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::Any::from_wchar rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::Any::from_wchar rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::Any::from_octet rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::Any::from_octet rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::Any::from_string rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::Any::from_string rhs) { lhs.inout () <<= rhs; } ACE_INLINE void -operator <<= (CORBA_Any_var &lhs, CORBA::Any::from_wstring rhs) +operator <<= (CORBA::Any_var &lhs, CORBA::Any::from_wstring rhs) { lhs.inout () <<= rhs; } // ************************************************************* -// CORBA_Any_var extraction operators +// CORBA::Any_var extraction operators // ************************************************************* ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::Short &rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::Short &rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::UShort &rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::UShort &rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::Long &rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::Long &rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::ULong &rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::ULong &rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::LongLong &rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::LongLong &rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::ULongLong &rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::ULongLong &rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::Float &rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::Float &rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::Double &rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::Double &rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA_Any &rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::Any &rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::TypeCode_ptr &rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::TypeCode_ptr &rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, const char *&rhs) +operator >>= (CORBA::Any_var &lhs, const char *&rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, const CORBA::WChar *&rhs) +operator >>= (CORBA::Any_var &lhs, const CORBA::WChar *&rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::Any::to_boolean rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::Any::to_boolean rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::Any::to_octet rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::Any::to_octet rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::Any::to_char rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::Any::to_char rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::Any::to_wchar rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::Any::to_wchar rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::Any::to_string rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::Any::to_string rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::Any::to_wstring rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::Any::to_wstring rhs) { return lhs.inout () >>= rhs; } ACE_INLINE CORBA::Boolean -operator >>= (CORBA_Any_var &lhs, CORBA::Any::to_object rhs) +operator >>= (CORBA::Any_var &lhs, CORBA::Any::to_object rhs) { return lhs.inout () >>= rhs; } // ************************************************************* -// Inline operations for class CORBA_Any_out +// Inline operations for class CORBA::Any_out // ************************************************************* ACE_INLINE -CORBA_Any_out::CORBA_Any_out (CORBA_Any *&s) +CORBA::Any_out::Any_out (CORBA::Any *&s) : ptr_ (s) { this->ptr_ = 0; } ACE_INLINE -CORBA_Any_out::CORBA_Any_out (CORBA_Any_var &s) +CORBA::Any_out::Any_out (CORBA::Any_var &s) : ptr_ (s.out ()) { } ACE_INLINE -CORBA_Any_out::CORBA_Any_out (const CORBA_Any_out &s) +CORBA::Any_out::Any_out (const CORBA::Any_out &s) : ptr_ (s.ptr_) { } -ACE_INLINE CORBA_Any_out & -CORBA_Any_out::operator= (const CORBA_Any_out &s) +ACE_INLINE CORBA::Any_out & +CORBA::Any_out::operator= (const CORBA::Any_out &s) { this->ptr_ = s.ptr_; return *this; } -ACE_INLINE CORBA_Any_out & -CORBA_Any_out::operator= (CORBA_Any *s) +ACE_INLINE CORBA::Any_out & +CORBA::Any_out::operator= (CORBA::Any *s) { this->ptr_ = s; return *this; } ACE_INLINE -CORBA_Any_out::operator CORBA_Any *&() +CORBA::Any_out::operator CORBA::Any *&() { return this->ptr_; } -ACE_INLINE CORBA_Any *& -CORBA_Any_out::ptr (void) +ACE_INLINE CORBA::Any *& +CORBA::Any_out::ptr (void) { return this->ptr_; } -ACE_INLINE CORBA_Any * -CORBA_Any_out::operator-> (void) +ACE_INLINE CORBA::Any * +CORBA::Any_out::operator-> (void) { return this->ptr_; } diff --git a/TAO/tao/Collocation_Resolver.h b/TAO/tao/Collocation_Resolver.h index 4a048eac6b8..bef36824439 100644 --- a/TAO/tao/Collocation_Resolver.h +++ b/TAO/tao/Collocation_Resolver.h @@ -20,6 +20,7 @@ #include "tao/corbafwd.h" #include "ace/Service_Object.h" +#include "ace/CORBA_macros.h" /** * @class TAO_Collocation_Resolver diff --git a/TAO/tao/Connection_Handler.h b/TAO/tao/Connection_Handler.h index 4b23745d56c..8b0503d206c 100644 --- a/TAO/tao/Connection_Handler.h +++ b/TAO/tao/Connection_Handler.h @@ -51,9 +51,6 @@ public: /// Constructor TAO_Connection_Handler (TAO_ORB_Core *orb_core); - /// Destructor - virtual ~TAO_Connection_Handler (void); - /// Return the underlying transport object TAO_Transport *transport (void); @@ -98,6 +95,13 @@ public: protected: + /// Destructor + /** + * Protected destructor to enforce proper memory management through + * the reference counting mechanism. + */ + virtual ~TAO_Connection_Handler (void); + /// Return our TAO_ORB_Core pointer TAO_ORB_Core *orb_core (void); diff --git a/TAO/tao/Connector_Registry.h b/TAO/tao/Connector_Registry.h index 481b1281a37..dd66fcaa956 100644 --- a/TAO/tao/Connector_Registry.h +++ b/TAO/tao/Connector_Registry.h @@ -25,6 +25,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "Endpoint.h" +#include "ace/CORBA_macros.h" // Forward declarations. class ACE_Addr; diff --git a/TAO/tao/Default_Thread_Lane_Resources_Manager.h b/TAO/tao/Default_Thread_Lane_Resources_Manager.h index 8bc2a47f299..dd6324ad1aa 100644 --- a/TAO/tao/Default_Thread_Lane_Resources_Manager.h +++ b/TAO/tao/Default_Thread_Lane_Resources_Manager.h @@ -44,7 +44,7 @@ public: void finalize (void); /// Open default resources. - int open_default_resources (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); + int open_default_resources (ACE_ENV_SINGLE_ARG_DECL); /// Shutdown reactor. void shutdown_reactor (void); diff --git a/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.h b/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.h index b0c00db0c16..e49c613ccd1 100644 --- a/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.h +++ b/TAO/tao/DynamicInterface/Dynamic_Adapter_Impl.h @@ -56,12 +56,12 @@ public: CORBA::ExceptionList_ptr exceptions, CORBA::Request_ptr &request, CORBA::Flags req_flags - ACE_ENV_ARG_DECL_WITH_DEFAULTS); + ACE_ENV_ARG_DECL); virtual CORBA::Request_ptr request (CORBA::Object_ptr obj, CORBA::ORB_ptr orb, const char *op - ACE_ENV_ARG_DECL_WITH_DEFAULTS); + ACE_ENV_ARG_DECL); // CORBA::is_nil and CORBA::release for Context, Request, and ServerRequest. @@ -80,7 +80,7 @@ public: // CORBA::ORB::create_exception_list. virtual void create_exception_list (CORBA::ExceptionList_ptr &list - ACE_ENV_ARG_DECL_WITH_DEFAULTS); + ACE_ENV_ARG_DECL); // Used to force the initialization of the ORB code. static int Initializer (void); diff --git a/TAO/tao/Dynamic_Adapter.h b/TAO/tao/Dynamic_Adapter.h index 603cdd2eaf8..944ec885e74 100644 --- a/TAO/tao/Dynamic_Adapter.h +++ b/TAO/tao/Dynamic_Adapter.h @@ -22,6 +22,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Service_Object.h" +#include "ace/CORBA_macros.h" class TAO_GIOP_Twoway_Invocation; @@ -50,12 +51,12 @@ public: CORBA::ExceptionList_ptr exceptions, CORBA::Request_ptr &request, CORBA::Flags req_flags - ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0; + ACE_ENV_ARG_DECL) = 0; virtual CORBA::Request_ptr request (CORBA::Object_ptr obj, CORBA::ORB_ptr orb, const char *op - ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0; + ACE_ENV_ARG_DECL) = 0; // CORBA::is_nil and CORBA::release for Context, Request, and ServerRequest. @@ -73,7 +74,7 @@ public: // CORBA::ORB::create_exception_list. virtual void create_exception_list (CORBA::ExceptionList_ptr & - ACE_ENV_ARG_DECL_NOT_USED) = 0; + ACE_ENV_ARG_DECL) = 0; }; #include "ace/post.h" diff --git a/TAO/tao/Endpoint.h b/TAO/tao/Endpoint.h index 71dfacb6bd2..35ab66a7268 100644 --- a/TAO/tao/Endpoint.h +++ b/TAO/tao/Endpoint.h @@ -60,22 +60,31 @@ public: /// <priority_> attribute getter. CORBA::Short priority (void) const; - // = Abstract methods to be implemented by concrete subclasses. - - /// Return true if this endpoint is equivalent to <other_endpoint>. Two - /// endpoints are equivalent iff their port and host are the same. + /** + * @name TAO_Endpoint Template Methods + * + * Abstract methods to be implemented by concrete subclasses. + */ + //@{ + /** + * @return true if this endpoint is equivalent to @a other_endpoint. + */ virtual CORBA::Boolean is_equivalent (const TAO_Endpoint *other_endpoint) = 0; - /// Endpoints can be stringed in a list. Return the next endpoint in - /// the list, if any. + /// Endpoints can be stringed in a list. + /** + * @return The next endpoint in the list, if any. + */ virtual TAO_Endpoint *next (void) = 0; + /// Return a string representation for the address. /** - * Return a string representation for the address. Returns - * -1 if buffer is too small. The purpose of this method is to - * provide a general interface to the underlying address object's - * addr_to_string method. This allows the protocol implementor to - * select the appropriate string format. + * The purpose of this method is to provide a general interface to + * the underlying address object's @c addr_to_string method. This + * allows the protocol implementor to select the appropriate string + * format. + * + * @return -1 if buffer is too small. */ virtual int addr_to_string (char *buffer, size_t length) = 0; @@ -83,8 +92,8 @@ public: /// the hint to be cleaned up and reset to NULL. virtual void reset_hint (void) = 0; - /// This method returns a copy of the corresponding endpoints by - /// allocation memory + /// This method returns a deep copy of the corresponding endpoints by + /// allocating memory. virtual TAO_Endpoint *duplicate (void) = 0; /// Return a hash value for this object. @@ -93,11 +102,13 @@ public: protected: /// Lock for the address lookup. - /// @@todo: This lock should be strategised so that we dont lock in - /// single threaded configurations. I am not able to do this now as - /// most of the information is available in the ORB_Core which is - /// not available here... - TAO_SYNCH_MUTEX addr_lookup_lock_; + /** + * @todo This lock should be strategized so that we dont lock in + * single threaded configurations. It is not possible to do + * this now as most of the information is available in the + * ORB_Core which is not available here. + */ + mutable TAO_SYNCH_MUTEX addr_lookup_lock_; private: @@ -105,6 +116,8 @@ private: ACE_UNIMPLEMENTED_FUNC (TAO_Endpoint (const TAO_Endpoint&)) ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Endpoint&)) +private: + /// IOP tag, identifying the protocol for which this endpoint /// contains addressing info. CORBA::ULong tag_; @@ -116,9 +129,9 @@ private: */ CORBA::Short priority_; - }; + #if defined (__ACE_INLINE__) # include "tao/Endpoint.i" #endif /* __ACE_INLINE__ */ diff --git a/TAO/tao/Endpoint_Selector_Factory.h b/TAO/tao/Endpoint_Selector_Factory.h index c25f2585e3d..46c8bf93b02 100644 --- a/TAO/tao/Endpoint_Selector_Factory.h +++ b/TAO/tao/Endpoint_Selector_Factory.h @@ -20,12 +20,15 @@ #include "ace/pre.h" #include "tao/corbafwd.h" -#include "ace/Service_Object.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "ace/Service_Object.h" +#include "ace/CORBA_macros.h" + + class TAO_GIOP_Invocation; class TAO_Invocation_Endpoint_Selector; diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index 9ac3f504ed7..b46f1b971ba 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -774,10 +774,11 @@ TAO_GIOP_Message_Base::generate_exception_reply ( // Make the GIOP & reply header. this->generate_reply_header (cdr, params); - x._tao_encode (cdr ACE_ENV_ARG_PARAMETER); + x._tao_encode (cdr + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } - ACE_CATCH (CORBA_Exception, ex) + ACE_CATCH (CORBA::Exception, ex) { // Now we know that while handling the error an other error // happened -> no hope, close connection. diff --git a/TAO/tao/GIOP_Message_Generator_Parser_10.cpp b/TAO/tao/GIOP_Message_Generator_Parser_10.cpp index 8a9d0e3e67c..69cda910596 100644 --- a/TAO/tao/GIOP_Message_Generator_Parser_10.cpp +++ b/TAO/tao/GIOP_Message_Generator_Parser_10.cpp @@ -20,7 +20,9 @@ # include "GIOP_Message_Generator_Parser_10.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(tao, GIOP_Message_Gen_Parser_10, "$Id$") +ACE_RCSID (tao, + GIOP_Message_Gen_Parser_10, + "$Id$") int TAO_GIOP_Message_Generator_Parser_10::write_request_header ( @@ -367,7 +369,7 @@ TAO_GIOP_Message_Generator_Parser_10::parse_request_header ( request.requesting_principal (principal.in ()); */ - CORBA_OctetSeq oct_seq; + CORBA::OctetSeq oct_seq; input >> oct_seq; request.requesting_principal (oct_seq); hdr_status = (CORBA::Boolean) input.good_bit (); diff --git a/TAO/tao/GIOP_Message_Lite.cpp b/TAO/tao/GIOP_Message_Lite.cpp index 6395e1afa27..b45949e5ac8 100644 --- a/TAO/tao/GIOP_Message_Lite.cpp +++ b/TAO/tao/GIOP_Message_Lite.cpp @@ -642,7 +642,7 @@ TAO_GIOP_Message_Lite::generate_exception_reply ( x._tao_encode (cdr ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } - ACE_CATCH (CORBA_Exception, ex) + ACE_CATCH (CORBA::Exception, ex) { // Now we know that while handling the error an other error // happened -> no hope, close connection. @@ -1432,7 +1432,7 @@ TAO_GIOP_Message_Lite::send_reply_exception ( x->_tao_encode (output ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } - ACE_CATCH (CORBA_Exception, ex) + ACE_CATCH (CORBA::Exception, ex) { // Now we know that while handling the error an other error // happened -> no hope, close connection. diff --git a/TAO/tao/IFR_Client_Adapter.h b/TAO/tao/IFR_Client_Adapter.h index e4cf97495f6..a725c032b91 100644 --- a/TAO/tao/IFR_Client_Adapter.h +++ b/TAO/tao/IFR_Client_Adapter.h @@ -22,6 +22,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Service_Object.h" +#include "ace/CORBA_macros.h" /** * @class TAO_IFR_Client_Adapter @@ -39,26 +40,25 @@ public: virtual CORBA::Boolean interfacedef_cdr_insert ( TAO_OutputCDR &cdr, - CORBA_InterfaceDef_ptr object_type + CORBA::InterfaceDef_ptr object_type ) = 0; virtual void interfacedef_any_insert ( - CORBA_Any &any, - CORBA_InterfaceDef_ptr object_type + CORBA::Any &any, + CORBA::InterfaceDef_ptr object_type ) = 0; virtual void dispose ( - CORBA_InterfaceDef_ptr orphan + CORBA::InterfaceDef_ptr orphan ) = 0; - virtual CORBA_InterfaceDef_ptr get_interface ( + virtual CORBA::InterfaceDef_ptr get_interface ( CORBA::ORB_ptr orb, const char *repo_id - ACE_ENV_ARG_DECL_WITH_DEFAULTS + ACE_ENV_ARG_DECL ) = 0; - - virtual CORBA_InterfaceDef_ptr get_interface_remote ( + virtual CORBA::InterfaceDef_ptr get_interface_remote ( const CORBA::Object_ptr target ACE_ENV_ARG_DECL ) = 0; diff --git a/TAO/tao/IIOP_Connection_Handler.cpp b/TAO/tao/IIOP_Connection_Handler.cpp index f9af80a8a59..80a94ac6dd4 100644 --- a/TAO/tao/IIOP_Connection_Handler.cpp +++ b/TAO/tao/IIOP_Connection_Handler.cpp @@ -12,6 +12,7 @@ #include "tao/Base_Transport_Property.h" #include "tao/Resume_Handle.h" #include "tao/Protocols_Hooks.h" +#include "tao/Wait_Strategy.h" #if !defined (__ACE_INLINE__) # include "tao/IIOP_Connection_Handler.i" diff --git a/TAO/tao/IIOP_Connection_Handler.h b/TAO/tao/IIOP_Connection_Handler.h index 3750e5441de..bd157821fe9 100644 --- a/TAO/tao/IIOP_Connection_Handler.h +++ b/TAO/tao/IIOP_Connection_Handler.h @@ -21,14 +21,23 @@ #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Acceptor.h" - #include "tao/corbafwd.h" -#include "tao/Wait_Strategy.h" #include "tao/Connection_Handler.h" -#include "tao/IIOP_Transport.h" #include "tao/IIOPC.h" +#include "ace/Svc_Handler.h" +#include "ace/SOCK_Stream.h" + + +// Service Handler for this transport +typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> + TAO_IIOP_SVC_HANDLER; + +#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT +template class TAO_Export ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */ + + // Forward Decls class TAO_Pluggable_Messaging; diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index 43c96e2fbb5..feaaeede5f9 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -10,12 +10,17 @@ #include "Invocation.h" #include "Connect_Strategy.h" #include "Thread_Lane_Resources.h" +#include "Transport.h" +#include "Wait_Strategy.h" + #include "ace/Strategies_T.h" + ACE_RCSID (TAO, IIOP_Connector, "$Id$") + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class TAO_Connect_Concurrency_Strategy<TAO_IIOP_Connection_Handler>; template class TAO_Connect_Creation_Strategy<TAO_IIOP_Connection_Handler>; diff --git a/TAO/tao/IIOP_Endpoint.h b/TAO/tao/IIOP_Endpoint.h index 451ccd78bbf..7cebcd2cde7 100644 --- a/TAO/tao/IIOP_Endpoint.h +++ b/TAO/tao/IIOP_Endpoint.h @@ -1,5 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- - +// -*- C++ -*- //============================================================================= /** @@ -7,8 +6,7 @@ * * $Id$ * - * IIOP implementation of PP Framework Endpoint interface. - * + IIOP implementation of PP Framework Endpoint interface. * * @author Marina Spivak <marina@cs.wustl.edu> */ @@ -17,6 +15,7 @@ #ifndef TAO_IIOP_ENDPOINT_H #define TAO_IIOP_ENDPOINT_H + #include "ace/pre.h" #include "tao/Endpoint.h" @@ -25,7 +24,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/ORB.h" +#include "tao/CORBA_String.h" #include "ace/INET_Addr.h" @@ -43,6 +42,7 @@ class TAO_Export TAO_IIOP_Endpoint : public TAO_Endpoint { public: + // @todo Lose these friends! friend class TAO_IIOP_Profile; friend class TAO_SSLIOP_Profile; @@ -81,12 +81,10 @@ public: /// Return true if this endpoint is equivalent to <other_endpoint>. Two /// endpoints are equivalent iff their port and host are the same. - CORBA::Boolean is_equivalent (const TAO_Endpoint *other_endpoint); + virtual CORBA::Boolean is_equivalent (const TAO_Endpoint *other_endpoint); /// Return a hash value for this object. - CORBA::ULong hash (void); - - // Allocates memory and returns a copy of <this> + virtual CORBA::ULong hash (void); // = IIOP_Endpoint-specific methods. @@ -107,8 +105,8 @@ public: /// Set the port number. CORBA::UShort port (CORBA::UShort p); + /// //TAO_IIOP_Connection_Handler *&hint (void); - // Access to our <hint_>. private: @@ -124,16 +122,18 @@ private: /// Cached instance of <ACE_INET_Addr> for use in making /// invocations, etc. - ACE_INET_Addr object_addr_; + mutable ACE_INET_Addr object_addr_; /// Flag to indicate if the address has been resolved and set. - int object_addr_set_; + mutable int object_addr_set_; /// IIOP Endpoints can be stringed into a list. Return the next /// endpoint in the list, if any. TAO_IIOP_Endpoint *next_; + }; + #if defined (__ACE_INLINE__) # include "tao/IIOP_Endpoint.i" #endif /* __ACE_INLINE__ */ diff --git a/TAO/tao/IIOP_Endpoint.i b/TAO/tao/IIOP_Endpoint.i index ab8738e58d2..896e0142f54 100644 --- a/TAO/tao/IIOP_Endpoint.i +++ b/TAO/tao/IIOP_Endpoint.i @@ -1,4 +1,5 @@ // -*- C++ -*- +// // $Id$ ACE_INLINE const ACE_INET_Addr & @@ -13,20 +14,15 @@ TAO_IIOP_Endpoint::object_addr (void) const // Double checked locking optimization. if (!this->object_addr_set_) { - // We need to modify the object_addr_ in this method. Do so - // using a non-const copy of the <this> pointer. - TAO_IIOP_Endpoint *endpoint = - ACE_const_cast (TAO_IIOP_Endpoint *, this); - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, - endpoint->addr_lookup_lock_, - this->object_addr_ ); + this->addr_lookup_lock_, + this->object_addr_); if (!this->object_addr_set_) { - if (endpoint->object_addr_.set (this->port_, - this->host_.in ()) == -1) + if (this->object_addr_.set (this->port_, + this->host_.in ()) == -1) { // If this call fails, it most likely due a hostname // lookup failure caused by a DNS misconfiguration. If @@ -36,11 +32,11 @@ TAO_IIOP_Endpoint::object_addr (void) const // Invalidate the ACE_INET_Addr. This is used as a flag // to denote that ACE_INET_Addr initialization failed. - endpoint->object_addr_.set_type (-1); + this->object_addr_.set_type (-1); } else { - endpoint->object_addr_set_ = 1; + this->object_addr_set_ = 1; } } } diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp index d825b781352..7b42e6c0828 100644 --- a/TAO/tao/IIOP_Transport.cpp +++ b/TAO/tao/IIOP_Transport.cpp @@ -258,12 +258,14 @@ TAO_IIOP_Transport::send_message (TAO_OutputCDR &stream, } int -TAO_IIOP_Transport::send_message_shared (TAO_Stub *stub, - int message_semantics, - const ACE_Message_Block *message_block, - ACE_Time_Value *max_wait_time) +TAO_IIOP_Transport::send_message_shared ( + TAO_Stub *stub, + int message_semantics, + const ACE_Message_Block *message_block, + ACE_Time_Value *max_wait_time) { int r; + { ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->handler_lock_, -1); @@ -272,7 +274,8 @@ TAO_IIOP_Transport::send_message_shared (TAO_Stub *stub, if (TAO_debug_level > 6) ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - IIOP_Transport::send_message_shared, ") + ACE_TEXT ("TAO (%P|%t) - ") + ACE_TEXT ("IIOP_Transport::send_message_shared, ") ACE_TEXT ("enable_network_priority = %d\n"), this->connection_handler_->enable_network_priority ())); @@ -324,8 +327,8 @@ int TAO_IIOP_Transport::messaging_init (CORBA::Octet major, CORBA::Octet minor) { - this->messaging_object_->init (major, - minor); + this->messaging_object_->init (major, minor); + return 1; } diff --git a/TAO/tao/IIOP_Transport.h b/TAO/tao/IIOP_Transport.h index ede1267e165..91a8ad18ff0 100644 --- a/TAO/tao/IIOP_Transport.h +++ b/TAO/tao/IIOP_Transport.h @@ -1,6 +1,5 @@ - -// This may look like C, but it's really -*- C++ -*- // -*- C++ -*- + // =================================================================== /** * @file IIOP_Transport.h @@ -14,6 +13,7 @@ #ifndef TAO_IIOP_TRANSPORT_H #define TAO_IIOP_TRANSPORT_H + #include "ace/pre.h" #include "tao/Transport.h" @@ -22,11 +22,10 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ - +#include "tao/IIOPC.h" #include "ace/SOCK_Stream.h" #include "ace/Synch.h" -#include "ace/Svc_Handler.h" -#include "tao/IIOPC.h" + // Forward decls. class TAO_IIOP_Connection_Handler; @@ -36,24 +35,15 @@ class TAO_Pluggable_Messaging; class TAO_Acceptor; class TAO_Adapter; -// Service Handler for this transport -typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> - TAO_IIOP_SVC_HANDLER; - -#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT -template class TAO_Export ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */ - /** * @class TAO_IIOP_Transport * * @brief Specialization of the base TAO_Transport class to handle the * IIOP protocol. * - * - * + * Specialization of the base TAO_Transport class to handle the IIOP + * protocol. */ - class TAO_Export TAO_IIOP_Transport : public TAO_Transport { public: @@ -63,10 +53,15 @@ public: TAO_ORB_Core *orb_core, CORBA::Boolean flag); - /// Default destructor. - ~TAO_IIOP_Transport (void); - protected: + + /// Destructor + /** + * Protected destructor to enforce proper memory management through + * the reference counting mechanism. + */ + virtual ~TAO_IIOP_Transport (void); + /** @name Overridden Template Methods * * Please check the documentation in "tao/Transport.h" for more @@ -146,9 +141,11 @@ private: TAO_Pluggable_Messaging *messaging_object_; }; + #if defined (__ACE_INLINE__) #include "tao/IIOP_Transport.i" #endif /* __ACE_INLINE__ */ #include "ace/post.h" + #endif /* TAO_IIOP_TRANSPORT_H */ diff --git a/TAO/tao/IOPC.h b/TAO/tao/IOPC.h index ea882509ce4..883fda141e8 100644 --- a/TAO/tao/IOPC.h +++ b/TAO/tao/IOPC.h @@ -1375,7 +1375,7 @@ TAO_NAMESPACE IOP #define _IOP_CODEC_CH_ class TAO_Export Codec - : public virtual CORBA_Object + : public virtual CORBA::Object { public: #if !defined(__GNUC__) || !defined (ACE_HAS_GNUG_PRE_2_8) @@ -1738,7 +1738,7 @@ static ::CORBA::TypeCode_ptr _tc_TypeMismatch; #define _IOP_CODECFACTORY_CH_ class TAO_Export CodecFactory - : public virtual CORBA_Object + : public virtual CORBA::Object { public: #if !defined(__GNUC__) || !defined (ACE_HAS_GNUG_PRE_2_8) diff --git a/TAO/tao/Invocation_Endpoint_Selectors.h b/TAO/tao/Invocation_Endpoint_Selectors.h index 6701bce3e05..7c6ae96c98d 100644 --- a/TAO/tao/Invocation_Endpoint_Selectors.h +++ b/TAO/tao/Invocation_Endpoint_Selectors.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -24,6 +24,9 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "ace/CORBA_macros.h" + + class TAO_MProfile; class TAO_GIOP_Invocation; @@ -37,9 +40,10 @@ class TAO_GIOP_Invocation; * Selects/reselects server endpoint for an Invocation. Different * concrete strategies perform selection based on different * policies. + * @par * All endpoint selection strategies are stateless objects - any * necessary state is stored in Invocation's - * <endpoint_selection_state_>. + * @c endpoint_selection_state_. */ class TAO_Export TAO_Invocation_Endpoint_Selector { @@ -50,20 +54,20 @@ public: /// Destructor. virtual ~TAO_Invocation_Endpoint_Selector (void); - /// Select the endpoint and set <invocation>'s <profile_> and - /// <endpoint_> data members accordingly. + /// Select the endpoint and set @a invocation's @c profile_ and + /// @c endpoint_ data members accordingly. virtual void select_endpoint (TAO_GIOP_Invocation *invocation - ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0; + ACE_ENV_ARG_DECL) = 0; /** * This method must be called if the invocation attempt on a * selected endpoint resulted in location forward. This method - * performs the necessary state updates, so that next <select_endpoint> - * call picks a new endpoint. + * performs the necessary state updates, so that next @c + * select_endpoint call picks a new endpoint. */ virtual void forward (TAO_GIOP_Invocation *invocation, const TAO_MProfile &mprofile - ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0; + ACE_ENV_ARG_DECL) = 0; /// Update the state to indicate that the selected endpoint/profile /// were used successfully. diff --git a/TAO/tao/LF_Event_Loop_Thread_Helper.h b/TAO/tao/LF_Event_Loop_Thread_Helper.h index 5edde3028b1..5d063d3d5d2 100644 --- a/TAO/tao/LF_Event_Loop_Thread_Helper.h +++ b/TAO/tao/LF_Event_Loop_Thread_Helper.h @@ -14,13 +14,13 @@ #define TAO_LF_EVENT_LOOP_THREAD_HELPER_H #include "ace/pre.h" -#include "tao/orbconf.h" #include "tao/LF_Strategy.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ + /** * @brief Helper class to enter and exit the Leader/Followers event * loop. diff --git a/TAO/tao/LF_Event_Loop_Thread_Helper.inl b/TAO/tao/LF_Event_Loop_Thread_Helper.inl index d3db7e44eea..62b5eada2d5 100644 --- a/TAO/tao/LF_Event_Loop_Thread_Helper.inl +++ b/TAO/tao/LF_Event_Loop_Thread_Helper.inl @@ -1,3 +1,5 @@ +// -*- C++ -*- +// // $Id$ ACE_INLINE @@ -25,4 +27,3 @@ TAO_LF_Event_Loop_Thread_Helper::event_loop_return (void) const { return this->event_loop_return_; } - diff --git a/TAO/tao/Leader_Follower.h b/TAO/tao/Leader_Follower.h index 2d0d516c8bc..29fdcab70f5 100644 --- a/TAO/tao/Leader_Follower.h +++ b/TAO/tao/Leader_Follower.h @@ -26,9 +26,15 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ class TAO_LF_Event; -class TAO_New_Leader_Generator; class TAO_Transport; +/** + * @class TAO_Leader_Follower + * + * @brief TAO_Leader_Follower + * + * TAO_Leader_Follower + */ class TAO_Export TAO_Leader_Follower { public: diff --git a/TAO/tao/MCAST_Parser.cpp b/TAO/tao/MCAST_Parser.cpp index 5ab85188a43..61d4e7efc13 100644 --- a/TAO/tao/MCAST_Parser.cpp +++ b/TAO/tao/MCAST_Parser.cpp @@ -1,13 +1,12 @@ -// $Id$ - #include "MCAST_Parser.h" #include "default_ports.h" -#include "tao/Object_Loader.h" -#include "tao/Object.h" -#include "tao/ORB.h" -#include "tao/Exception.h" -#include "tao/Environment.h" -#include "tao/debug.h" +#include "Object_Loader.h" +#include "Object.h" +#include "ORB_Core.h" +#include "Exception.h" +#include "Environment.h" +#include "debug.h" + #include "ace/Read_Buffer.h" #include "ace/INET_Addr.h" #include "ace/SOCK_Acceptor.h" @@ -18,13 +17,18 @@ #include "MCAST_Parser.i" #endif /* __ACE_INLINE__ */ -ACE_RCSID(tao, MCAST_Parser, "$Id$") + +ACE_RCSID (tao, + MCAST_Parser, + "$Id$") + + +static const char mcast_prefix[] = "mcast:"; TAO_MCAST_Parser::~TAO_MCAST_Parser (void) { } -static const char mcast_prefix[] = "mcast:"; int TAO_MCAST_Parser::match_prefix (const char *ior_string) const @@ -69,7 +73,7 @@ TAO_MCAST_Parser::parse_string (const char *ior, return object; } -CORBA_Object_ptr +CORBA::Object_ptr TAO_MCAST_Parser::multicast_to_service (const char *service_name, u_short port, const char *mcast_address, @@ -84,8 +88,8 @@ TAO_MCAST_Parser::multicast_to_service (const char *service_name, CORBA::String_var cleaner; - CORBA_Object_var return_value = - CORBA_Object::_nil (); + CORBA::Object_var return_value = + CORBA::Object::_nil (); // Use UDP multicast to locate the service. int result = this->multicast_query (ior, @@ -107,8 +111,8 @@ TAO_MCAST_Parser::multicast_to_service (const char *service_name, // Convert IOR to an object reference. return_value = orb->string_to_object (ior - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CORBA_Object::_nil ()); + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); } // Return object reference. diff --git a/TAO/tao/MCAST_Parser.h b/TAO/tao/MCAST_Parser.h index 7ff1edbd784..ba955c68fe6 100644 --- a/TAO/tao/MCAST_Parser.h +++ b/TAO/tao/MCAST_Parser.h @@ -16,12 +16,13 @@ #include "ace/pre.h" #include "tao/IOR_Parser.h" -#include "tao/ORB_Core.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/CORBA_String.h" + #include "ace/Service_Config.h" /** @@ -55,14 +56,14 @@ public: private: - CORBA_Object_ptr multicast_to_service (const char *service_name, - CORBA::UShort port, - const char *mcast_address, - const char *mcast_ttl, - const char *mcast_nic, - CORBA::ORB_ptr orb, - ACE_Time_Value *timeout - ACE_ENV_ARG_DECL_NOT_USED); + CORBA::Object_ptr multicast_to_service (const char *service_name, + CORBA::UShort port, + const char *mcast_address, + const char *mcast_ttl, + const char *mcast_nic, + CORBA::ORB_ptr orb, + ACE_Time_Value *timeout + ACE_ENV_ARG_DECL_NOT_USED); int multicast_query (char *&buf, const char *service_name, diff --git a/TAO/tao/Marshal.h b/TAO/tao/Marshal.h index f3e4313f768..4ff53bf42c9 100644 --- a/TAO/tao/Marshal.h +++ b/TAO/tao/Marshal.h @@ -25,9 +25,6 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/Typecode.h" -#include "tao/Principal.h" -#include "tao/Any.h" -#include "tao/ORB.h" class TAO_OutputCDR; class TAO_InputCDR; diff --git a/TAO/tao/ORBInitInfo.h b/TAO/tao/ORBInitInfo.h index 31cddd57891..62287742289 100644 --- a/TAO/tao/ORBInitInfo.h +++ b/TAO/tao/ORBInitInfo.h @@ -59,7 +59,7 @@ class TAO_Export TAO_ORBInitInfo : friend CORBA::ORB_ptr CORBA::ORB_init (int &, char *argv[], const char *, - CORBA_Environment &); + CORBA::Environment &); public: diff --git a/TAO/tao/ORBInitializer_Registry.cpp b/TAO/tao/ORBInitializer_Registry.cpp index 0d5e0aa25ac..b50dfb3c427 100644 --- a/TAO/tao/ORBInitializer_Registry.cpp +++ b/TAO/tao/ORBInitializer_Registry.cpp @@ -21,7 +21,8 @@ PortableInterceptor::register_orb_initializer ( // Using ACE_Static_Object_Lock::instance() precludes // <register_orb_initializer> from being called within a static // object CTOR. - ACE_MT (ACE_GUARD (TAO_SYNCH_RECURSIVE_MUTEX, guard, + ACE_MT (ACE_GUARD (TAO_SYNCH_RECURSIVE_MUTEX, + guard, *ACE_Static_Object_Lock::instance ())); // Make sure TAO's singleton manager is initialized. @@ -32,7 +33,7 @@ PortableInterceptor::register_orb_initializer ( ACE_TEXT ("Unable to pre-initialize TAO\n"))); } - CORBA_ORB::init_orb_globals (ACE_ENV_SINGLE_ARG_PARAMETER); + CORBA::ORB::init_orb_globals (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; // Make sure the following is done after the global ORB @@ -40,7 +41,7 @@ PortableInterceptor::register_orb_initializer ( TAO_ORBInitializer_Registry::instance ()->register_orb_initializer ( init - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); } // ------------------------------------------------------------------ @@ -50,13 +51,6 @@ TAO_ORBInitializer_Registry::TAO_ORBInitializer_Registry (void) { } -TAO_ORBInitializer_Registry::~TAO_ORBInitializer_Registry (void) -{ - size_t initializer_count = this->initializers_.size (); - for (size_t i = 0; i < initializer_count; ++i) - CORBA::release (this->initializers_[i]); -} - void TAO_ORBInitializer_Registry::register_orb_initializer ( PortableInterceptor::ORBInitializer_ptr init @@ -65,21 +59,18 @@ TAO_ORBInitializer_Registry::register_orb_initializer ( if (!CORBA::is_nil (init)) { // Increase the length of the ORBInitializer array by one. - size_t cur_len = this->initializers_.size (); - size_t new_len = cur_len + 1; + const size_t cur_len = this->initializers_.size (); + const size_t new_len = cur_len + 1; if (this->initializers_.size (new_len) != 0) ACE_THROW (CORBA::INTERNAL ()); - // @@ Do we need to duplicate the reference to the - // ORBInitializer? - // Add the given ORBInitializer to the sequence. this->initializers_[cur_len] = PortableInterceptor::ORBInitializer::_duplicate (init); } else ACE_THROW (CORBA::INV_OBJREF ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EINVAL), CORBA::COMPLETED_NO)); @@ -90,7 +81,7 @@ TAO_ORBInitializer_Registry::pre_init ( PortableInterceptor::ORBInitInfo_ptr info ACE_ENV_ARG_DECL) { - size_t initializer_count = this->initializers_.size (); + const size_t initializer_count = this->initializers_.size (); for (size_t i = 0; i < initializer_count; ++i) { this->initializers_[i]->pre_init (info @@ -104,7 +95,7 @@ TAO_ORBInitializer_Registry::post_init ( PortableInterceptor::ORBInitInfo_ptr info ACE_ENV_ARG_DECL) { - size_t initializer_count = this->initializers_.size (); + const size_t initializer_count = this->initializers_.size (); for (size_t i = 0; i < initializer_count; ++i) { this->initializers_[i]->post_init (info diff --git a/TAO/tao/ORBInitializer_Registry.h b/TAO/tao/ORBInitializer_Registry.h index 7516db45f8d..49ff5d6620b 100644 --- a/TAO/tao/ORBInitializer_Registry.h +++ b/TAO/tao/ORBInitializer_Registry.h @@ -15,7 +15,7 @@ #include "ace/pre.h" -#include "TAO_Export.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -38,15 +38,15 @@ * MS Windows DLL environments due to the occurance of multiple * singleton instances. There should only be one! */ -class TAO_Export TAO_ORBInitializer_Registry +class TAO_ORBInitializer_Registry { friend void PortableInterceptor::register_orb_initializer ( PortableInterceptor::ORBInitializer_ptr init - ACE_ENV_ARG_DECL_NOT_USED); + ACE_ENV_ARG_DECL_WITH_DEFAULTS); friend CORBA::ORB_ptr CORBA::ORB_init (int &, char *argv[], const char *, - CORBA_Environment &); + CORBA::Environment &); public: @@ -58,9 +58,6 @@ public: */ TAO_ORBInitializer_Registry (void); - /// Destructor. Releases duplicated ORBInitializer references. - ~TAO_ORBInitializer_Registry (void); - protected: /// Register an ORBInitializer with the underlying ORBInitializer @@ -92,7 +89,7 @@ private: private: /// Dynamic array containing registered ORBInitializers. - ACE_Array_Base<PortableInterceptor::ORBInitializer_ptr> initializers_; + ACE_Array_Base<PortableInterceptor::ORBInitializer_var> initializers_; }; diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index ce42819ee21..db54a0caf3c 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -193,7 +193,7 @@ class TAO_Export TAO_ORB_Core friend CORBA::ORB_ptr CORBA::ORB_init (int &, char *argv[], const char *, - CORBA_Environment &); + CORBA::Environment &); public: /// Constructor. @@ -374,8 +374,10 @@ public: //@} - /// Sets the value of TAO_ORB_Core::thread_lane_resources_manager_factory_name_ - static void set_thread_lane_resources_manager_factory (const char *thread_lane_resources_manager_factory_name); + /// Sets the value of + /// TAO_ORB_Core::thread_lane_resources_manager_factory_name_ + static void set_thread_lane_resources_manager_factory (const char * + thread_lane_resources_manager_factory_name); /// Sets the value of TAO_ORB_Core::collocation_resolver_name_ static void set_collocation_resolver (const char *collocation_resolver_name); @@ -530,8 +532,8 @@ public: * tradeoffs and take a decision. */ //@{ - CORBA_Environment *default_environment (void) const; - void default_environment (CORBA_Environment*); + CORBA::Environment *default_environment (void) const; + void default_environment (CORBA::Environment*); //@} #if (TAO_HAS_CORBA_MESSAGING == 1) @@ -718,15 +720,15 @@ public: CORBA::Object_ptr resolve_dynanyfactory (ACE_ENV_SINGLE_ARG_DECL); /// Resolve the IOR Manipulation reference for this ORB. - CORBA::Object_ptr resolve_ior_manipulation (ACE_ENV_SINGLE_ARG_DECL_NOT_USED); + CORBA::Object_ptr resolve_ior_manipulation (ACE_ENV_SINGLE_ARG_DECL); /// Resolve the IOR Table reference for this ORB. - CORBA::Object_ptr resolve_ior_table (ACE_ENV_SINGLE_ARG_DECL_NOT_USED); + CORBA::Object_ptr resolve_ior_table (ACE_ENV_SINGLE_ARG_DECL); /// Resolve an initial reference via the -ORBInitRef and // -ORBDefaultInitRef options. CORBA::Object_ptr resolve_rir (const char *name - ACE_ENV_ARG_DECL_NOT_USED); + ACE_ENV_ARG_DECL); /// Resolve the RT ORB reference for this ORB. CORBA::Object_ptr resolve_rt_orb (ACE_ENV_SINGLE_ARG_DECL); @@ -742,7 +744,8 @@ public: void portable_group_poa_hooks(TAO_POA_PortableGroup_Hooks *poa_hooks); /// List all the service known by the ORB - CORBA_ORB_ObjectIdList_ptr list_initial_references (ACE_ENV_SINGLE_ARG_DECL_NOT_USED); + CORBA::ORB::ObjectIdList_ptr list_initial_references ( + ACE_ENV_SINGLE_ARG_DECL); /// Reference counting... CORBA::ULong _incr_refcnt (void); @@ -758,7 +761,6 @@ public: /// destruction. int remove_handle (ACE_HANDLE handle); - /** * @name ORB Core Service Hooks * @@ -833,7 +835,6 @@ public: void services_log_msg_post_upcall (TAO_ServerRequest &req); //@} - /** * @name Portable Interceptor Related Methods * @@ -1362,47 +1363,6 @@ private: // **************************************************************** /** - * @class TAO_ORB_Core_Auto_Ptr - * - * @brief Define a TAO_ORB_Core auto_ptr class. - * - * This class is used as an aid to make ORB initialization exception - * safe. It ensures that the ORB core is deallocated if an exception - * is thrown. - * - * @todo - * TAO_ORB_Core_Auto_Ptr should be renamed to TAO_ORB_Core_var - * since the ORB Core is reference counted. - */ -class TAO_Export TAO_ORB_Core_Auto_Ptr -{ -public: - - /// Initialization and termination methods - //@{ - /* explicit */ TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core *p = 0); - TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core_Auto_Ptr &ap); - TAO_ORB_Core_Auto_Ptr &operator= (TAO_ORB_Core_Auto_Ptr &rhs); - ~TAO_ORB_Core_Auto_Ptr (void); - //@} - - /// Accessor methods. - //@{ - TAO_ORB_Core &operator *() const; - TAO_ORB_Core *get (void) const; - TAO_ORB_Core *release (void); - void reset (TAO_ORB_Core *p = 0); - TAO_ORB_Core *operator-> () const; - //@} - -protected: - - TAO_ORB_Core *p_; - -}; - -// **************************************************************** -/** * @class TAO_TSS_Resources * * @brief The TSS resoures shared by all the ORBs @@ -1443,11 +1403,11 @@ public: void *poa_current_impl_; /// The default environment for the thread. - CORBA_Environment *default_environment_; + CORBA::Environment *default_environment_; /// If the user (or library) provides no environment the ORB_Core /// still holds one. - CORBA_Environment tss_environment_; + CORBA::Environment tss_environment_; #if (TAO_HAS_CORBA_MESSAGING == 1) diff --git a/TAO/tao/ORB_Core.i b/TAO/tao/ORB_Core.i index 6755140d7bf..ce46ef7f0bb 100644 --- a/TAO/tao/ORB_Core.i +++ b/TAO/tao/ORB_Core.i @@ -1,4 +1,5 @@ // -*- C++ -*- +// // $Id$ ACE_INLINE CORBA::ULong @@ -512,14 +513,14 @@ TAO_ORB_Core::get_default_policies (void) #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ -ACE_INLINE CORBA_Environment * +ACE_INLINE CORBA::Environment * TAO_ORB_Core::default_environment (void) const { return TAO_TSS_RESOURCES::instance ()->default_environment_; } ACE_INLINE void -TAO_ORB_Core::default_environment (CORBA_Environment *env) +TAO_ORB_Core::default_environment (CORBA::Environment *env) { TAO_TSS_RESOURCES::instance ()->default_environment_ = env; } @@ -637,80 +638,3 @@ TAO_ORB_Core::ior_interceptors (void) { return this->ior_interceptors_.interceptors (); } - -// **************************************************************** - -ACE_INLINE -TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core *p) - : p_ (p) -{ - ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr"); -} - -ACE_INLINE TAO_ORB_Core * -TAO_ORB_Core_Auto_Ptr::get (void) const -{ - ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::get"); - return this->p_; -} - -ACE_INLINE TAO_ORB_Core * -TAO_ORB_Core_Auto_Ptr::release (void) -{ - ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::release"); - TAO_ORB_Core *old = this->p_; - this->p_ = 0; - return old; -} - -ACE_INLINE void -TAO_ORB_Core_Auto_Ptr::reset (TAO_ORB_Core *p) -{ - ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::reset"); - if (this->get () != p && this->get () != 0) - this->get ()->_decr_refcnt (); - this->p_ = p; -} - -ACE_INLINE TAO_ORB_Core * -TAO_ORB_Core_Auto_Ptr::operator-> () const -{ - ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::operator->"); - return this->get (); -} - -ACE_INLINE -TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core_Auto_Ptr &rhs) - : p_ (rhs.release ()) -{ - ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr"); -} - -ACE_INLINE TAO_ORB_Core_Auto_Ptr & -TAO_ORB_Core_Auto_Ptr::operator= (TAO_ORB_Core_Auto_Ptr &rhs) -{ - ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::operator="); - if (this != &rhs) - { - this->reset (rhs.release ()); - } - return *this; -} - -ACE_INLINE -TAO_ORB_Core_Auto_Ptr::~TAO_ORB_Core_Auto_Ptr (void) -{ - ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::~TAO_ORB_Core_Auto_Ptr"); - if (this->get() != 0) - this->get ()->_decr_refcnt (); -} - -// Accessor methods to the underlying ORB_Core Object - -ACE_INLINE TAO_ORB_Core & -TAO_ORB_Core_Auto_Ptr::operator *() const -{ - ACE_TRACE ("TAO_ORB_Core_Auto_Ptr::operator *()"); - // @@ Potential problem if this->p_ is zero! - return *this->get (); -} diff --git a/TAO/tao/ORB_Core_Auto_Ptr.cpp b/TAO/tao/ORB_Core_Auto_Ptr.cpp new file mode 100644 index 00000000000..597ea1aa816 --- /dev/null +++ b/TAO/tao/ORB_Core_Auto_Ptr.cpp @@ -0,0 +1,26 @@ +#include "ORB_Core_Auto_Ptr.h" +#include "ORB_Core.h" + +#if !defined (__ACE_INLINE__) +# include "ORB_Core_Auto_Ptr.inl" +#endif /* !__ACE_INLINE */ + + +ACE_RCSID (tao, + ORB_Core_Auto_Ptr, + "$Id$") + + +TAO_ORB_Core_Auto_Ptr::~TAO_ORB_Core_Auto_Ptr (void) +{ + if (this->get() != 0) + this->get ()->_decr_refcnt (); +} + +void +TAO_ORB_Core_Auto_Ptr::reset (TAO_ORB_Core *p) +{ + if (this->get () != p && this->get () != 0) + this->get ()->_decr_refcnt (); + this->p_ = p; +} diff --git a/TAO/tao/ORB_Core_Auto_Ptr.h b/TAO/tao/ORB_Core_Auto_Ptr.h new file mode 100644 index 00000000000..65f232cf4ea --- /dev/null +++ b/TAO/tao/ORB_Core_Auto_Ptr.h @@ -0,0 +1,70 @@ +// -*- C++ -*- + +// =================================================================== +/** + * @file ORB_Core.h + * + * $Id$ + * + * @author DOC Center - Washington University at St. Louis + * @author DOC Laboratory - University of California at Irvine + */ +// =================================================================== + +#ifndef TAO_ORB_CORE_AUTO_PTR_H +#define TAO_ORB_CORE_AUTO_PTR_H + +#include "ace/pre.h" + +#include "tao/TAO_Export.h" + + +class TAO_ORB_Core; + +/** + * @class TAO_ORB_Core_Auto_Ptr + * + * @brief Define a TAO_ORB_Core auto_ptr class. + * + * This class is used as an aid to make ORB initialization exception + * safe. It ensures that the ORB core is deallocated if an exception + * is thrown. + * + * @todo + * TAO_ORB_Core_Auto_Ptr should be renamed to TAO_ORB_Core_var + * since the ORB Core is reference counted. + */ +class TAO_Export TAO_ORB_Core_Auto_Ptr +{ +public: + + /// Initialization and termination methods + //@{ + /* explicit */ TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core *p = 0); + TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core_Auto_Ptr &ap); + TAO_ORB_Core_Auto_Ptr &operator= (TAO_ORB_Core_Auto_Ptr &rhs); + ~TAO_ORB_Core_Auto_Ptr (void); + //@} + + /// Accessor methods. + //@{ + TAO_ORB_Core &operator *() const; + TAO_ORB_Core *get (void) const; + TAO_ORB_Core *release (void); + void reset (TAO_ORB_Core *p = 0); + TAO_ORB_Core *operator-> () const; + //@} + +protected: + + TAO_ORB_Core *p_; + +}; + +#if defined (__ACE_INLINE__) +# include "ORB_Core_Auto_Ptr.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" + +#endif /* TAO_ORB_CORE_AUTO_PTR_H */ diff --git a/TAO/tao/ORB_Core_Auto_Ptr.inl b/TAO/tao/ORB_Core_Auto_Ptr.inl new file mode 100644 index 00000000000..50cc45b0bb5 --- /dev/null +++ b/TAO/tao/ORB_Core_Auto_Ptr.inl @@ -0,0 +1,54 @@ +// -*- C++ -*- +// +// $Id$ + +ACE_INLINE +TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core *p) + : p_ (p) +{ +} + +ACE_INLINE TAO_ORB_Core * +TAO_ORB_Core_Auto_Ptr::get (void) const +{ + return this->p_; +} + +ACE_INLINE TAO_ORB_Core * +TAO_ORB_Core_Auto_Ptr::release (void) +{ + TAO_ORB_Core *old = this->p_; + this->p_ = 0; + return old; +} + +ACE_INLINE TAO_ORB_Core * +TAO_ORB_Core_Auto_Ptr::operator-> () const +{ + return this->get (); +} + +ACE_INLINE +TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core_Auto_Ptr &rhs) + : p_ (rhs.release ()) +{ +} + +ACE_INLINE TAO_ORB_Core_Auto_Ptr & +TAO_ORB_Core_Auto_Ptr::operator= (TAO_ORB_Core_Auto_Ptr &rhs) +{ + if (this != &rhs) + { + this->reset (rhs.release ()); + } + return *this; +} + +// Accessor methods to the underlying ORB_Core Object + +ACE_INLINE TAO_ORB_Core & +TAO_ORB_Core_Auto_Ptr::operator *() const +{ + // @@ Potential problem if this->p_ is zero! + return *this->get (); +} diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp index 6b40ff23251..57865a54491 100644 --- a/TAO/tao/Object.cpp +++ b/TAO/tao/Object.cpp @@ -4,7 +4,7 @@ // Copyright 1997-2002 by Washington University // All Rights Reserved // -// ORB: CORBA_Object operations +// ORB: CORBA::Object operations #include "tao/Object.h" #include "tao/Stub.h" @@ -27,9 +27,9 @@ ACE_RCSID (tao, Object, "$Id$") -int CORBA_Object::_tao_class_id = 0; +int CORBA::Object::_tao_class_id = 0; -CORBA_Object::~CORBA_Object (void) +CORBA::Object::~Object (void) { if (this->protocol_proxy_) (void) this->protocol_proxy_->_decr_refcnt (); @@ -37,9 +37,9 @@ CORBA_Object::~CORBA_Object (void) delete this->refcount_lock_; } -CORBA_Object::CORBA_Object (TAO_Stub * protocol_proxy, - CORBA::Boolean collocated, - TAO_Abstract_ServantBase * servant) +CORBA::Object::Object (TAO_Stub * protocol_proxy, + CORBA::Boolean collocated, + TAO_Abstract_ServantBase * servant) : is_collocated_ (collocated), servant_ (servant), is_local_ (protocol_proxy == 0 ? 1 : 0), @@ -69,7 +69,7 @@ CORBA_Object::CORBA_Object (TAO_Stub * protocol_proxy, } void -CORBA_Object::_add_ref (void) +CORBA::Object::_add_ref (void) { if (this->refcount_lock_ != 0) { @@ -80,7 +80,7 @@ CORBA_Object::_add_ref (void) } void -CORBA_Object::_remove_ref (void) +CORBA::Object::_remove_ref (void) { if (this->refcount_lock_ != 0) { @@ -98,14 +98,14 @@ CORBA_Object::_remove_ref (void) } void -CORBA_Object::_tao_any_destructor (void *x) +CORBA::Object::_tao_any_destructor (void *x) { CORBA::Object_ptr tmp = ACE_static_cast (CORBA::Object_ptr, x); CORBA::release (tmp); } TAO_Abstract_ServantBase* -CORBA_Object::_servant (void) const +CORBA::Object::_servant (void) const { return this->servant_; } @@ -114,8 +114,8 @@ CORBA_Object::_servant (void) const // logical type ID is passed as a parameter. CORBA::Boolean -CORBA_Object::_is_a (const char *type_id - ACE_ENV_ARG_DECL) +CORBA::Object::_is_a (const char *type_id + ACE_ENV_ARG_DECL) { // NOTE: if istub->type_id is nonzero and we have local knowledge of // it, we can answer this question without a costly remote call. @@ -131,7 +131,7 @@ CORBA_Object::_is_a (const char *type_id // common to have the "real type ID" not be directly understood // because it's more deeply derived than any locally known types. // - // XXX if type_id is that of CORBA_Object, "yes, we comply" :-) + // XXX if type_id is that of CORBA::Object, "yes, we comply" :-) if (this->protocol_proxy_ == 0) ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); @@ -156,26 +156,26 @@ CORBA_Object::_is_a (const char *type_id } const char* -CORBA_Object::_interface_repository_id (void) const +CORBA::Object::_interface_repository_id (void) const { return "IDL:omg.org/CORBA/Object:1.0"; } CORBA::Boolean -CORBA_Object::_is_collocated (void) const +CORBA::Object::_is_collocated (void) const { return this->is_collocated_; } CORBA::Boolean -CORBA_Object::_is_local (void) const +CORBA::Object::_is_local (void) const { return this->is_local_; } CORBA::ULong -CORBA_Object::_hash (CORBA::ULong maximum - ACE_ENV_ARG_DECL) +CORBA::Object::_hash (CORBA::ULong maximum + ACE_ENV_ARG_DECL) { if (this->protocol_proxy_ != 0) return this->protocol_proxy_->hash (maximum ACE_ENV_ARG_PARAMETER); @@ -194,9 +194,9 @@ CORBA_Object::_hash (CORBA::ULong maximum } CORBA::Boolean -CORBA_Object::_is_equivalent (CORBA_Object_ptr other_obj - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC (()) +CORBA::Object::_is_equivalent (CORBA::Object_ptr other_obj + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC (()) { if (other_obj == this) { @@ -223,7 +223,7 @@ CORBA::Object::_key (ACE_ENV_SINGLE_ARG_DECL) ACE_TEXT ("profile in use\n"))); ACE_THROW_RETURN (CORBA::INTERNAL ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EINVAL), CORBA::COMPLETED_NO), @@ -278,13 +278,13 @@ CORBA::Object::is_nil_i (CORBA::Object_ptr obj) #if (TAO_HAS_MINIMUM_CORBA == 0) void -CORBA_Object::_create_request (CORBA::Context_ptr ctx, - const char *operation, - CORBA::NVList_ptr arg_list, - CORBA::NamedValue_ptr result, - CORBA::Request_ptr &request, - CORBA::Flags req_flags - ACE_ENV_ARG_DECL) +CORBA::Object::_create_request (CORBA::Context_ptr ctx, + const char *operation, + CORBA::NVList_ptr arg_list, + CORBA::NamedValue_ptr result, + CORBA::Request_ptr &request, + CORBA::Flags req_flags + ACE_ENV_ARG_DECL) { // Since we don't really support Context, anything but a null pointer // is a no-no. @@ -309,20 +309,20 @@ CORBA_Object::_create_request (CORBA::Context_ptr ctx, 0, request, req_flags - ACE_ENV_ARG_PARAMETER + ACE_ENV_ARG_PARAMETER ); } void -CORBA_Object::_create_request (CORBA::Context_ptr ctx, - const char *operation, - CORBA::NVList_ptr arg_list, - CORBA::NamedValue_ptr result, - CORBA::ExceptionList_ptr exceptions, - CORBA::ContextList_ptr, - CORBA::Request_ptr &request, - CORBA::Flags req_flags - ACE_ENV_ARG_DECL) +CORBA::Object::_create_request (CORBA::Context_ptr ctx, + const char *operation, + CORBA::NVList_ptr arg_list, + CORBA::NamedValue_ptr result, + CORBA::ExceptionList_ptr exceptions, + CORBA::ContextList_ptr, + CORBA::Request_ptr &request, + CORBA::Flags req_flags + ACE_ENV_ARG_DECL) { // Since we don't really support Context, anything but a null pointer // is a no-no. @@ -347,13 +347,13 @@ CORBA_Object::_create_request (CORBA::Context_ptr ctx, exceptions, request, req_flags - ACE_ENV_ARG_PARAMETER + ACE_ENV_ARG_PARAMETER ); } CORBA::Request_ptr -CORBA_Object::_request (const char *operation - ACE_ENV_ARG_DECL) +CORBA::Object::_request (const char *operation + ACE_ENV_ARG_DECL) { if (this->protocol_proxy_) { @@ -366,7 +366,7 @@ CORBA_Object::_request (const char *operation this, this->protocol_proxy_->orb_core ()->orb (), operation - ACE_ENV_ARG_PARAMETER + ACE_ENV_ARG_PARAMETER ); } else @@ -381,51 +381,57 @@ CORBA_Object::_request (const char *operation // the latter case, return FALSE. CORBA::Boolean -CORBA_Object::_non_existent (ACE_ENV_SINGLE_ARG_DECL) +CORBA::Object::_non_existent (ACE_ENV_SINGLE_ARG_DECL) { CORBA::Boolean _tao_retval = 0; // Get the right Proxy. TAO_Object_Proxy_Impl &the_proxy = - this->proxy_broker_->select_proxy (this ACE_ENV_ARG_PARAMETER); + this->proxy_broker_->select_proxy (this + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); // Perform the Call. - _tao_retval = the_proxy._non_existent (this ACE_ENV_ARG_PARAMETER); + _tao_retval = the_proxy._non_existent (this + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); return _tao_retval; } -CORBA_InterfaceDef_ptr -CORBA_Object::_get_interface (ACE_ENV_SINGLE_ARG_DECL) +CORBA::InterfaceDef_ptr +CORBA::Object::_get_interface (ACE_ENV_SINGLE_ARG_DECL) { // Get the right Proxy. TAO_Object_Proxy_Impl &the_proxy = - this->proxy_broker_->select_proxy (this ACE_ENV_ARG_PARAMETER); + this->proxy_broker_->select_proxy (this + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); // Perform the Call. - return the_proxy._get_interface (this ACE_ENV_ARG_PARAMETER); + return the_proxy._get_interface (this + ACE_ENV_ARG_PARAMETER); } CORBA::ImplementationDef_ptr -CORBA_Object::_get_implementation (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) +CORBA::Object::_get_implementation (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) { return 0; } CORBA::Object_ptr -CORBA_Object::_get_component (ACE_ENV_SINGLE_ARG_DECL) +CORBA::Object::_get_component (ACE_ENV_SINGLE_ARG_DECL) { // Get the right Proxy. TAO_Object_Proxy_Impl &the_proxy = - this->proxy_broker_->select_proxy (this ACE_ENV_ARG_PARAMETER); + this->proxy_broker_->select_proxy (this + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); // Perform the Call. - return the_proxy._get_component (this ACE_ENV_ARG_PARAMETER); + return the_proxy._get_component (this + ACE_ENV_ARG_PARAMETER); } @@ -440,32 +446,34 @@ CORBA_Object::_get_component (ACE_ENV_SINGLE_ARG_DECL) #if (TAO_HAS_CORBA_MESSAGING == 1) CORBA::Policy_ptr -CORBA_Object::_get_policy ( - CORBA::PolicyType type - ACE_ENV_ARG_DECL) +CORBA::Object::_get_policy ( + CORBA::PolicyType type + ACE_ENV_ARG_DECL) { if (this->protocol_proxy_) - return this->protocol_proxy_->get_policy (type ACE_ENV_ARG_PARAMETER); + return this->protocol_proxy_->get_policy (type + ACE_ENV_ARG_PARAMETER); else ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CORBA::Policy::_nil ()); } CORBA::Policy_ptr -CORBA_Object::_get_client_policy ( - CORBA::PolicyType type - ACE_ENV_ARG_DECL) +CORBA::Object::_get_client_policy ( + CORBA::PolicyType type + ACE_ENV_ARG_DECL) { if (this->protocol_proxy_) - return this->_stubobj ()->get_client_policy (type ACE_ENV_ARG_PARAMETER); + return this->_stubobj ()->get_client_policy (type + ACE_ENV_ARG_PARAMETER); else ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CORBA::Policy::_nil ()); } CORBA::Object_ptr -CORBA_Object::_set_policy_overrides ( - const CORBA::PolicyList & policies, - CORBA::SetOverrideType set_add - ACE_ENV_ARG_DECL) +CORBA::Object::_set_policy_overrides ( + const CORBA::PolicyList & policies, + CORBA::SetOverrideType set_add + ACE_ENV_ARG_DECL) { if (!this->protocol_proxy_) ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CORBA::Policy::_nil ()); @@ -473,7 +481,7 @@ CORBA_Object::_set_policy_overrides ( TAO_Stub* stub = this->protocol_proxy_->set_policy_overrides (policies, set_add - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (CORBA::Object::_nil ()); TAO_Stub_Auto_Ptr safe_stub (stub); @@ -481,10 +489,10 @@ CORBA_Object::_set_policy_overrides ( CORBA::Object_ptr obj = CORBA::Object::_nil (); ACE_NEW_THROW_EX (obj, - CORBA_Object (stub, + CORBA::Object (stub, this->is_collocated_), CORBA::NO_MEMORY ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, ENOMEM), CORBA::COMPLETED_MAYBE)); @@ -496,18 +504,20 @@ CORBA_Object::_set_policy_overrides ( } CORBA::PolicyList * -CORBA_Object::_get_policy_overrides (const CORBA::PolicyTypeSeq & types - ACE_ENV_ARG_DECL) +CORBA::Object::_get_policy_overrides (const CORBA::PolicyTypeSeq & types + ACE_ENV_ARG_DECL) { if (this->protocol_proxy_) - return this->protocol_proxy_->get_policy_overrides (types ACE_ENV_ARG_PARAMETER); + return this->protocol_proxy_->get_policy_overrides (types + ACE_ENV_ARG_PARAMETER); else ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); } CORBA::Boolean -CORBA_Object::_validate_connection (CORBA::PolicyList_out inconsistent_policies - ACE_ENV_ARG_DECL) +CORBA::Object::_validate_connection ( + CORBA::PolicyList_out inconsistent_policies + ACE_ENV_ARG_DECL) { inconsistent_policies = 0; @@ -524,7 +534,7 @@ CORBA_Object::_validate_connection (CORBA::PolicyList_out inconsistent_policies if (this->protocol_proxy_) return this->protocol_proxy_->validate_connection (inconsistent_policies - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); #endif /* TAO_HAS_MINIMUM_CORBA */ @@ -536,7 +546,7 @@ CORBA_Object::_validate_connection (CORBA::PolicyList_out inconsistent_policies // **************************************************************** CORBA::Boolean -operator<< (TAO_OutputCDR& cdr, const CORBA_Object* x) +operator<< (TAO_OutputCDR& cdr, const CORBA::Object* x) { if (x == 0) { @@ -574,7 +584,7 @@ operator<< (TAO_OutputCDR& cdr, const CORBA_Object* x) } CORBA::Boolean -operator>> (TAO_InputCDR& cdr, CORBA_Object*& x) +operator>> (TAO_InputCDR& cdr, CORBA::Object*& x) { CORBA::String_var type_hint; @@ -678,10 +688,10 @@ TAO_Object_Proxy_Broker * (*_TAO_collocation_Object_Proxy_Broker_Factory_functio #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class TAO_Object_Manager<CORBA_Object,CORBA_Object_var>; +template class TAO_Object_Manager<CORBA::Object, CORBA::Object_var>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate TAO_Object_Manager<CORBA_Object,CORBA_Object_var> +#pragma instantiate TAO_Object_Manager<CORBA::Object, CORBA::Object_var> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/Object.h b/TAO/tao/Object.h index 7656772bdfd..0c8fa95ede0 100644 --- a/TAO/tao/Object.h +++ b/TAO/tao/Object.h @@ -33,332 +33,353 @@ class TAO_Stub; class TAO_Abstract_ServantBase; class TAO_Object_Proxy_Broker; +class TAO_ObjectKey; -/** - * @class CORBA_Object - * - * @brief Implementation of a CORBA object reference. - * - * All CORBA objects, both unconstrained and locality-constrained, - * inherit from this class. The interface is defined in the CORBA - * specification and the C++ mapping. - */ -class TAO_Export CORBA_Object +namespace CORBA { -public: + /** + * @class Object + * + * @brief Implementation of a CORBA object reference. + * + * All CORBA objects, both unconstrained and locality-constrained, + * inherit from this class. The interface is defined in the CORBA + * specification and the C++ mapping. + */ + class TAO_Export Object + { + public: - /// Destructor. - virtual ~CORBA_Object (void); + /// Destructor. + virtual ~Object (void); - /// Address of this variable used in _unchecked_narrow(). - static int _tao_class_id; + /// Address of this variable used in _unchecked_narrow(). + static int _tao_class_id; - /// Increment the ref count. - static CORBA::Object_ptr _duplicate (CORBA::Object_ptr obj); + /// Increment the ref count. + static CORBA::Object_ptr _duplicate (CORBA::Object_ptr obj); - /// Return a NULL object. - static CORBA::Object_ptr _nil (void); + /// Return a NULL object. + static CORBA::Object_ptr _nil (void); - /// No-op it is just here to simplify some templates. - ACE_INLINE_FOR_GNUC - static CORBA::Object_ptr _narrow (CORBA_Object_ptr obj - ACE_ENV_ARG_DECL_WITH_DEFAULTS); - static CORBA::Object_ptr _unchecked_narrow (CORBA_Object_ptr obj - ACE_ENV_ARG_DECL_WITH_DEFAULTS); + /// No-op it is just here to simplify some templates. + ACE_INLINE_FOR_GNUC + static CORBA::Object_ptr _narrow (CORBA::Object_ptr obj + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + static CORBA::Object_ptr _unchecked_narrow (Object_ptr obj + ACE_ENV_ARG_DECL_WITH_DEFAULTS); - /// Used in the implementation of CORBA::Any - static void _tao_any_destructor (void*); + /// Used in the implementation of CORBA::Any + static void _tao_any_destructor (void*); - /// Uninlined part of the now-inlined CORBA::is_nil(). - static CORBA::Boolean is_nil_i (CORBA::Object_ptr obj); + /// Uninlined part of the now-inlined CORBA::is_nil(). + static CORBA::Boolean is_nil_i (CORBA::Object_ptr obj); - // These calls correspond to over-the-wire operations, or at least - // do so in many common cases. The normal implementation assumes a - // particular simple, efficient, protocol-neutral interface for - // making such calls, but may be overridden when it appears - // appropriate. + // These calls correspond to over-the-wire operations, or at least + // do so in many common cases. The normal implementation assumes a + // particular simple, efficient, protocol-neutral interface for + // making such calls, but may be overridden when it appears + // appropriate. - /// Determine if we are of the type specified by the "logical_type_id" - virtual CORBA::Boolean _is_a (const char *logical_type_id - ACE_ENV_ARG_DECL_WITH_DEFAULTS); + /// Determine if we are of the type specified by the "logical_type_id" + virtual CORBA::Boolean _is_a (const char *logical_type_id + ACE_ENV_ARG_DECL_WITH_DEFAULTS); - /// The repository ID for the most derived class, this is an - /// implementation method and does no remote invocations! - virtual const char* _interface_repository_id (void) const; + /// The repository ID for the most derived class, this is an + /// implementation method and does no remote invocations! + virtual const char* _interface_repository_id (void) const; - /// Is this object collocated with the servant? - virtual CORBA::Boolean _is_collocated (void) const; + /// Is this object collocated with the servant? + virtual CORBA::Boolean _is_collocated (void) const; - /// Is this a local object? - virtual CORBA::Boolean _is_local (void) const; + /// Is this a local object? + virtual CORBA::Boolean _is_local (void) const; - virtual TAO_Abstract_ServantBase *_servant (void) const; + virtual TAO_Abstract_ServantBase *_servant (void) const; #if (TAO_HAS_MINIMUM_CORBA == 0) - virtual CORBA::Boolean _non_existent (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); - - /// This method is deprecated in the CORBA 2.2 spec, we just return 0 - /// every time. - virtual CORBA::ImplementationDef_ptr _get_implementation ( + virtual CORBA::Boolean _non_existent ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); - - /// Get info about the object from the Interface Repository. - virtual CORBA_InterfaceDef_ptr _get_interface ( + /// This method is deprecated in the CORBA 2.2 spec, we just return 0 + /// every time. + virtual CORBA::ImplementationDef_ptr _get_implementation ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); - /// Get info about the object from the Interface Repository. - virtual CORBA::Object_ptr _get_component ( + /// Get info about the object from the Interface Repository. + virtual CORBA::InterfaceDef_ptr _get_interface ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); + /// Get info about the object from the Interface Repository. + virtual CORBA::Object_ptr _get_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); - // DII operations to create a request. - // - // The mapping for create_request is split into two forms, - // corresponding to the two usage styles described in CORBA section - // 6.2.1. - - virtual void _create_request (CORBA::Context_ptr ctx, - const char *operation, - CORBA::NVList_ptr arg_list, - CORBA::NamedValue_ptr result, - CORBA::Request_ptr &request, - CORBA::Flags req_flags - ACE_ENV_ARG_DECL_WITH_DEFAULTS); - - virtual void _create_request (CORBA::Context_ptr ctx, - const char *operation, - CORBA::NVList_ptr arg_list, - CORBA::NamedValue_ptr result, - CORBA::ExceptionList_ptr exclist, - CORBA::ContextList_ptr ctxtlist, - CORBA::Request_ptr &request, - CORBA::Flags req_flags - ACE_ENV_ARG_DECL_WITH_DEFAULTS); - - // The default implementation of this method uses the same simple, - // multi-protocol remote invocation interface as is assumed by the - // calls above ... that's how it can have a default implementation. - - /// DII operation to create a request. - virtual CORBA::Request_ptr _request (const char *operation - ACE_ENV_ARG_DECL_WITH_DEFAULTS); + // DII operations to create a request. + // + // The mapping for create_request is split into two forms, + // corresponding to the two usage styles described in CORBA + // section 6.2.1. + + virtual void _create_request (CORBA::Context_ptr ctx, + const char *operation, + CORBA::NVList_ptr arg_list, + CORBA::NamedValue_ptr result, + CORBA::Request_ptr &request, + CORBA::Flags req_flags + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + virtual void _create_request (CORBA::Context_ptr ctx, + const char *operation, + CORBA::NVList_ptr arg_list, + CORBA::NamedValue_ptr result, + CORBA::ExceptionList_ptr exclist, + CORBA::ContextList_ptr ctxtlist, + CORBA::Request_ptr &request, + CORBA::Flags req_flags + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + // The default implementation of this method uses the same simple, + // multi-protocol remote invocation interface as is assumed by the + // calls above ... that's how it can have a default + // implementation. + + /// DII operation to create a request. + virtual CORBA::Request_ptr _request (const char *operation + ACE_ENV_ARG_DECL_WITH_DEFAULTS); #endif /* TAO_HAS_MINIMUM_CORBA */ #if (TAO_HAS_CORBA_MESSAGING == 1) - CORBA::Policy_ptr _get_policy ( - CORBA::PolicyType type - ACE_ENV_ARG_DECL_WITH_DEFAULTS); + CORBA::Policy_ptr _get_policy (CORBA::PolicyType type + ACE_ENV_ARG_DECL_WITH_DEFAULTS); - CORBA::Policy_ptr _get_client_policy ( - CORBA::PolicyType type - ACE_ENV_ARG_DECL_WITH_DEFAULTS); + CORBA::Policy_ptr _get_client_policy (CORBA::PolicyType type + ACE_ENV_ARG_DECL_WITH_DEFAULTS); - CORBA::Object_ptr _set_policy_overrides ( + CORBA::Object_ptr _set_policy_overrides ( const CORBA::PolicyList & policies, CORBA::SetOverrideType set_add ACE_ENV_ARG_DECL_WITH_DEFAULTS); - CORBA::PolicyList * _get_policy_overrides ( + CORBA::PolicyList * _get_policy_overrides ( const CORBA::PolicyTypeSeq & types ACE_ENV_ARG_DECL_WITH_DEFAULTS); - CORBA::Boolean _validate_connection ( + CORBA::Boolean _validate_connection ( CORBA::PolicyList_out inconsistent_policies ACE_ENV_ARG_DECL_WITH_DEFAULTS); - #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ - /** - * Return a (potentially non-unique) hash value for this object. - * This method relies on the representation of the object - * reference's private state. Since that changes easily (when - * different ORB protocols are in use) there is no default - * implementation. - */ - virtual CORBA::ULong _hash (CORBA::ULong maximum - ACE_ENV_ARG_DECL_WITH_DEFAULTS); - - /** - * Try to determine if this object is the same as other_obj. This - * method relies on the representation of the object reference's - * private state. Since that changes easily (when different ORB - * protocols are in use) there is no default implementation. - */ - virtual CORBA::Boolean _is_equivalent (CORBA::Object_ptr other_obj - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC (()); + /** + * Return a (potentially non-unique) hash value for this object. + * This method relies on the representation of the object + * reference's private state. Since that changes easily (when + * different ORB protocols are in use) there is no default + * implementation. + */ + virtual CORBA::ULong _hash (CORBA::ULong maximum + ACE_ENV_ARG_DECL_WITH_DEFAULTS); - /// Return the object key as an out parameter. Caller should release - /// return value when finished with it. - virtual TAO_ObjectKey *_key (ACE_ENV_SINGLE_ARG_DECL); + /** + * Try to determine if this object is the same as other_obj. This + * method relies on the representation of the object reference's + * private state. Since that changes easily (when different ORB + * protocols are in use) there is no default implementation. + */ + virtual CORBA::Boolean _is_equivalent (CORBA::Object_ptr other_obj + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (()); + + /// Return the object key as an out parameter. Caller should release + /// return value when finished with it. + virtual TAO_ObjectKey *_key (ACE_ENV_SINGLE_ARG_DECL); + + /** + * Return a reference to the object key of profile in-use. + * If there's no in-use profile, then the program will + * probably crash. This method does not create a new copy. + */ + virtual const TAO_ObjectKey &_object_key (void); + + /// Downcasting this object pointer to some other derived class. + /// This QueryInterface stuff only work for local object. + virtual void * _tao_QueryInterface (ptr_arith_t type); + + // Useful for template programming. +#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8 + typedef Object_ptr _ptr_type; + typedef Object_var _var_type; +#endif /* __GNUC__ */ - /** - * Return a reference to the object key of profile in-use. - * If there's no in-use profile, then the program will - * probably crash. This method does not create a new copy. - */ - virtual const TAO_ObjectKey &_object_key (void); + /** + * @name Reference Count Managment + * + * These are the standard CORBA object reference count manipulations + * methods. + */ + //@{ + /// Increment the reference count. + virtual void _add_ref (void); - /// Downcasting this object pointer to some other derived class. - /// This QueryInterface stuff only work for local object. - virtual void * _tao_QueryInterface (ptr_arith_t type); + /// Decrement the reference count. + virtual void _remove_ref (void); + //@} -#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8 - typedef CORBA_Object_ptr _ptr_type; - typedef CORBA_Object_var _var_type; -#endif /* __GNUC__ */ - // Useful for template programming. + /// Constructor + Object (TAO_Stub *p = 0, + CORBA::Boolean collocated = 0, + TAO_Abstract_ServantBase *servant = 0); - /** - * @name Reference Count Managment - * - * These are the standard CORBA object reference count manipulations - * methods. - */ - //@{ - /// Increment the reference count. - virtual void _add_ref (void); + /// Get the underlying stub object. + virtual TAO_Stub *_stubobj (void) const; - /// Decrement the reference count. - virtual void _remove_ref (void); - //@} + /// Set the proxy broker. + virtual void _proxy_broker (TAO_Object_Proxy_Broker *proxy_broker); - /// Constructor - CORBA_Object (TAO_Stub *p = 0, - CORBA::Boolean collocated = 0, - TAO_Abstract_ServantBase *servant = 0); + /// Get the proxy broker. + virtual TAO_Object_Proxy_Broker *_proxy_broker (void); + protected: - /// Get the underlying stub object. - virtual TAO_Stub *_stubobj (void) const; + /// Initializing a local object. + Object (int dummy); - /// Set the proxy broker. - virtual void _proxy_broker (TAO_Object_Proxy_Broker *proxy_broker); + private: - /// Get the proxy broker. - virtual TAO_Object_Proxy_Broker *_proxy_broker (void); + // = Unimplemented methods + Object (const Object &); + Object &operator = (const Object &); -protected: + protected: - /// Initializing a local object. - CORBA_Object (int dummy); + /// Flag to indicate collocation. It is 0 except for collocated + /// objects. + CORBA::Boolean is_collocated_; -private: + /// Servant pointer. It is 0 except for collocated objects. + TAO_Abstract_ServantBase *servant_; - // = Unimplemented methods - CORBA_Object (const CORBA_Object &); - CORBA_Object &operator = (const CORBA_Object &); + /// Specify whether this is a local object or not. + CORBA::Boolean is_local_; -protected: + /// Pointer to the Proxy Broker i.e. the instance that takes care of + /// getting the right proxy for performing a given call. + TAO_Object_Proxy_Broker *proxy_broker_; - /// Flag to indicate collocation. It is 0 except for collocated - /// objects. - CORBA::Boolean is_collocated_; + private: - /// Servant pointer. It is 0 except for collocated objects. - TAO_Abstract_ServantBase *servant_; + /** + * Pointer to the protocol-specific "object" containing important + * profiling information regarding this proxy. + * The protocol proxy is (potentially) shared among several + * Objects + */ + TAO_Stub * protocol_proxy_; - /// Specify whether this is a local object or not. - CORBA::Boolean is_local_; + /// Number of outstanding references to this object. + CORBA::ULong refcount_; - /// Pointer to the Proxy Broker i.e. the instance that takes care of - /// getting the right proxy for performing a given call. - TAO_Object_Proxy_Broker *proxy_broker_; + /// Protect reference count manipulation from race conditions. + /** + * This lock is only instantiated for unconstrained objects. The + * reason for this is that locality-constrained objects that do + * not require reference counting (the default) may be + * instantiated in the critical path. + * + * @note This assumes that unconstrained objects will not be + * instantiated in the critical path. + */ + TAO_SYNCH_MUTEX * refcount_lock_; -private: + }; /** - * Pointer to the protocol-specific "object" containing important - * profiling information regarding this proxy. - * The protocol proxy is (potentially) shared among several - * CORBA_Objects + * @class Object_var + * + * @brief Object_var + * + * Object_var. */ - TAO_Stub * protocol_proxy_; - - /// Number of outstanding references to this object. - CORBA::ULong refcount_; + class TAO_Export Object_var : private TAO_Base_var + { + public: + Object_var (void); // default constructor + Object_var (CORBA::Object_ptr); + Object_var (const Object_var &); // copy constructor + ~Object_var (void); // destructor + + Object_var &operator= (CORBA::Object_ptr); + Object_var &operator= (const Object_var &); + CORBA::Object_ptr operator-> (void) const; + + /// in, inout, out, _retn + operator const CORBA::Object_ptr &() const; + operator CORBA::Object_ptr &(); + CORBA::Object_ptr in (void) const; + CORBA::Object_ptr &inout (void); + CORBA::Object_ptr &out (void); + CORBA::Object_ptr _retn (void); + CORBA::Object_ptr ptr (void) const; + + static CORBA::Object_ptr tao_duplicate (CORBA::Object_ptr); + static void tao_release (CORBA::Object_ptr); + static CORBA::Object_ptr tao_nil (void); + static CORBA::Object_ptr tao_narrow (CORBA::Object * + ACE_ENV_ARG_DECL); + static CORBA::Object * tao_upcast (void *); + + private: + + // Unimplemented - Prevent widening assignment. + Object_var (const TAO_Base_var &rhs); + Object_var &operator= (const TAO_Base_var &rhs); + + private: + + CORBA::Object_ptr ptr_; + + }; - /// Protect reference count manipulation from race conditions. /** - * This lock is only instantiated for unconstrained objects. The - * reason for this is that locality-constrained objects that do not - * require reference counting (the default) may be instantiated in - * the critical path. + * @class Object_out * - * @note This assumes that unconstrained objects will not be - * instantiated in the critical path. + * @brief Object_out + * + * Object_out */ - TAO_SYNCH_MUTEX * refcount_lock_; - -}; - -class TAO_Export CORBA_Object_var -{ -public: - CORBA_Object_var (void); // default constructor - CORBA_Object_var (CORBA::Object_ptr); - CORBA_Object_var (const CORBA_Object_var &); // copy constructor - ~CORBA_Object_var (void); // destructor - - CORBA_Object_var &operator= (CORBA::Object_ptr); - CORBA_Object_var &operator= (const CORBA_Object_var &); - CORBA::Object_ptr operator-> (void) const; - - /// in, inout, out, _retn - operator const CORBA::Object_ptr &() const; - operator CORBA::Object_ptr &(); - CORBA::Object_ptr in (void) const; - CORBA::Object_ptr &inout (void); - CORBA::Object_ptr &out (void); - CORBA::Object_ptr _retn (void); - CORBA::Object_ptr ptr (void) const; - - static CORBA::Object_ptr tao_duplicate (CORBA::Object_ptr); - static void tao_release (CORBA::Object_ptr); - static CORBA::Object_ptr tao_nil (void); - static CORBA::Object_ptr tao_narrow (CORBA::Object * - ACE_ENV_ARG_DECL_NOT_USED); - static CORBA::Object * tao_upcast (void *); - -private: - CORBA::Object_ptr ptr_; -}; - -class TAO_Export CORBA_Object_out -{ -public: - CORBA_Object_out (CORBA::Object_ptr &); - CORBA_Object_out (CORBA_Object_var &); - CORBA_Object_out (const CORBA_Object_out &); - CORBA_Object_out &operator= (const CORBA_Object_out &); - CORBA_Object_out &operator= (const CORBA_Object_var &); - CORBA_Object_out &operator= (CORBA::Object_ptr); - operator CORBA::Object_ptr &(); - CORBA::Object_ptr &ptr (void); - CORBA::Object_ptr operator-> (void); - -private: - CORBA::Object_ptr &ptr_; -}; - - -/// This function pointer is set only when the Portable server library -/// is present. + class TAO_Export Object_out + { + public: + Object_out (CORBA::Object_ptr &); + Object_out (Object_var &); + Object_out (const Object_out &); + Object_out &operator= (const Object_out &); + Object_out &operator= (const Object_var &); + Object_out &operator= (CORBA::Object_ptr); + operator CORBA::Object_ptr &(); + CORBA::Object_ptr &ptr (void); + CORBA::Object_ptr operator-> (void); + + private: + CORBA::Object_ptr &ptr_; + }; +} // End CORBA namespace. + +/// This function pointer is set only when the Portable server +/// library is present. extern TAO_Export TAO_Object_Proxy_Broker * (*_TAO_collocation_Object_Proxy_Broker_Factory_function_pointer) ( CORBA::Object_ptr obj - ); + ); TAO_Export CORBA::Boolean -operator<< (TAO_OutputCDR&, const CORBA_Object*); +operator<< (TAO_OutputCDR&, const CORBA::Object*); TAO_Export CORBA::Boolean -operator>> (TAO_InputCDR&, CORBA_Object*&); +operator>> (TAO_InputCDR&, CORBA::Object*&); #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Object.i b/TAO/tao/Object.i index a940db1ba43..f922cbd1729 100644 --- a/TAO/tao/Object.i +++ b/TAO/tao/Object.i @@ -5,7 +5,7 @@ // **************************************************************** ACE_INLINE -CORBA_Object::CORBA_Object (int) +CORBA::Object::Object (int) : is_collocated_ (0), servant_ (0), is_local_ (1), @@ -17,7 +17,7 @@ CORBA_Object::CORBA_Object (int) } ACE_INLINE CORBA::Object_ptr -CORBA_Object::_duplicate (CORBA::Object_ptr obj) +CORBA::Object::_duplicate (CORBA::Object_ptr obj) { if (obj) obj->_add_ref (); @@ -42,7 +42,7 @@ CORBA::is_nil (CORBA::Object_ptr obj) return 1; } - return CORBA_Object::is_nil_i (obj); + return CORBA::Object::is_nil_i (obj); } // ************************************************************ @@ -50,14 +50,14 @@ CORBA::is_nil (CORBA::Object_ptr obj) // Null pointers represent nil objects. ACE_INLINE CORBA::Object_ptr -CORBA_Object::_nil (void) +CORBA::Object::_nil (void) { return 0; } ACE_INLINE CORBA::Object_ptr -CORBA_Object::_unchecked_narrow (CORBA::Object_ptr obj - ACE_ENV_ARG_DECL_NOT_USED) +CORBA::Object::_unchecked_narrow (CORBA::Object_ptr obj + ACE_ENV_ARG_DECL_NOT_USED) { if (CORBA::is_nil (obj)) return CORBA::Object::_nil (); @@ -73,214 +73,214 @@ CORBA_Object::_unchecked_narrow (CORBA::Object_ptr obj } ACE_INLINE CORBA::Object_ptr -CORBA_Object::_narrow (CORBA::Object_ptr obj - ACE_ENV_ARG_DECL) +CORBA::Object::_narrow (CORBA::Object_ptr obj + ACE_ENV_ARG_DECL) { - return CORBA_Object::_unchecked_narrow (obj - ACE_ENV_ARG_PARAMETER); + return CORBA::Object::_unchecked_narrow (obj + ACE_ENV_ARG_PARAMETER); } ACE_INLINE TAO_Stub * -CORBA_Object::_stubobj (void) const +CORBA::Object::_stubobj (void) const { return this->protocol_proxy_; } // ************************************************************* -// Inline operations for class CORBA_Object_var +// Inline operations for class CORBA::Object_var // ************************************************************* ACE_INLINE -CORBA_Object_var::CORBA_Object_var (void) - : ptr_ (CORBA_Object::_nil ()) +CORBA::Object_var::Object_var (void) + : ptr_ (CORBA::Object::_nil ()) { } ACE_INLINE -CORBA_Object_var::CORBA_Object_var (CORBA::Object_ptr p) +CORBA::Object_var::Object_var (CORBA::Object_ptr p) : ptr_ (p) { } ACE_INLINE -CORBA_Object_var::~CORBA_Object_var (void) +CORBA::Object_var::~Object_var (void) { CORBA::release (this->ptr_); } ACE_INLINE CORBA::Object_ptr -CORBA_Object_var::ptr (void) const +CORBA::Object_var::ptr (void) const { return this->ptr_; } ACE_INLINE -CORBA_Object_var::CORBA_Object_var (const CORBA_Object_var &p) - : ptr_ (CORBA_Object::_duplicate (p.ptr ())) +CORBA::Object_var::Object_var (const CORBA::Object_var &p) + : ptr_ (CORBA::Object::_duplicate (p.ptr ())) { } -ACE_INLINE CORBA_Object_var & -CORBA_Object_var::operator= (CORBA::Object_ptr p) +ACE_INLINE CORBA::Object_var & +CORBA::Object_var::operator= (CORBA::Object_ptr p) { CORBA::release (this->ptr_); this->ptr_ = p; return *this; } -ACE_INLINE CORBA_Object_var & -CORBA_Object_var::operator= (const CORBA_Object_var &p) +ACE_INLINE CORBA::Object_var & +CORBA::Object_var::operator= (const CORBA::Object_var &p) { if (this != &p) { CORBA::release (this->ptr_); - this->ptr_ = CORBA_Object::_duplicate (p.ptr ()); + this->ptr_ = CORBA::Object::_duplicate (p.ptr ()); } return *this; } ACE_INLINE -CORBA_Object_var::operator const CORBA::Object_ptr &() const // cast +CORBA::Object_var::operator const CORBA::Object_ptr &() const // cast { return this->ptr_; } ACE_INLINE -CORBA_Object_var::operator CORBA::Object_ptr &() // cast +CORBA::Object_var::operator CORBA::Object_ptr &() // cast { return this->ptr_; } ACE_INLINE CORBA::Object_ptr -CORBA_Object_var::operator-> (void) const +CORBA::Object_var::operator-> (void) const { return this->ptr_; } ACE_INLINE CORBA::Object_ptr -CORBA_Object_var::in (void) const +CORBA::Object_var::in (void) const { return this->ptr_; } ACE_INLINE CORBA::Object_ptr & -CORBA_Object_var::inout (void) +CORBA::Object_var::inout (void) { return this->ptr_; } ACE_INLINE CORBA::Object_ptr & -CORBA_Object_var::out (void) +CORBA::Object_var::out (void) { CORBA::release (this->ptr_); - this->ptr_ = CORBA_Object::_nil (); + this->ptr_ = CORBA::Object::_nil (); return this->ptr_; } ACE_INLINE CORBA::Object_ptr -CORBA_Object_var::_retn (void) +CORBA::Object_var::_retn (void) { // yield ownership of managed obj reference CORBA::Object_ptr val = this->ptr_; - this->ptr_ = CORBA_Object::_nil (); + this->ptr_ = CORBA::Object::_nil (); return val; } ACE_INLINE CORBA::Object_ptr -CORBA_Object_var::tao_duplicate (CORBA::Object_ptr p) +CORBA::Object_var::tao_duplicate (CORBA::Object_ptr p) { - return CORBA_Object::_duplicate (p); + return CORBA::Object::_duplicate (p); } ACE_INLINE void -CORBA_Object_var::tao_release (CORBA::Object_ptr p) +CORBA::Object_var::tao_release (CORBA::Object_ptr p) { CORBA::release (p); } ACE_INLINE CORBA::Object_ptr -CORBA_Object_var::tao_nil (void) +CORBA::Object_var::tao_nil (void) { - return CORBA_Object::_nil (); + return CORBA::Object::_nil (); } ACE_INLINE CORBA::Object_ptr -CORBA_Object_var::tao_narrow ( +CORBA::Object_var::tao_narrow ( CORBA::Object *p ACE_ENV_ARG_DECL_NOT_USED ) { - return CORBA_Object::_duplicate (p); + return CORBA::Object::_duplicate (p); } ACE_INLINE CORBA::Object * -CORBA_Object_var::tao_upcast (void *src) +CORBA::Object_var::tao_upcast (void *src) { - CORBA_Object **tmp = - ACE_static_cast (CORBA_Object **, src); + CORBA::Object **tmp = + ACE_static_cast (CORBA::Object **, src); return *tmp; } // ************************************************************* -// Inline operations for class CORBA_Object_out +// Inline operations for class CORBA::Object_out // ************************************************************* ACE_INLINE -CORBA_Object_out::CORBA_Object_out (CORBA::Object_ptr &p) +CORBA::Object_out::Object_out (CORBA::Object_ptr &p) : ptr_ (p) { - this->ptr_ = CORBA_Object::_nil (); + this->ptr_ = CORBA::Object::_nil (); } ACE_INLINE -CORBA_Object_out::CORBA_Object_out (CORBA_Object_var &p) +CORBA::Object_out::Object_out (CORBA::Object_var &p) : ptr_ (p.out ()) { CORBA::release (this->ptr_); - this->ptr_ = CORBA_Object::_nil (); + this->ptr_ = CORBA::Object::_nil (); } ACE_INLINE -CORBA_Object_out::CORBA_Object_out (const CORBA_Object_out &p) +CORBA::Object_out::Object_out (const CORBA::Object_out &p) : ptr_ (p.ptr_) { } -ACE_INLINE CORBA_Object_out & -CORBA_Object_out::operator= (const CORBA_Object_out &p) +ACE_INLINE CORBA::Object_out & +CORBA::Object_out::operator= (const CORBA::Object_out &p) { this->ptr_ = p.ptr_; return *this; } -ACE_INLINE CORBA_Object_out & -CORBA_Object_out::operator= (const CORBA_Object_var &p) +ACE_INLINE CORBA::Object_out & +CORBA::Object_out::operator= (const CORBA::Object_var &p) { - this->ptr_ = CORBA_Object::_duplicate (p.ptr ()); + this->ptr_ = CORBA::Object::_duplicate (p.ptr ()); return *this; } -ACE_INLINE CORBA_Object_out & -CORBA_Object_out::operator= (CORBA::Object_ptr p) +ACE_INLINE CORBA::Object_out & +CORBA::Object_out::operator= (CORBA::Object_ptr p) { this->ptr_ = p; return *this; } ACE_INLINE -CORBA_Object_out::operator CORBA::Object_ptr &() // cast +CORBA::Object_out::operator CORBA::Object_ptr &() // cast { return this->ptr_; } ACE_INLINE CORBA::Object_ptr & -CORBA_Object_out::ptr (void) // ptr +CORBA::Object_out::ptr (void) // ptr { return this->ptr_; } ACE_INLINE CORBA::Object_ptr -CORBA_Object_out::operator-> (void) +CORBA::Object_out::operator-> (void) { return this->ptr_; } diff --git a/TAO/tao/Object_KeyC.h b/TAO/tao/Object_KeyC.h index e4d16dffe25..b434e6c601d 100644 --- a/TAO/tao/Object_KeyC.h +++ b/TAO/tao/Object_KeyC.h @@ -22,6 +22,8 @@ #include "tao/Sequence.h" +class TAO_ObjectKey_var; + class TAO_Export TAO_ObjectKey : public TAO_Unbounded_Sequence<CORBA::Octet> { // = TITLE diff --git a/TAO/tao/Object_Proxy_Broker.cpp b/TAO/tao/Object_Proxy_Broker.cpp index 81bd4d5544a..9019c7682f5 100644 --- a/TAO/tao/Object_Proxy_Broker.cpp +++ b/TAO/tao/Object_Proxy_Broker.cpp @@ -1,13 +1,9 @@ -// $Id$ - #include "tao/Object_Proxy_Broker.h" -ACE_RCSID (tao, TAO_Object_Proxy_Broker, "$Id$") -TAO_Object_Proxy_Broker::TAO_Object_Proxy_Broker (void) -{ - // No-Op. -} +ACE_RCSID (tao, + TAO_Object_Proxy_Broker, + "$Id$") TAO_Object_Proxy_Broker::~TAO_Object_Proxy_Broker (void) diff --git a/TAO/tao/Object_Proxy_Broker.h b/TAO/tao/Object_Proxy_Broker.h index 27c0420a9d9..f19cd457a10 100644 --- a/TAO/tao/Object_Proxy_Broker.h +++ b/TAO/tao/Object_Proxy_Broker.h @@ -1,3 +1,4 @@ +// -*- C++ -*- //============================================================================= /** @@ -9,7 +10,6 @@ * proxy brokers. Interface specific proxy broker are generated * by the IDL compiler. * - * * @author Angelo Corsaro <corsaro@cs.wustl.edu> */ //============================================================================= @@ -19,30 +19,38 @@ #define TAO_OBJECT_PROXY_BROKER_H_ #include "ace/pre.h" -#include "tao/corbafwd.h" -#include "tao/Object_Proxy_Impl.h" +#include "tao/corbafwd.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "ace/CORBA_macros.h" + + +class TAO_Object_Proxy_Impl; + +/** + * @class TAO_Object_Proxy_Broker + * + * @brief TAO_Object_Proxy_Broker + * + * TAO_Object_Proxy_Broker + */ class TAO_Export TAO_Object_Proxy_Broker { public: - // -- Ctor/Dtor -- + /// Destructor virtual ~TAO_Object_Proxy_Broker (void); virtual TAO_Object_Proxy_Impl &select_proxy (CORBA::Object_ptr object ACE_ENV_ARG_DECL) = 0; -protected: - TAO_Object_Proxy_Broker (void); }; - #include "ace/post.h" #endif /* TAO_OBJECT_PROXY_BROKER_H_ */ diff --git a/TAO/tao/Object_Proxy_Impl.cpp b/TAO/tao/Object_Proxy_Impl.cpp index 58a270b075c..dba83c961fc 100644 --- a/TAO/tao/Object_Proxy_Impl.cpp +++ b/TAO/tao/Object_Proxy_Impl.cpp @@ -1,16 +1,10 @@ -// $Id$ - #include "tao/Object_Proxy_Impl.h" -ACE_RCSID(tao, Object_Proxy_Impl, "$Id$") - -TAO_Object_Proxy_Impl::TAO_Object_Proxy_Impl (void) -{ - // No-Op. -} +ACE_RCSID (tao, + Object_Proxy_Impl, + "$Id$") TAO_Object_Proxy_Impl::~TAO_Object_Proxy_Impl (void) { - // No-Op. } diff --git a/TAO/tao/Object_Proxy_Impl.h b/TAO/tao/Object_Proxy_Impl.h index 923595e82ea..cf8d14d7adf 100644 --- a/TAO/tao/Object_Proxy_Impl.h +++ b/TAO/tao/Object_Proxy_Impl.h @@ -1,3 +1,4 @@ +// -*- C++ -*- //============================================================================= /** @@ -8,7 +9,6 @@ * This files contains the proxy definition of the interface that * all the Object proxy have to imlements. * - * * @author Angelo Corsaro <corsaro@cs.wustl.edu> */ //============================================================================= @@ -18,8 +18,16 @@ #define TAO_OBJECT_PROXY_IMPL_H_ #include "ace/pre.h" + #include "tao/corbafwd.h" +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/CORBA_macros.h" + + /** * @class TAO_Object_Proxy_Impl * @@ -34,9 +42,8 @@ public: virtual ~TAO_Object_Proxy_Impl (void); - virtual CORBA::Boolean _is_a (const CORBA::Object_ptr target, - const CORBA::Char *logical_type_id + const char *logical_type_id ACE_ENV_ARG_DECL) = 0; #if (TAO_HAS_MINIMUM_CORBA == 0) @@ -44,7 +51,7 @@ public: virtual CORBA::Boolean _non_existent (const CORBA::Object_ptr target ACE_ENV_ARG_DECL) = 0; - virtual CORBA_InterfaceDef_ptr _get_interface ( + virtual CORBA::InterfaceDef_ptr _get_interface ( const CORBA::Object_ptr target ACE_ENV_ARG_DECL ) = 0; @@ -54,9 +61,6 @@ public: #endif /* TAO_HAS_MINIMUM_CORBA == 0 */ -protected: - TAO_Object_Proxy_Impl (void); - }; #include "ace/post.h" diff --git a/TAO/tao/Object_Ref_Table.h b/TAO/tao/Object_Ref_Table.h index 475a78b8ba3..61f73ead651 100644 --- a/TAO/tao/Object_Ref_Table.h +++ b/TAO/tao/Object_Ref_Table.h @@ -25,6 +25,7 @@ #include "ace/Synch.h" #include "ace/Hash_Map_Manager_T.h" #include "ace/Functor.h" +#include "ace/CORBA_macros.h" /** diff --git a/TAO/tao/Policy_Set.h b/TAO/tao/Policy_Set.h index 94a52934342..8667cfde2b9 100644 --- a/TAO/tao/Policy_Set.h +++ b/TAO/tao/Policy_Set.h @@ -6,8 +6,8 @@ * * $Id$ * - * A Policy Container that provides O(1) time access for policy that support caching - * (see orbconf.h). + * A Policy Container that provides O(1) time access for policy that + * support caching (see orbconf.h). * * @author Angelo Cosaro (corsaro@cs.wustl.edu) * @author Frank Hunleth (fhunleth@cs.wustl.edu) @@ -15,17 +15,18 @@ */ //============================================================================= -#ifndef TAO_POLICY_SET_H_ -#define TAO_POLICY_SET_H_ +#ifndef TAO_POLICY_SET_H +#define TAO_POLICY_SET_H + #include "ace/pre.h" -#include "tao/orbconf.h" #include "tao/PolicyC.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ + /** * @class TAO_Policy_Set * @@ -55,35 +56,35 @@ public: ACE_ENV_ARG_DECL); /** - * Modify the list of policies to include <policies>. - * If <set_add> is CORBA::SET_OVERRIDE then we replace all the old - * policies. If it is CORBA::ADD_OVERRIDE we simply add the policies - * in <policies>. + * Modify the list of policies to include @a policies. + * If @a set_add is @c CORBA::SET_OVERRIDE then we replace all the + * old policies. If it is @c CORBA::ADD_OVERRIDE we simply add the + * policies in @a policies. * No attempt is made to validate the policies for consistency. */ void set_policy_overrides (const CORBA::PolicyList & policies, CORBA::SetOverrideType set_add - ACE_ENV_ARG_DECL_WITH_DEFAULTS); + ACE_ENV_ARG_DECL); - - /// Get the values (if any) for the policies in <types>, if <types> - /// is an empty list the method returns *all* the current policies. + /// Get the values (if any) for the policies in @a types, if @a + /// types is an empty list the method returns *all* the current + /// policies. CORBA::PolicyList * get_policy_overrides (const CORBA::PolicyTypeSeq & types - ACE_ENV_ARG_DECL_WITH_DEFAULTS); - + ACE_ENV_ARG_DECL); /// Obtain a single policy. CORBA::Policy_ptr get_policy (CORBA::PolicyType policy - ACE_ENV_ARG_DECL_WITH_DEFAULTS); - + ACE_ENV_ARG_DECL); /// Obtain a cached policy for speedy lookups. - /// This method just returns a const reference to the policy to - /// avoid obtaining a lock to increment the reference count. As such, - /// it can only be used for single threaded cases or cases where the - /// policies cannot be removed such as at the object and thread level - /// scopes. This method is most likely not appropriate for accessing - /// policies at the ORB level scope in any situation. + /** + * This method just returns a const reference to the policy to avoid + * obtaining a lock to increment the reference count. As such, it + * can only be used for single threaded cases or cases where the + * policies cannot be removed such as at the object and thread level + * scopes. This method is most likely not appropriate for accessing + * policies at the ORB level scope in any situation. + */ CORBA::Policy_ptr get_cached_const_policy (TAO_Cached_Policy_Type type) const; /// Obtain a single cached policy. @@ -94,7 +95,8 @@ public: ACE_ENV_ARG_DECL); /// Returns the policy at the specified index. - /// CORBA::Policy::_nil () is returned if the policy doesn't exist + /// @c CORBA::Policy::_nil () is returned if the policy doesn't + /// exist. CORBA::Policy *get_policy_by_index (CORBA::ULong index); CORBA::ULong num_policies (void) const; @@ -121,10 +123,11 @@ private: TAO_Policy_Scope scope_; }; + #if defined (__ACE_INLINE__) # include "tao/Policy_Set.i" #endif /* __ACE_INLINE__ */ #include "ace/post.h" -#endif /* TAO_POLICY_SET_H_ */ +#endif /* TAO_POLICY_SET_H */ diff --git a/TAO/tao/Profile.i b/TAO/tao/Profile.i index 339f2e8a369..0faa4decde2 100644 --- a/TAO/tao/Profile.i +++ b/TAO/tao/Profile.i @@ -38,10 +38,6 @@ TAO_Profile::orb_core (void) const ACE_INLINE CORBA::ULong TAO_Profile::_incr_refcnt (void) { - // OK, think I got it. When this object is created (guard) the - // lock is automatically acquired (refcount_lock_). Then when - // we leave this method the destructir for guard is called which - // releases the lock! ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->refcount_lock_, 0); return this->refcount_++; @@ -58,7 +54,7 @@ TAO_Profile::_decr_refcnt (void) } // refcount is 0, so delete us! - // delete will call our ~ destructor which in turn deletes stuff. + // delete() will call our destructor which in turn deletes stuff. delete this; return 0; } diff --git a/TAO/tao/Protocols_Hooks.h b/TAO/tao/Protocols_Hooks.h index 324092aae39..64ff42874f5 100644 --- a/TAO/tao/Protocols_Hooks.h +++ b/TAO/tao/Protocols_Hooks.h @@ -30,6 +30,7 @@ class TAO_Resource_Factory; class TAO_Service_Context; class TAO_Acceptor_Registry; class TAO_Connection_Handler; +class TAO_Stub; class TAO_Export TAO_Protocols_Hooks : public ACE_Service_Object { diff --git a/TAO/tao/Remote_Object_Proxy_Broker.cpp b/TAO/tao/Remote_Object_Proxy_Broker.cpp index f386547bec5..4f3f1ec98f3 100644 --- a/TAO/tao/Remote_Object_Proxy_Broker.cpp +++ b/TAO/tao/Remote_Object_Proxy_Broker.cpp @@ -1,25 +1,10 @@ -// $Id$ - #include "tao/Remote_Object_Proxy_Broker.h" -ACE_RCSID (tao, TAO_Object_Remote_Proxy_Broker, "$Id$") -TAO_Remote_Object_Proxy_Broker * -the_tao_remote_object_proxy_broker (void) -{ - static TAO_Remote_Object_Proxy_Broker the_broker; - return &the_broker; -} +ACE_RCSID (tao, + TAO_Object_Remote_Proxy_Broker, + "$Id$") -TAO_Remote_Object_Proxy_Broker::TAO_Remote_Object_Proxy_Broker (void) -{ - // No-Op. -} - -TAO_Remote_Object_Proxy_Broker::~TAO_Remote_Object_Proxy_Broker (void) -{ - // No-Op. -} TAO_Object_Proxy_Impl & TAO_Remote_Object_Proxy_Broker::select_proxy (CORBA::Object_ptr @@ -28,3 +13,11 @@ TAO_Remote_Object_Proxy_Broker::select_proxy (CORBA::Object_ptr return this->remote_proxy_impl_; } +// ----------------------------------------------------- + +TAO_Remote_Object_Proxy_Broker * +the_tao_remote_object_proxy_broker (void) +{ + static TAO_Remote_Object_Proxy_Broker the_broker; + return &the_broker; +} diff --git a/TAO/tao/Remote_Object_Proxy_Broker.h b/TAO/tao/Remote_Object_Proxy_Broker.h index 00753be7fc8..3376f9b843d 100644 --- a/TAO/tao/Remote_Object_Proxy_Broker.h +++ b/TAO/tao/Remote_Object_Proxy_Broker.h @@ -1,3 +1,4 @@ +// -*- C++ -*- //============================================================================= /** @@ -8,19 +9,16 @@ * This files contains the Remote Proxy Broker implementation * for the CORBA Object. * - * * @author Angelo Corsaro <corsaro@cs.wustl.edu> */ //============================================================================= -#ifndef TAO_REMOTE_OBJECT_PROXY_BROKER_H_ -#define TAO_REMOTE_OBJECT_PROXY_BROKER_H_ +#ifndef TAO_REMOTE_OBJECT_PROXY_BROKER_H +#define TAO_REMOTE_OBJECT_PROXY_BROKER_H -// -- ACE Include -- #include "ace/pre.h" -// -- TAO Include -- #include "tao/corbafwd.h" #include "tao/Object_Proxy_Broker.h" #include "tao/Remote_Object_Proxy_Impl.h" @@ -29,22 +27,25 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -class TAO_Export TAO_Remote_Object_Proxy_Broker : public TAO_Object_Proxy_Broker +class TAO_Export TAO_Remote_Object_Proxy_Broker + : public TAO_Object_Proxy_Broker { public: - // -- Ctor/Dtor -- - TAO_Remote_Object_Proxy_Broker (void); - ~TAO_Remote_Object_Proxy_Broker (void); virtual TAO_Object_Proxy_Impl &select_proxy (CORBA::Object_ptr object ACE_ENV_ARG_DECL); private: + TAO_Remote_Object_Proxy_Impl remote_proxy_impl_; + }; +// ----------------------------------------------------- + TAO_Remote_Object_Proxy_Broker *the_tao_remote_object_proxy_broker (void); + #include "ace/post.h" -#endif /* TAO_REMOTE_Object_PROXY_BROKER_H_ */ +#endif /* TAO_REMOTE_OBJECT_PROXY_BROKER_H */ diff --git a/TAO/tao/Remote_Object_Proxy_Impl.cpp b/TAO/tao/Remote_Object_Proxy_Impl.cpp index 45f2a303088..2469e4000c9 100644 --- a/TAO/tao/Remote_Object_Proxy_Impl.cpp +++ b/TAO/tao/Remote_Object_Proxy_Impl.cpp @@ -1,30 +1,20 @@ -// $Id$ - #include "tao/Remote_Object_Proxy_Impl.h" #include "tao/Exception.h" -#include "tao/Any.h" #include "tao/Stub.h" #include "tao/Invocation.h" #include "tao/IFR_Client_Adapter.h" #include "ace/Dynamic_Service.h" -ACE_RCSID(tao, TAO_Remote_Object_Proxy_Impl, "$Id$") -TAO_Remote_Object_Proxy_Impl::TAO_Remote_Object_Proxy_Impl (void) -{ - // No-Op -} +ACE_RCSID (tao, + TAO_Remote_Object_Proxy_Impl, + "$Id$") -TAO_Remote_Object_Proxy_Impl::~TAO_Remote_Object_Proxy_Impl (void) -{ - // No-Op -} - CORBA::Boolean TAO_Remote_Object_Proxy_Impl::_is_a (const CORBA::Object_ptr target, - const CORBA::Char *logical_type_id + const char *logical_type_id ACE_ENV_ARG_DECL) { // Here we go remote to answer the question. @@ -33,7 +23,7 @@ TAO_Remote_Object_Proxy_Impl::_is_a (const CORBA::Object_ptr target, TAO_Stub *istub = target->_stubobj (); if (istub == 0) ACE_THROW_RETURN (CORBA::INTERNAL ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EINVAL), CORBA::COMPLETED_NO), @@ -83,7 +73,7 @@ TAO_Remote_Object_Proxy_Impl::_is_a (const CORBA::Object_ptr target, break; } TAO_InputCDR &_tao_in = _tao_call.inp_stream (); - if (!(_tao_in >> CORBA::Any::to_boolean (_tao_retval))) + if (!(_tao_in >> TAO_InputCDR::to_boolean (_tao_retval))) ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES), _tao_retval); @@ -107,7 +97,7 @@ TAO_Remote_Object_Proxy_Impl::_non_existent (const CORBA::Object_ptr target TAO_Stub *istub = target->_stubobj (); if (istub == 0) ACE_THROW_RETURN (CORBA::INTERNAL ( - CORBA_SystemException::_tao_minor_code ( + CORBA::SystemException::_tao_minor_code ( TAO_DEFAULT_MINOR_CODE, EINVAL), CORBA::COMPLETED_NO), @@ -148,7 +138,7 @@ TAO_Remote_Object_Proxy_Impl::_non_existent (const CORBA::Object_ptr target } TAO_InputCDR &_tao_in = _tao_call.inp_stream (); if (!( - (_tao_in >> CORBA::Any::to_boolean (_tao_retval)) + (_tao_in >> TAO_InputCDR::to_boolean (_tao_retval)) )) ACE_THROW_RETURN (CORBA::MARSHAL (), _tao_retval); } @@ -161,6 +151,8 @@ TAO_Remote_Object_Proxy_Impl::_non_existent (const CORBA::Object_ptr target ACE_RE_THROW; } ACE_ENDTRY; + ACE_CHECK_RETURN (0); + return _tao_retval; } @@ -168,70 +160,63 @@ CORBA::Object_ptr TAO_Remote_Object_Proxy_Impl::_get_component (const CORBA::Object_ptr target ACE_ENV_ARG_DECL) { - CORBA::Object_var _tao_retval (CORBA::Object::_nil ()); + CORBA::Object_var _tao_retval; - ACE_TRY + TAO_Stub *istub = target->_stubobj (); + if (istub == 0) + ACE_THROW_RETURN (CORBA::INTERNAL ( + CORBA::SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + EINVAL), + CORBA::COMPLETED_NO), + _tao_retval._retn ()); + + TAO_GIOP_Twoway_Invocation _tao_call (istub, + "_component", // Not "_get_component"! + 10, + 1, + istub->orb_core ()); + + for (;;) { - // Must catch exceptions, if the server raises a - // CORBA::OBJECT_NOT_EXIST then we must return 1, instead of - // propagating the exception. - TAO_Stub *istub = target->_stubobj (); - if (istub == 0) - ACE_THROW_RETURN (CORBA::INTERNAL ( - CORBA_SystemException::_tao_minor_code ( - TAO_DEFAULT_MINOR_CODE, - EINVAL), - CORBA::COMPLETED_NO), - _tao_retval._retn()); + _tao_call.start (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; - TAO_GIOP_Twoway_Invocation _tao_call (istub, - "_component", - 10, - 1, - istub->orb_core ()); + CORBA::Short flag = TAO_TWOWAY_RESPONSE_FLAG; - // ACE_TRY_ENV.clear (); - for (;;) - { - _tao_call.start (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag) + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; - CORBA::Short flag = TAO_TWOWAY_RESPONSE_FLAG; + int _invoke_status = + _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; - _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag) - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + if (_invoke_status == TAO_INVOKE_RESTART) + continue; - int _invoke_status = - _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ACE_ASSERT (_invoke_status != TAO_INVOKE_EXCEPTION); - if (_invoke_status == TAO_INVOKE_RESTART) - continue; - ACE_ASSERT (_invoke_status != TAO_INVOKE_EXCEPTION); - if (_invoke_status != TAO_INVOKE_OK) - { - ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, - CORBA::COMPLETED_YES), - _tao_retval._retn ()); - } - break; + if (_invoke_status != TAO_INVOKE_OK) + { + ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, + CORBA::COMPLETED_YES), + CORBA::Object::_nil ()); } - TAO_InputCDR &_tao_in = _tao_call.inp_stream (); - if (!( - (_tao_in >> _tao_retval.inout ()) - )) - ACE_THROW_RETURN (CORBA::MARSHAL (), _tao_retval._retn ()); - } - ACE_CATCHANY - { - ACE_RE_THROW; + break; } - ACE_ENDTRY; + + TAO_InputCDR &_tao_in = _tao_call.inp_stream (); + if (!( + (_tao_in >> _tao_retval.inout ()) + )) + ACE_THROW_RETURN (CORBA::MARSHAL (), + CORBA::Object::_nil ()); + return _tao_retval._retn (); } -CORBA_InterfaceDef_ptr +CORBA::InterfaceDef_ptr TAO_Remote_Object_Proxy_Impl::_get_interface (const CORBA::Object_ptr target ACE_ENV_ARG_DECL) { @@ -247,7 +232,7 @@ TAO_Remote_Object_Proxy_Impl::_get_interface (const CORBA::Object_ptr target } return adapter->get_interface_remote (target - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); } #endif /* TAO_HAS_MINIMUM_CORBA == 0 */ diff --git a/TAO/tao/Remote_Object_Proxy_Impl.h b/TAO/tao/Remote_Object_Proxy_Impl.h index 59f3ee784e0..355a1d3266b 100644 --- a/TAO/tao/Remote_Object_Proxy_Impl.h +++ b/TAO/tao/Remote_Object_Proxy_Impl.h @@ -1,3 +1,4 @@ +// -*- C++ -*- //============================================================================= /** @@ -13,11 +14,11 @@ */ //============================================================================= - #ifndef TAO_REMOTE_OBJECT_PROXY_IMPL_H_ #define TAO_REMOTE_OBJECT_PROXY_IMPL_H_ #include "ace/pre.h" + #include "tao/corbafwd.h" #include "tao/Object_Proxy_Impl.h" @@ -29,16 +30,13 @@ * * This class implements the remote proxy for the CORBA::Object class. */ -class TAO_Export TAO_Remote_Object_Proxy_Impl : public virtual TAO_Object_Proxy_Impl +class TAO_Export TAO_Remote_Object_Proxy_Impl + : public virtual TAO_Object_Proxy_Impl { public: - TAO_Remote_Object_Proxy_Impl (void); - - virtual ~TAO_Remote_Object_Proxy_Impl (void); - virtual CORBA::Boolean _is_a (const CORBA::Object_ptr target, - const CORBA::Char *logical_type_id + const char * logical_type_id ACE_ENV_ARG_DECL); #if (TAO_HAS_MINIMUM_CORBA == 0) @@ -46,7 +44,7 @@ public: virtual CORBA::Boolean _non_existent (const CORBA::Object_ptr target ACE_ENV_ARG_DECL); - virtual CORBA_InterfaceDef_ptr _get_interface ( + virtual CORBA::InterfaceDef_ptr _get_interface ( const CORBA::Object_ptr target ACE_ENV_ARG_DECL ); @@ -58,6 +56,7 @@ public: }; + #include "ace/post.h" #endif /* TAO_REMOTE_OBJECT_PROXY_IMPL */ diff --git a/TAO/tao/Sequence.h b/TAO/tao/Sequence.h index e8414664340..fc30aa91375 100644 --- a/TAO/tao/Sequence.h +++ b/TAO/tao/Sequence.h @@ -24,10 +24,10 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/Managed_Types.h" +#include "ace/CORBA_macros.h" #include "ace/Log_Msg.h" /* For "ACE_ASSERT" */ +#include "ace/Message_Block.h" -class CORBA_Object; -class CORBA_Environment; /** * @class TAO_Base_Sequence @@ -75,12 +75,12 @@ public: /// Used for sequences of objects to downcast a recently demarshalled /// object reference into the right type. virtual void _downcast (void *target, - CORBA_Object *src + CORBA::Object *src ACE_ENV_ARG_DECL_WITH_DEFAULTS); /// Used for sequences of object to convert from the derived type /// into the Object class. - virtual CORBA_Object *_upcast (void *src) const; + virtual CORBA::Object *_upcast (void *src) const; // = orbos/98-01-11 proposed extensions. /// Returns the state of the sequence release flag. @@ -519,7 +519,6 @@ public: // **************************************************************** -class ACE_Message_Block; template<class T> class TAO_Unbounded_Sequence; // forward declaration, we are going to specialize that template // here. diff --git a/TAO/tao/Service_Callbacks.h b/TAO/tao/Service_Callbacks.h index aa1e28ef19e..3f799f2b542 100644 --- a/TAO/tao/Service_Callbacks.h +++ b/TAO/tao/Service_Callbacks.h @@ -27,7 +27,7 @@ class TAO_Profile; class TAO_MProfile; class TAO_GIOP_Invocation; -class TAO_Server_Request; +class TAO_ServerRequest; class TAO_Message_State_Factory; /** diff --git a/TAO/tao/Stub.h b/TAO/tao/Stub.h index da39e78a217..1301d011970 100644 --- a/TAO/tao/Stub.h +++ b/TAO/tao/Stub.h @@ -11,7 +11,6 @@ */ //============================================================================= - #ifndef TAO_STUB_H #define TAO_STUB_H @@ -26,9 +25,10 @@ #include "tao/MProfile.h" #include "tao/ORB.h" #include "tao/ORB_Core.h" +#include "tao/ORB_Core_Auto_Ptr.h" -// Forward declarations. +// Forward declarations. class TAO_RelativeRoundtripTimeoutPolicy; class TAO_Client_Priority_Policy; class TAO_Sync_Scope_Policy; @@ -38,9 +38,6 @@ class TAO_Sync_Strategy; class TAO_GIOP_Invocation; class TAO_Policy_Set; - -// Descriptions of parameters. - class TAO_Profile; // Function pointer returning a pointer to CORBA::Exception. This is used to @@ -79,8 +76,7 @@ struct TAO_Exception_Data * The type ID (the data specified by CORBA 2.0 that gets exposed * "on the wire", and in stringified objrefs) is held by this * module. - * The stub APIs are member functions of this - * type. + * The stub APIs are member functions of this type. */ class TAO_Export TAO_Stub { @@ -103,11 +99,13 @@ public: CORBA::SetOverrideType set_add ACE_ENV_ARG_DECL_WITH_DEFAULTS); - virtual CORBA::PolicyList * get_policy_overrides (const CORBA::PolicyTypeSeq & types - ACE_ENV_ARG_DECL_WITH_DEFAULTS); + virtual CORBA::PolicyList * get_policy_overrides ( + const CORBA::PolicyTypeSeq & types + ACE_ENV_ARG_DECL_WITH_DEFAULTS); - CORBA::Boolean validate_connection (CORBA::PolicyList_out inconsistent_policies - ACE_ENV_ARG_DECL_WITH_DEFAULTS); + CORBA::Boolean validate_connection ( + CORBA::PolicyList_out inconsistent_policies + ACE_ENV_ARG_DECL_WITH_DEFAULTS); #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ diff --git a/TAO/tao/Stub_Factory.h b/TAO/tao/Stub_Factory.h index 5fa3dae9617..f928c6db664 100644 --- a/TAO/tao/Stub_Factory.h +++ b/TAO/tao/Stub_Factory.h @@ -1,3 +1,5 @@ +// -*- C++ -*- + //============================================================================= /** * @file Stub_Factory.h @@ -18,15 +20,19 @@ #include "ace/pre.h" #include "tao/corbafwd.h" -#include "ace/Service_Object.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "ace/Service_Object.h" +#include "ace/CORBA_macros.h" + + // Forward references class TAO_MProfile; class TAO_ORB_Core; +class TAO_Stub; /** * @class TAO_Stub_Factory diff --git a/TAO/tao/Synch_Queued_Message.cpp b/TAO/tao/Synch_Queued_Message.cpp index 61095eadc55..a39fcb52df8 100644 --- a/TAO/tao/Synch_Queued_Message.cpp +++ b/TAO/tao/Synch_Queued_Message.cpp @@ -2,6 +2,7 @@ #include "debug.h" #include "ace/Malloc_T.h" #include "ace/Log_Msg.h" +#include "ace/Message_Block.h" ACE_RCSID (tao, diff --git a/TAO/tao/TAO.dsp b/TAO/tao/TAO.dsp index d815d5a955b..0735cf51f82 100644 --- a/TAO/tao/TAO.dsp +++ b/TAO/tao/TAO.dsp @@ -667,6 +667,10 @@ SOURCE=.\ORB_Core.cpp # End Source File
# Begin Source File
+SOURCE=.\ORB_Core_Auto_Ptr.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\ORB_Table.cpp
# End Source File
# Begin Source File
@@ -1499,6 +1503,10 @@ SOURCE=.\orb_core.h # End Source File
# Begin Source File
+SOURCE=.\ORB_Core_Auto_Ptr.h
+# End Source File
+# Begin Source File
+
SOURCE=.\ORB_Table.h
# End Source File
# Begin Source File
@@ -2187,6 +2195,10 @@ SOURCE=.\orb_core.i # End Source File
# Begin Source File
+SOURCE=.\ORB_Core_Auto_Ptr.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\ORB_Table.inl
# End Source File
# Begin Source File
diff --git a/TAO/tao/TAO_Internal.cpp b/TAO/tao/TAO_Internal.cpp index 2c15db278b8..3c75cc907c0 100644 --- a/TAO/tao/TAO_Internal.cpp +++ b/TAO/tao/TAO_Internal.cpp @@ -5,6 +5,7 @@ #include "default_client.h" #include "default_resource.h" +#include "Adapter.h" #include "IIOP_Factory.h" #include "MCAST_Parser.h" #include "CORBANAME_Parser.h" @@ -12,9 +13,8 @@ #include "FILE_Parser.h" #include "DLL_Parser.h" #include "StringSeqC.h" - +#include "ORB_Core.h" #include "Object_Loader.h" -#include "ace/Dynamic_Service.h" #include "Default_Stub_Factory.h" #include "Default_Endpoint_Selector_Factory.h" @@ -22,6 +22,7 @@ #include "Default_Thread_Lane_Resources_Manager.h" #include "Default_Collocation_Resolver.h" +#include "ace/Dynamic_Service.h" #include "ace/Service_Config.h" #include "ace/Service_Repository.h" #include "ace/Object_Manager.h" diff --git a/TAO/tao/Tagged_Components.cpp b/TAO/tao/Tagged_Components.cpp index 52279af989c..d82307c30a7 100644 --- a/TAO/tao/Tagged_Components.cpp +++ b/TAO/tao/Tagged_Components.cpp @@ -8,7 +8,9 @@ # include "tao/Tagged_Components.i" #endif /* ! __ACE_INLINE__ */ -ACE_RCSID(tao, Tagged_Components, "$Id$") +ACE_RCSID (tao, + Tagged_Components, + "$Id$") void diff --git a/TAO/tao/Thread_Lane_Resources.h b/TAO/tao/Thread_Lane_Resources.h index 2a3f89b268e..99dd1eaa1a4 100644 --- a/TAO/tao/Thread_Lane_Resources.h +++ b/TAO/tao/Thread_Lane_Resources.h @@ -14,14 +14,20 @@ #define TAO_THREAD_LANE_RESOURCES_H #include "ace/pre.h" -#include "tao/orbconf.h" + +#include "tao/TAO_Export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/corbafwd.h" +#include "tao/orbconf.h" + #include "ace/Synch_T.h" +#include "ace/CORBA_macros.h" + + +class ACE_Allocator; class TAO_ORB_Core; class TAO_Acceptor_Registry; @@ -31,6 +37,7 @@ class TAO_MProfile; class TAO_New_Leader_Generator; class TAO_Connector_Registry; class TAO_Resource_Factory; + /** * @class TAO_Thread_Lane_Resources * diff --git a/TAO/tao/Thread_Lane_Resources_Manager.h b/TAO/tao/Thread_Lane_Resources_Manager.h index 4c5270a1535..075b6bf45a7 100644 --- a/TAO/tao/Thread_Lane_Resources_Manager.h +++ b/TAO/tao/Thread_Lane_Resources_Manager.h @@ -1,3 +1,5 @@ +// -*- C++ -*- + //============================================================================= /** * @file Thread_Lane_Resources_Manager.h @@ -12,13 +14,14 @@ #define TAO_THREAD_LANE_RESOURCES_MANAGER_H #include "ace/pre.h" -#include "tao/orbconf.h" + +#include "tao/TAO_Export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/corbafwd.h" +#include "ace/CORBA_macros.h" #include "ace/Service_Object.h" class TAO_ORB_Core; @@ -48,7 +51,7 @@ public: virtual void finalize (void) = 0; /// Open default resources. - virtual int open_default_resources (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) = 0; + virtual int open_default_resources (ACE_ENV_SINGLE_ARG_DECL) = 0; /// Shutdown reactor. virtual void shutdown_reactor (void) = 0; diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp index 3801e66ebcc..36b7dc96799 100644 --- a/TAO/tao/Transport.cpp +++ b/TAO/tao/Transport.cpp @@ -108,6 +108,7 @@ TAO_Transport::TAO_Transport (CORBA::ULong tag, , current_deadline_ (ACE_Time_Value::zero) , flush_timer_id_ (-1) , transport_timer_ (this) + , handler_lock_ (orb_core->resource_factory ()->create_cached_connection_lock ()) , id_ ((long) this) , purging_order_ (0) { @@ -119,10 +120,6 @@ TAO_Transport::TAO_Transport (CORBA::ULong tag, // Create TMS now. this->tms_ = cf->create_transport_mux_strategy (this); - - // Create a handler lock - this->handler_lock_ = - this->orb_core_->resource_factory ()->create_cached_connection_lock (); } TAO_Transport::~TAO_Transport (void) @@ -526,7 +523,10 @@ TAO_Transport::send_synchronous_message_i (const ACE_Message_Block *mb, { typedef ACE_Reverse_Lock<ACE_Lock> TAO_REVERSE_LOCK; TAO_REVERSE_LOCK reverse (*this->handler_lock_); - ACE_GUARD_RETURN (TAO_REVERSE_LOCK, ace_mon, reverse, -1); + ACE_GUARD_RETURN (TAO_REVERSE_LOCK, + ace_mon, + reverse, + -1); result = flushing_strategy->flush_message (this, &synch_message, diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h index 25716816651..601ae068fed 100644 --- a/TAO/tao/Transport.h +++ b/TAO/tao/Transport.h @@ -24,7 +24,6 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "Exception.h" -#include "Transport_Descriptor_Interface.h" #include "Transport_Cache_Manager.h" #include "Transport_Timer.h" #include "Incoming_Message_Queue.h" @@ -34,6 +33,7 @@ class TAO_ORB_Core; class TAO_Target_Specification; class TAO_Operation_Details; class TAO_Transport_Mux_Strategy; +class TAO_Transport_Descriptor_Interface; class TAO_Wait_Strategy; class TAO_Connection_Handler; class TAO_Pluggable_Messaging; @@ -43,7 +43,6 @@ class TAO_Synch_Queued_Message; class TAO_Resume_Handle; - /** * @class TAO_Transport * @@ -217,9 +216,6 @@ public: TAO_Transport (CORBA::ULong tag, TAO_ORB_Core *orb_core); - /// destructor - virtual ~TAO_Transport (void); - // Maintain reference counting with these static TAO_Transport* _duplicate (TAO_Transport* transport); static void release (TAO_Transport* transport); @@ -421,6 +417,14 @@ public: virtual int tear_listen_point_list (TAO_InputCDR &cdr); protected: + + /// Destructor + /** + * Protected destructor to enforce proper memory management through + * the reference counting mechanism. + */ + virtual ~TAO_Transport (void); + /** @name Template methods * * The Transport class uses the Template Method Pattern to implement @@ -956,7 +960,7 @@ protected: /// resources (such as a connection handler) get serialized. /** * This is an <code>ACE_Lock</code> that gets initialized from - * <code>TAO_ORB_Core::resource_factory()->create_cached_connection_lock ()</code>. + * @c TAO_ORB_Core::resource_factory()->create_cached_connection_lock(). * This way, one can use a lock appropriate for the type of system, i.e., * a null lock for single-threaded systems, and a real lock for * multi-threaded systems. @@ -965,8 +969,7 @@ protected: /// A unique identifier for the transport. /** - * This never *never* - * changes over the lifespan, so we don't have to worry + * This never *never* changes over the lifespan, so we don't have to worry * about locking it. * * HINT: Protocol-specific transports that use connection handler diff --git a/TAO/tao/Transport_Connector.h b/TAO/tao/Transport_Connector.h index 6e30d8f71a0..18cafdc00d7 100644 --- a/TAO/tao/Transport_Connector.h +++ b/TAO/tao/Transport_Connector.h @@ -22,6 +22,8 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "ace/CORBA_macros.h" + class TAO_Transport_Descriptor_Interface; class TAO_InputCDR; diff --git a/TAO/tao/ValueFactory_Map.cpp b/TAO/tao/ValueFactory_Map.cpp index 879aeb6d95a..214085bc2f7 100644 --- a/TAO/tao/ValueFactory_Map.cpp +++ b/TAO/tao/ValueFactory_Map.cpp @@ -1,37 +1,22 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO -// -// = FILENAME -// ValueFactory_Map.cpp -// -// = AUTHOR -// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de> -// -// ============================================================================ - #include "tao/ValueFactory_Map.h" #include "tao/ValueFactory.h" -#include "tao/ORB.h" #if !defined (__ACE_INLINE__) # include "tao/ValueFactory_Map.i" #endif /* ! __ACE_INLINE__ */ + ACE_RCSID (tao, ValueFactory_Map, "$Id$") -TAO_ValueFactory_Map::TAO_ValueFactory_Map () - : map_ () // use default size and allocator +TAO_ValueFactory_Map::TAO_ValueFactory_Map (void) + : map_ (TAO_DEFAULT_VALUE_FACTORY_TABLE_SIZE) { } -TAO_ValueFactory_Map::~TAO_ValueFactory_Map () +TAO_ValueFactory_Map::~TAO_ValueFactory_Map (void) { // Initialize an iterator. We need to go thru each entry and free // up storage allocated to hold the external ids and invoke @@ -55,12 +40,12 @@ TAO_ValueFactory_Map::~TAO_ValueFactory_Map () int TAO_ValueFactory_Map::rebind (const char *repo_id, - CORBA_ValueFactory &factory) + CORBA::ValueFactory &factory) { // ACE_READ_GUARD_RETURN (TAO_SYNCH_RW_MUTEX, guard, map_->mutex(),-1); // --- but must be recursive const char *prev_repo_id; - CORBA_ValueFactory prev_factory; + CORBA::ValueFactory prev_factory; int ret = 0; ret = this->map_.rebind (CORBA::string_dup (repo_id), factory, @@ -83,7 +68,7 @@ TAO_ValueFactory_Map::rebind (const char *repo_id, int TAO_ValueFactory_Map::unbind (const char *repo_id, - CORBA_ValueFactory &factory) + CORBA::ValueFactory &factory) { FACTORY_MAP_MANAGER::ENTRY *prev_entry; int ret = 0; @@ -108,7 +93,7 @@ TAO_ValueFactory_Map::unbind (const char *repo_id, // %! perhaps inline int TAO_ValueFactory_Map::find (const char *repo_id, - CORBA_ValueFactory &factory) + CORBA::ValueFactory &factory) { int ret = 0; ret = this->map_.find (repo_id, @@ -123,19 +108,19 @@ TAO_ValueFactory_Map::find (const char *repo_id, } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Hash_Map_Iterator_Base_Ex<const char *, CORBA_ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX>; -template class ACE_Hash_Map_Iterator_Ex<const char *, CORBA_ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<const char *, CORBA_ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX>; -template class ACE_Hash_Map_Manager_Ex<const char *, CORBA_ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX>; -template class ACE_Hash_Map_Entry<const char *, CORBA_ValueFactoryBase *>; +template class ACE_Hash_Map_Iterator_Base_Ex<const char *, CORBA::ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX>; +template class ACE_Hash_Map_Iterator_Ex<const char *, CORBA::ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<const char *, CORBA::ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX>; +template class ACE_Hash_Map_Manager_Ex<const char *, CORBA::ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX>; +template class ACE_Hash_Map_Entry<const char *, CORBA::ValueFactoryBase *>; template class TAO_Singleton<TAO_ValueFactory_Map, TAO_SYNCH_MUTEX>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<const char *, CORBA_ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<const char *, CORBA_ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<const char *, CORBA_ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Hash_Map_Manager_Ex<const char *, CORBA_ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Hash_Map_Entry<const char *, CORBA_ValueFactoryBase *> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<const char *, CORBA::ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<const char *, CORBA::ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<const char *, CORBA::ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Hash_Map_Manager_Ex<const char *, CORBA::ValueFactoryBase *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Hash_Map_Entry<const char *, CORBA::ValueFactoryBase *> #pragma instantiate TAO_Singleton<TAO_ValueFactory_Map, TAO_SYNCH_MUTEX> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/ValueFactory_Map.h b/TAO/tao/ValueFactory_Map.h index 6f5868acb21..78ea7c3e915 100644 --- a/TAO/tao/ValueFactory_Map.h +++ b/TAO/tao/ValueFactory_Map.h @@ -15,7 +15,7 @@ #define TAO_VALUEFACTORY_MAP_H #include "ace/pre.h" -#include "ace/Hash_Map_Manager.h" +#include "ace/Hash_Map_Manager_T.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -28,9 +28,9 @@ class TAO_ValueFactory_Map { public: - TAO_ValueFactory_Map (); - ~TAO_ValueFactory_Map (); + TAO_ValueFactory_Map (void); + ~TAO_ValueFactory_Map (void); /** * Associate the factory (int_id) with the repo_id (ext_id). @@ -40,25 +40,26 @@ public: * Returns -1 on failure, 0 on success and 1 if a previous factory * is found (and returned in factory). */ - int rebind (const char *repo_id, CORBA_ValueFactory &factory); + int rebind (const char *repo_id, CORBA::ValueFactory &factory); /// Removes entry for repo_id from the map and sets factory to /// the tied one. - int unbind (const char *repo_id, CORBA_ValueFactory &factory); + int unbind (const char *repo_id, CORBA::ValueFactory &factory); /** * Lookup a matching factory for repo_id. * Invokes _add_ref () on the factory if found. * Returns -1 on failure and 0 on success. */ - int find (const char *repo_id, CORBA_ValueFactory &factory); + int find (const char *repo_id, CORBA::ValueFactory &factory); void dump (void); + private: /// The hash table data structure. typedef ACE_Hash_Map_Manager_Ex<const char *, - CORBA_ValueFactory, + CORBA::ValueFactory, ACE_Hash<const char *>, ACE_Equal_To<const char *>, TAO_SYNCH_RW_MUTEX> diff --git a/TAO/tao/corbafwd.cpp b/TAO/tao/corbafwd.cpp index 9bf1d21ddf7..1fee1e19f99 100644 --- a/TAO/tao/corbafwd.cpp +++ b/TAO/tao/corbafwd.cpp @@ -1,15 +1,15 @@ -// $Id$ - #include "tao/corbafwd.h" #if !defined (__ACE_INLINE__) # include "tao/corbafwd.i" #endif /* ! __ACE_INLINE__ */ + ACE_RCSID (tao, corbafwd, "$Id$") + char * CORBA::string_dup (const char *str) { @@ -61,48 +61,23 @@ CORBA::wstring_dup (const WChar *const str) str); } -// **************************************************************** - -TAO_NAMESPACE_TYPE (const CORBA::ServiceType) -TAO_NAMESPACE_BEGIN (CORBA) -TAO_NAMESPACE_DEFINE (const CORBA::ServiceType, Security, 1) -TAO_NAMESPACE_END - -// **************************************************************** - -TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr) -TAO_NAMESPACE_BEGIN (CORBA) -TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_Visibility, 0) -TAO_NAMESPACE_END - -TAO_NAMESPACE_TYPE (const CORBA::Visibility) -TAO_NAMESPACE_BEGIN (CORBA) -TAO_NAMESPACE_DEFINE (const CORBA::Visibility, PRIVATE_MEMBER, 0) -TAO_NAMESPACE_END -TAO_NAMESPACE_TYPE (const CORBA::Visibility) -TAO_NAMESPACE_BEGIN (CORBA) -TAO_NAMESPACE_DEFINE (const CORBA::Visibility, PUBLIC_MEMBER, 1) -TAO_NAMESPACE_END - -TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr) -TAO_NAMESPACE_BEGIN (CORBA) -TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_ValueModifier, 0) -TAO_NAMESPACE_END - -TAO_NAMESPACE_TYPE (const CORBA::ValueModifier) -TAO_NAMESPACE_BEGIN (CORBA) -TAO_NAMESPACE_DEFINE (const CORBA::ValueModifier, VM_NONE, 0) -TAO_NAMESPACE_END -TAO_NAMESPACE_TYPE (const CORBA::ValueModifier) -TAO_NAMESPACE_BEGIN (CORBA) -TAO_NAMESPACE_DEFINE (const CORBA::ValueModifier, VM_CUSTOM, 1) -TAO_NAMESPACE_END -TAO_NAMESPACE_TYPE (const CORBA::ValueModifier) -TAO_NAMESPACE_BEGIN (CORBA) -TAO_NAMESPACE_DEFINE (const CORBA::ValueModifier, VM_ABSTRACT, 2) -TAO_NAMESPACE_END -TAO_NAMESPACE_TYPE (const CORBA::ValueModifier) -TAO_NAMESPACE_BEGIN (CORBA) -TAO_NAMESPACE_DEFINE (const CORBA::ValueModifier, VM_TRUNCATABLE, 3) -TAO_NAMESPACE_END +namespace CORBA +{ + // **************************************************************** + + const CORBA::ServiceType Security = 1; + // **************************************************************** + + CORBA::TypeCode_ptr _tc_Visibility = 0; + + const CORBA::Visibility PRIVATE_MEMBER = 0; + const CORBA::Visibility PUBLIC_MEMBER = 1; + + CORBA::TypeCode_ptr _tc_ValueModifier = 0; + + const CORBA::ValueModifier VM_NONE = 0; + const CORBA::ValueModifier VM_CUSTOM = 1; + const CORBA::ValueModifier VM_ABSTRACT = 2; + const CORBA::ValueModifier VM_TRUNCATABLE = 3; +} diff --git a/TAO/tao/corbafwd.i b/TAO/tao/corbafwd.i index 60b8773438a..0c1c29a8917 100644 --- a/TAO/tao/corbafwd.i +++ b/TAO/tao/corbafwd.i @@ -37,8 +37,8 @@ CORBA::wstring_free (CORBA::WChar *const str) delete [] str; } -ACE_INLINE CORBA_Environment& -CORBA::default_environment () +ACE_INLINE CORBA::Environment& +CORBA::default_environment (void) { return TAO_default_environment (); } diff --git a/TAO/tao/iiop_endpoints.h b/TAO/tao/iiop_endpoints.h index ed121bd452b..3a41caccd8d 100644 --- a/TAO/tao/iiop_endpoints.h +++ b/TAO/tao/iiop_endpoints.h @@ -20,7 +20,7 @@ #include "tao/Managed_Types.h" #include "tao/Sequence.h" -#include "tao/Any.h" +#include "tao/CDR.h" #include "tao/Typecode.h" #if defined (TAO_EXPORT_MACRO) diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index 02450609428..7eeef3f7721 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -95,6 +95,14 @@ const size_t TAO_DEFAULT_POLICY_FACTORY_REGISTRY_SIZE = 64; const size_t TAO_DEFAULT_OBJECT_REF_TABLE_SIZE = 256; #endif /* !TAO_DEFAULT_ORB_TABLE_SIZE */ +// The default size of TAO's ValueFactory table, i.e. the +// one used as the underlying implementation for the +// CORBA::ORB::register_value_factory() method. +#if !defined (TAO_DEFAULT_VALUE_FACTORY_TABLE_SIZE) +const size_t TAO_DEFAULT_VALUE_FACTORY_TABLE_SIZE = 128; +#endif /* !TAO_DEFAULT_ORB_TABLE_SIZE */ + + // The default size of TAO's server active object map. #if !defined (TAO_DEFAULT_SERVER_ACTIVE_OBJECT_MAP_SIZE) # if defined (TAO_DEFAULT_SERVER_OBJECT_TABLE_SIZE) diff --git a/TAO/tao/varbase.h b/TAO/tao/varbase.h index 00f4e780455..37aa16c3273 100644 --- a/TAO/tao/varbase.h +++ b/TAO/tao/varbase.h @@ -32,6 +32,12 @@ class TAO_Base_var { public: TAO_Base_var (void) {} + +private: + + TAO_Base_var (const TAO_Base_var &); + TAO_Base_var & operator= (const TAO_Base_var &); + }; #include "ace/post.h" |