From 0d7fa5fcdb0831bc20568d7d6c4cf049821703ed Mon Sep 17 00:00:00 2001 From: Angelo Corsaro Date: Wed, 22 Nov 2000 20:35:01 +0000 Subject: Wed Nov 22 14:30:12 2000 Angelo Corsaro --- TAO/ChangeLogs/ChangeLog-02a | 26 ++++- .../be/be_visitor_interface/interface_cs.cpp | 7 +- .../be/be_visitor_interface/interface_ss.cpp | 3 +- .../remote_proxy_broker_ch.cpp | 29 +++-- .../remote_proxy_broker_cs.cpp | 2 +- .../strategized_proxy_broker_sh.cpp | 30 +++-- .../strategized_proxy_broker_ss.cpp | 128 ++++++++++----------- TAO/tao/MessagingC.cpp | 6 +- TAO/tao/MessagingC.h | 97 ++++++++-------- TAO/tao/PortableServer/MessagingS.cpp | 43 +++---- TAO/tao/PortableServer/MessagingS.h | 43 +++---- 11 files changed, 232 insertions(+), 182 deletions(-) diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 1b01ec1b489..111058dfeee 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,9 +1,33 @@ +Wed Nov 22 14:30:12 2000 Angelo Corsaro + + * TAO_IDL/be/be_visitor_interface/interface_cs.cpp: + * TAO_IDL/be/be_visitor_interface/interface_ss.cpp: + * TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp: + * TAO_IDL/be/be_visitor_interface/remote_proxy_broker_cs.cpp: + * TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp: + * TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp: + + Modified code generated for the proxy broker factory + function. Now the factory is a public static method of the proxy + broker itself. + + * tao/MessagingC.cpp: + * tao/MessagingC.h: + * tao/PortableServer/MessagingS.cpp: + * tao/PortableServer/MessagingS.h: + + Modified code to reflect the change made in the IDL generated + code. + + Thanks to Andy for the support, + and hint. + Wed Nov 22 10:05:47 2000 Priyanka Gontla * performance-tests/Latency/server.dsp * performance-tests/Latency/client.dsp * performance-tests/Latency/st_client.dsp - + Updated the Debug and Release configurations. Wed Nov 22 09:49:51 2000 Darrell Brunsch diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp index eaea8d269c9..5b9271dca75 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp @@ -136,7 +136,9 @@ be_visitor_interface_cs::visit_interface (be_interface *node) << "else" << be_idt_nl // idt = 2 << "this->the" << node->base_proxy_broker_name () << "_ =" << be_idt_nl // idt = 3 - << "::" << node->client_enclosing_scope () << "the" << node->remote_proxy_broker_name () + << node->full_remote_proxy_broker_name () << "::" + << "the" << node->remote_proxy_broker_name () + // << "::" << node->client_enclosing_scope () << "the" << node->remote_proxy_broker_name () << " ();" << be_uidt << be_uidt << be_nl << be_nl; // idt = 1 // Now we setup the immediate parents. @@ -146,8 +148,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) { be_interface *inherited = be_interface::narrow_from_decl (node->inherits ()[i]); - *os << "ACE_NESTED_CLASS (" << inherited->full_name () << ", " - << inherited->local_name ()<< ")::setup_collocation" << " (collocated);" << be_nl; + *os << inherited->local_name ()<< "::setup_collocation" << " (collocated);" << be_nl; } } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp index 81348d6498d..a6ee426f44b 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp @@ -93,7 +93,8 @@ be_visitor_interface_ss::visit_interface (be_interface *node) << "{" << be_idt_nl // idt = 1 << "ACE_UNUSED_ARG (obj);" << be_nl << "return " - << "::" << node->server_enclosing_scope () << "the" + << node->full_strategized_proxy_broker_name () + << "::" <<"the" << node->strategized_proxy_broker_name () << "();" << be_uidt_nl // idt = 0 << "}" << be_nl << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp index 21ce175a72e..c85e2d414b8 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp @@ -25,10 +25,10 @@ be_visitor_interface_remote_proxy_broker_ch::visit_interface (be_interface *node // Generate the class declaration. os->indent (); - + *os << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl - << "// Remote Proxy Broker Declaration " << be_nl + << "// Remote Proxy Broker Declaration " << be_nl << "//" << be_nl << be_nl; *os << "class " << be_global->stub_export_macro () << " " @@ -50,21 +50,32 @@ be_visitor_interface_remote_proxy_broker_ch::visit_interface (be_interface *node << node->remote_proxy_impl_name () << " remote_proxy_impl_;" << be_uidt_nl; - *os << "};" << be_nl << be_nl; - - // Factory Function declaration. - *os << "// This funxtion is used to get an handle to the unique instance" << be_nl + // Factory Member Function declaration. + *os << "// This member function is used to get an handle to the unique instance" << be_nl << "// of the Remote Proxy Broker that is available for a given" << be_nl << "// interface." << be_nl << be_nl; + *os << "public:" << be_idt_nl + << "static " << node->remote_proxy_broker_name () + << " *the" << node->remote_proxy_broker_name () + << " (void);" << be_uidt_nl; + + *os << "};" << be_nl << be_nl; + - *os << node->remote_proxy_broker_name () << " *the" + /* + if (node->is_nested ()) + *os << "TAO_NAMESPACE_STORAGE_CLASS "; + else + *os << "static "; + + *os << node->remote_proxy_broker_name () << " *the" << node->remote_proxy_broker_name () << " (void);" << be_nl; - + */ *os << be_nl << "//" << be_nl - << "// End Remote Proxy Broker Declaration " << be_nl + << "// End Remote Proxy Broker Declaration " << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_cs.cpp index a64bd7442b2..204a0cf3531 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_cs.cpp @@ -38,7 +38,7 @@ be_visitor_interface_remote_proxy_broker_cs::visit_interface (be_interface *node *os << "// Factory function Implementation." << be_nl << node->full_remote_proxy_broker_name () - << " *" << node->client_enclosing_scope () << "the" + << " *" << node->full_remote_proxy_broker_name () << "::the" << node->remote_proxy_broker_name () << " (void)" << be_nl << "{" << be_idt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp index 9d63e3d629d..a922a6d7511 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp @@ -22,15 +22,15 @@ int be_visitor_interface_strategized_proxy_broker_sh::visit_interface (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); - - + + // os->gen_ifdef_macro (node->local_name (), "STRATEGIZED_PROXY_BROKER_"); // Generate the class declaration. os->indent (); *os << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl - << "// Strategized Proxy Broker Declaration " << be_nl + << "// Strategized Proxy Broker Declaration " << be_nl << "//" << be_nl << be_nl; *os << "class " << be_global->skel_export_macro () << " " @@ -70,24 +70,34 @@ be_visitor_interface_strategized_proxy_broker_sh::visit_interface (be_interface << "ACE_SYNCH_MUTEX mutex_;" << be_uidt_nl; - *os << "};" << be_nl << be_nl; - // Factory Function declaration. *os << "// This funxtion is used to get an handle to the unique instance" << be_nl << "// of the Strategized Proxy Broker that is available for a given" << be_nl << "// interface." << be_nl << be_nl; - *os << node->strategized_proxy_broker_name () << " *the" << node->strategized_proxy_broker_name () - << " (void);" << be_nl; + *os << "public:" << be_idt_nl + << "static " << node->strategized_proxy_broker_name () << " *the" << node->strategized_proxy_broker_name () + << " (void);" << be_uidt_nl; + + *os << "};" << be_nl << be_nl; + + + /* + if (node->is_nested ()) + *os << "TAO_NAMESPACE_STORAGE_CLASS "; + else + *os << "static "; + */ + + - *os << be_nl << "//" << be_nl - << "// End Strategized Proxy Broker Declaration " << be_nl + << "// End Strategized Proxy Broker Declaration " << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl << be_nl; - + // Close #ifdef Guard. // os->gen_endif (); diff --git a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp index 0315be8a237..cad2e33b9ff 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp @@ -25,23 +25,23 @@ be_visitor_interface_strategized_proxy_broker_ss::visit_interface (be_interface // Generate the class declaration. os->indent (); - + *os << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl - << "// Strategized Proxy Broker Implementation" << be_nl + << "// Strategized Proxy Broker Implementation" << be_nl << "//" << be_nl << be_nl; *os << "// Factory function Implementation." << be_nl - << node->full_strategized_proxy_broker_name () - << " *" << node->server_enclosing_scope () << "the" + << node->full_strategized_proxy_broker_name () + << " *" << node->full_strategized_proxy_broker_name () << "::the" << node->strategized_proxy_broker_name () << " (void)" << be_nl << "{" << be_idt_nl - << "static " << node->full_strategized_proxy_broker_name () + << "static " << node->full_strategized_proxy_broker_name () << " strategized_proxy_broker;" << be_nl << "return &strategized_proxy_broker;" << be_uidt_nl << "}" << be_nl << be_nl; - + // Constructor Implementation. *os << node->full_strategized_proxy_broker_name () << "::" << node->strategized_proxy_broker_name () << " (void)" << be_nl @@ -67,14 +67,14 @@ be_visitor_interface_strategized_proxy_broker_ss::visit_interface (be_interface // select_proxy impementation *os << node->full_base_proxy_impl_name () << "&" << be_nl <full_strategized_proxy_broker_name () << "::" - << "select_proxy (" + << "select_proxy (" << be_idt << be_idt_nl // idt = 2 - << "::" << node->full_name () << " *object," << be_nl - << "CORBA::Environment &ACE_TRY_ENV" + << "::" << node->full_name () << " *object," << be_nl + << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl // idt = 1 - << ")" + << ")" << be_uidt_nl // idt = 0 - << "{" + << "{" << be_idt_nl // idt = 1 << "TAO_ORB_Core::TAO_Collocation_Strategies strategy =" << be_idt_nl // idt = 2 @@ -95,83 +95,83 @@ be_visitor_interface_strategized_proxy_broker_ss::visit_interface (be_interface // create_proxy implementation *os << "void " << be_nl <full_strategized_proxy_broker_name () << "::" - << "create_proxy (" + << "create_proxy (" << be_idt << be_idt_nl // idt = 2 << "TAO_ORB_Core::TAO_Collocation_Strategies strategy," << be_nl - << "CORBA::Environment &ACE_TRY_ENV" + << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl // idt = 1 << ")" << be_uidt_nl // idt = 0 - << "{" + << "{" << be_idt_nl // idt = 1 << "ACE_GUARD (ACE_SYNCH_MUTEX, guard, this->mutex_);" << be_nl << be_nl - << "if (this->proxy_cache_[strategy] == 0)" + << "if (this->proxy_cache_[strategy] == 0)" << be_idt_nl // idt = 2 - << "{" + << "{" << be_idt_nl // idt = 3 << "switch (strategy)" << be_idt_nl // idt = 4 << "{" << be_nl; if (be_global->gen_thru_poa_collocation ()) - { - *os << "case TAO_ORB_Core::THRU_POA_STRATEGY:" - << be_idt_nl // idt = 5 - << "ACE_NEW_THROW_EX (" - << be_idt << be_idt_nl //idt = 7 - << "this->proxy_cache_[strategy]," << be_nl - << node->full_thru_poa_proxy_impl_name () << "," << be_nl - << "CORBA::NO_MEMORY ()" - << be_uidt << be_uidt_nl // idt = 5 - << ");" << be_nl - << "ACE_CHECK;" << be_nl - << "break;" - << be_nl << be_uidt_nl; // idt = 4 - } + { + *os << "case TAO_ORB_Core::THRU_POA_STRATEGY:" + << be_idt_nl // idt = 5 + << "ACE_NEW_THROW_EX (" + << be_idt << be_idt_nl //idt = 7 + << "this->proxy_cache_[strategy]," << be_nl + << node->full_thru_poa_proxy_impl_name () << "," << be_nl + << "CORBA::NO_MEMORY ()" + << be_uidt << be_uidt_nl // idt = 5 + << ");" << be_nl + << "ACE_CHECK;" << be_nl + << "break;" + << be_nl << be_uidt_nl; // idt = 4 + } if (be_global->gen_direct_collocation ()) - { - *os << "case TAO_ORB_Core::DIRECT_STRATEGY:" - << be_idt_nl // idt = 5 - << "ACE_NEW_THROW_EX (" - << be_idt << be_idt_nl //idt = 7 - << "this->proxy_cache_[strategy]," << be_nl - << node->full_direct_proxy_impl_name () << "," << be_nl - << "CORBA::NO_MEMORY ()" - << be_uidt << be_uidt_nl // idt = 5 - << ");" << be_nl - << "ACE_CHECK;" << be_nl - << "break;" - << be_nl << be_uidt_nl; // idt = 4 - } - + { + *os << "case TAO_ORB_Core::DIRECT_STRATEGY:" + << be_idt_nl // idt = 5 + << "ACE_NEW_THROW_EX (" + << be_idt << be_idt_nl //idt = 7 + << "this->proxy_cache_[strategy]," << be_nl + << node->full_direct_proxy_impl_name () << "," << be_nl + << "CORBA::NO_MEMORY ()" + << be_uidt << be_uidt_nl // idt = 5 + << ");" << be_nl + << "ACE_CHECK;" << be_nl + << "break;" + << be_nl << be_uidt_nl; // idt = 4 + } + *os << "case TAO_ORB_Core::REMOTE_STRATEGY:" << be_nl - << "default:" - << be_idt_nl // idt = 5 - << "ACE_NEW_THROW_EX (" - << be_idt << be_idt_nl //idt = 7 - << "this->proxy_cache_[strategy]," << be_nl - << "::" << node->full_remote_proxy_impl_name () << "," << be_nl - << "CORBA::NO_MEMORY ()" - << be_uidt << be_uidt_nl // idt = 5 - << ");" << be_nl - << "ACE_CHECK;" << be_nl - << "break;" - << be_uidt_nl // idt = 4 - << be_uidt_nl // idt = 3 - - << "}" + << "default:" + << be_idt_nl // idt = 5 + << "ACE_NEW_THROW_EX (" + << be_idt << be_idt_nl //idt = 7 + << "this->proxy_cache_[strategy]," << be_nl + << "::" << node->full_remote_proxy_impl_name () << "," << be_nl + << "CORBA::NO_MEMORY ()" + << be_uidt << be_uidt_nl // idt = 5 + << ");" << be_nl + << "ACE_CHECK;" << be_nl + << "break;" + << be_uidt_nl // idt = 4 + << be_uidt_nl // idt = 3 + + << "}" << be_uidt_nl // idt = 2 << be_uidt_nl // idt = 1 - << "}" + << "}" << be_uidt_nl // idt = 0 - + << "}" << be_nl << be_nl; - + *os << be_nl << "//" << be_nl - << "// End Strategized Proxy Broker Implementation" << be_nl + << "// End Strategized Proxy Broker Implementation" << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl << be_nl; diff --git a/TAO/tao/MessagingC.cpp b/TAO/tao/MessagingC.cpp index a93c379b191..872ce64215a 100644 --- a/TAO/tao/MessagingC.cpp +++ b/TAO/tao/MessagingC.cpp @@ -1596,7 +1596,7 @@ Messaging::_TAO_ReplyHandler_Proxy_Broker::~_TAO_ReplyHandler_Proxy_Broker (void } // Factory function Implementation. -Messaging::_TAO_ReplyHandler_Remote_Proxy_Broker *Messaging::the_TAO_ReplyHandler_Remote_Proxy_Broker (void) +Messaging::_TAO_ReplyHandler_Remote_Proxy_Broker *Messaging::_TAO_ReplyHandler_Remote_Proxy_Broker::the_TAO_ReplyHandler_Remote_Proxy_Broker (void) { static ::Messaging::_TAO_ReplyHandler_Remote_Proxy_Broker remote_proxy_broker; return &remote_proxy_broker; @@ -1642,9 +1642,7 @@ Messaging::ReplyHandler::setup_collocation (int collocated) Messaging__TAO_ReplyHandler_Proxy_Broker_Factory_function_pointer (this); else this->the_TAO_ReplyHandler_Proxy_Broker_ = - ::Messaging::the_TAO_ReplyHandler_Remote_Proxy_Broker (); - - + Messaging::_TAO_ReplyHandler_Remote_Proxy_Broker::the_TAO_ReplyHandler_Remote_Proxy_Broker (); } diff --git a/TAO/tao/MessagingC.h b/TAO/tao/MessagingC.h index d04e5356103..1033c29fe6b 100644 --- a/TAO/tao/MessagingC.h +++ b/TAO/tao/MessagingC.h @@ -2521,7 +2521,7 @@ class _TAO_ReplyHandler_Proxy_Impl; class _TAO_ReplyHandler_Remote_Proxy_Impl; class _TAO_ReplyHandler_Proxy_Broker; class _TAO_ReplyHandler_Remote_Proxy_Broker; - + class TAO_Export ReplyHandler : public virtual CORBA_Object { public: @@ -2560,19 +2560,19 @@ class TAO_Export ReplyHandler : public virtual CORBA_Object private: _TAO_ReplyHandler_Proxy_Broker *the_TAO_ReplyHandler_Proxy_Broker_; - + protected: ReplyHandler (int collocated = 0); - + protected: virtual void setup_collocation (int collocated); ReplyHandler ( - TAO_Stub *objref, - CORBA::Boolean _tao_collocated = 0, - TAO_Abstract_ServantBase *servant = 0 - ); - + TAO_Stub *objref, + CORBA::Boolean _tao_collocated = 0, + TAO_Abstract_ServantBase *servant = 0 + ); + friend class _TAO_ReplyHandler_Remote_Proxy_Impl; friend class _TAO_ReplyHandler_ThruPOA_Proxy_Impl; friend class _TAO_ReplyHandler_Direct_Proxy_Impl; @@ -2588,88 +2588,91 @@ class TAO_Export ReplyHandler : public virtual CORBA_Object // perform a call. Each different implementation encapsulate // an invocation logics. - + /////////////////////////////////////////////////////////////////////// // Base Impl. Declaration // - + class TAO_Export _TAO_ReplyHandler_Proxy_Impl : public virtual TAO_Object_Proxy_Impl { public: virtual ~_TAO_ReplyHandler_Proxy_Impl (void); - + }; - + // // Base Proxy Impl. Declaration /////////////////////////////////////////////////////////////////////// - - + + /////////////////////////////////////////////////////////////////////// // Remote Impl. Declaration // - - class TAO_Export _TAO_ReplyHandler_Remote_Proxy_Impl : + + class TAO_Export _TAO_ReplyHandler_Remote_Proxy_Impl : public virtual _TAO_ReplyHandler_Proxy_Impl, public virtual TAO_Remote_Object_Proxy_Impl { public: virtual ~_TAO_ReplyHandler_Remote_Proxy_Impl (void); - + }; - + // // Base Proxy Impl. Declaration /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// - // Base Proxy Broker Declaration + // Base Proxy Broker Declaration // - + class TAO_Export _TAO_ReplyHandler_Proxy_Broker { public: virtual ~_TAO_ReplyHandler_Proxy_Broker (void); virtual _TAO_ReplyHandler_Proxy_Impl &select_proxy ( - ReplyHandler *object, - CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () - ) = 0; - + ReplyHandler *object, + CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () + ) = 0; + }; - - + + // - // End Base Proxy Broker Declaration + // End Base Proxy Broker Declaration /////////////////////////////////////////////////////////////////////// - - + + /////////////////////////////////////////////////////////////////////// - // Remote Proxy Broker Declaration + // Remote Proxy Broker Declaration // - + class TAO_Export _TAO_ReplyHandler_Remote_Proxy_Broker : public virtual _TAO_ReplyHandler_Proxy_Broker { - public: + public: virtual ~_TAO_ReplyHandler_Remote_Proxy_Broker (void); virtual _TAO_ReplyHandler_Proxy_Impl &select_proxy ( - ReplyHandler *object, - CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () - ); - + ReplyHandler *object, + CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () + ); + private: _TAO_ReplyHandler_Remote_Proxy_Impl remote_proxy_impl_; - }; - - // This funxtion is used to get an handle to the unique instance - // of the Remote Proxy Broker that is available for a given - // interface. - - _TAO_ReplyHandler_Remote_Proxy_Broker *the_TAO_ReplyHandler_Remote_Proxy_Broker (void); - + + public: + // This member function is used to get an handle to the unique instance + // of the Remote Proxy Broker that is available for a given + // interface. + + static _TAO_ReplyHandler_Remote_Proxy_Broker *the_TAO_ReplyHandler_Remote_Proxy_Broker (void); + +}; + + // - // End Remote Proxy Broker Declaration + // End Remote Proxy Broker Declaration /////////////////////////////////////////////////////////////////////// #if (TAO_HAS_SMART_PROXIES == 1) @@ -2856,8 +2859,8 @@ TAO_Export CORBA::Boolean operator>>= (const CORBA::Any &, const Messaging::Poli #if (TAO_HAS_AMI_CALLBACK == 1) extern TAO_Export Messaging::_TAO_ReplyHandler_Proxy_Broker * (*Messaging__TAO_ReplyHandler_Proxy_Broker_Factory_function_pointer) ( - CORBA::Object_ptr obj - ); + CORBA::Object_ptr obj + ); extern TAO_Export Messaging::ReplyHandler_ptr (*_TAO_collocation_Messaging_ReplyHandler_Stub_Factory_function_pointer) ( CORBA::Object_ptr obj diff --git a/TAO/tao/PortableServer/MessagingS.cpp b/TAO/tao/PortableServer/MessagingS.cpp index 2a5bf27d15d..13a619a4f37 100644 --- a/TAO/tao/PortableServer/MessagingS.cpp +++ b/TAO/tao/PortableServer/MessagingS.cpp @@ -131,7 +131,8 @@ static TAO_Messaging_ReplyHandler_Perfect_Hash_OpTable tao_Messaging_ReplyHandle // // Factory function Implementation. -POA_Messaging::_TAO_ReplyHandler_Strategized_Proxy_Broker *POA_Messaging::the_TAO_ReplyHandler_Strategized_Proxy_Broker (void) +POA_Messaging::_TAO_ReplyHandler_Strategized_Proxy_Broker * +POA_Messaging::_TAO_ReplyHandler_Strategized_Proxy_Broker::the_TAO_ReplyHandler_Strategized_Proxy_Broker (void) { static POA_Messaging::_TAO_ReplyHandler_Strategized_Proxy_Broker strategized_proxy_broker; return &strategized_proxy_broker; @@ -141,14 +142,14 @@ POA_Messaging::_TAO_ReplyHandler_Strategized_Proxy_Broker::_TAO_ReplyHandler_Str { for (int i = 0; i < TAO_ORB_Core::COLLOCATION_STRATEGIES_NUM; ++i) this->proxy_cache_[i] = 0; - + } POA_Messaging::_TAO_ReplyHandler_Strategized_Proxy_Broker::~_TAO_ReplyHandler_Strategized_Proxy_Broker (void) { for (int i = 0; i < TAO_ORB_Core::COLLOCATION_STRATEGIES_NUM; ++i) delete this->proxy_cache_[i]; - + } Messaging::_TAO_ReplyHandler_Proxy_Impl& @@ -159,25 +160,25 @@ POA_Messaging::_TAO_ReplyHandler_Strategized_Proxy_Broker::select_proxy ( { TAO_ORB_Core::TAO_Collocation_Strategies strategy = TAO_ORB_Core::collocation_strategy (object); - + if (this->proxy_cache_[strategy] != 0) return *this->proxy_cache_[strategy]; - + this->create_proxy (strategy, ACE_TRY_ENV); ACE_CHECK_RETURN (*this->proxy_cache_[strategy]); - + return *this->proxy_cache_[strategy]; - + } -void +void POA_Messaging::_TAO_ReplyHandler_Strategized_Proxy_Broker::create_proxy ( TAO_ORB_Core::TAO_Collocation_Strategies strategy, CORBA::Environment &ACE_TRY_ENV ) { ACE_GUARD (ACE_SYNCH_MUTEX, guard, this->mutex_); - + if (this->proxy_cache_[strategy] == 0) { switch (strategy) @@ -190,7 +191,7 @@ POA_Messaging::_TAO_ReplyHandler_Strategized_Proxy_Broker::create_proxy ( ); ACE_CHECK; break; - + case TAO_ORB_Core::DIRECT_STRATEGY: ACE_NEW_THROW_EX ( this->proxy_cache_[strategy], @@ -199,7 +200,7 @@ POA_Messaging::_TAO_ReplyHandler_Strategized_Proxy_Broker::create_proxy ( ); ACE_CHECK; break; - + case TAO_ORB_Core::REMOTE_STRATEGY: default: ACE_NEW_THROW_EX ( @@ -209,9 +210,9 @@ POA_Messaging::_TAO_ReplyHandler_Strategized_Proxy_Broker::create_proxy ( ); ACE_CHECK; break; - + } - + } } @@ -225,21 +226,21 @@ Messaging::_TAO_ReplyHandler_Proxy_Broker * Messaging__TAO_ReplyHandler_Proxy_Broker_Factory_function (CORBA::Object_ptr obj) { ACE_UNUSED_ARG (obj); - return POA_Messaging::the_TAO_ReplyHandler_Strategized_Proxy_Broker(); + return POA_Messaging::_TAO_ReplyHandler_Strategized_Proxy_Broker::the_TAO_ReplyHandler_Strategized_Proxy_Broker (); } int Messaging__TAO_ReplyHandler_Proxy_Broker_Factory_Initializer (long _dummy_) { ACE_UNUSED_ARG (_dummy_); - - Messaging__TAO_ReplyHandler_Proxy_Broker_Factory_function_pointer = + + Messaging__TAO_ReplyHandler_Proxy_Broker_Factory_function_pointer = Messaging__TAO_ReplyHandler_Proxy_Broker_Factory_function; - + return 0; } -static int Messaging__TAO_ReplyHandler_Proxy_Broker_Stub_Factory_Initializer_Scarecrow = +static int Messaging__TAO_ReplyHandler_Proxy_Broker_Stub_Factory_Initializer_Scarecrow = Messaging__TAO_ReplyHandler_Proxy_Broker_Factory_Initializer (ACE_reinterpret_cast (long, Messaging__TAO_ReplyHandler_Proxy_Broker_Factory_Initializer)); @@ -371,14 +372,14 @@ POA_Messaging::ReplyHandler::_this (CORBA_Environment &ACE_TRY_ENV) { TAO_Stub *stub = this->_create_stub (ACE_TRY_ENV); ACE_CHECK_RETURN (0); - + CORBA::Object_ptr tmp = CORBA::Object::_nil (); - + if (stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ()) ACE_NEW_RETURN (tmp, CORBA::Object (stub, 1, this), 0); else ACE_NEW_RETURN (tmp, CORBA::Object (stub, 0, this), 0); - + CORBA::Object_var obj = tmp; return ::Messaging::ReplyHandler::_unchecked_narrow (obj.in ()); } diff --git a/TAO/tao/PortableServer/MessagingS.h b/TAO/tao/PortableServer/MessagingS.h index 6a417dafebe..a5db18307fd 100644 --- a/TAO/tao/PortableServer/MessagingS.h +++ b/TAO/tao/PortableServer/MessagingS.h @@ -40,7 +40,7 @@ TAO_NAMESPACE POA_Messaging { #if (TAO_HAS_AMI_CALLBACK == 1) - + // Forward Classes Declaration class _TAO_ReplyHandler_ThruPOA_Proxy_Impl; class _TAO_ReplyHandler_Direct_Proxy_Impl; @@ -102,12 +102,12 @@ TAO_NAMESPACE POA_Messaging /////////////////////////////////////////////////////////////////////// - // Strategized Proxy Broker Declaration + // Strategized Proxy Broker Declaration // - + class TAO_PortableServer_Export _TAO_ReplyHandler_Strategized_Proxy_Broker : public virtual ::Messaging::_TAO_ReplyHandler_Proxy_Broker { - public: + public: _TAO_ReplyHandler_Strategized_Proxy_Broker (void); virtual ~_TAO_ReplyHandler_Strategized_Proxy_Broker (void); @@ -116,35 +116,36 @@ TAO_NAMESPACE POA_Messaging ::Messaging::ReplyHandler *object, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () ); - + private: - + // Helper methods that takes care to create the proxy // as soon as their use is necessary. void create_proxy ( TAO_ORB_Core::TAO_Collocation_Strategies strategy, CORBA::Environment &ACE_TRY_ENV ); - + private: - + // Caches the proxy implementations. The proxy implementation // are totally stateless, and those can be shared by all the // instances of a given IDL interface type. ::Messaging::_TAO_ReplyHandler_Proxy_Impl *proxy_cache_[TAO_ORB_Core::COLLOCATION_STRATEGIES_NUM]; - + ACE_SYNCH_MUTEX mutex_; + + public: + // This funxtion is used to get an handle to the unique instance + // of the Strategized Proxy Broker that is available for a given + // interface. + + static _TAO_ReplyHandler_Strategized_Proxy_Broker *the_TAO_ReplyHandler_Strategized_Proxy_Broker (void); }; - - // This funxtion is used to get an handle to the unique instance - // of the Strategized Proxy Broker that is available for a given - // interface. - - _TAO_ReplyHandler_Strategized_Proxy_Broker *the_TAO_ReplyHandler_Strategized_Proxy_Broker (void); - + // - // End Strategized Proxy Broker Declaration + // End Strategized Proxy Broker Declaration /////////////////////////////////////////////////////////////////////// @@ -152,13 +153,13 @@ TAO_NAMESPACE POA_Messaging // ThruPOA Impl. Declaration // -class TAO_PortableServer_Export _TAO_ReplyHandler_ThruPOA_Proxy_Impl : +class TAO_PortableServer_Export _TAO_ReplyHandler_ThruPOA_Proxy_Impl : public virtual ::Messaging::_TAO_ReplyHandler_Proxy_Impl, public virtual TAO_ThruPOA_Object_Proxy_Impl { public: ~_TAO_ReplyHandler_ThruPOA_Proxy_Impl (void); - + }; @@ -171,13 +172,13 @@ public: // Direct Impl. Declaration // - class TAO_PortableServer_Export _TAO_ReplyHandler_Direct_Proxy_Impl : + class TAO_PortableServer_Export _TAO_ReplyHandler_Direct_Proxy_Impl : public virtual Messaging::_TAO_ReplyHandler_Proxy_Impl, public virtual TAO_Direct_Object_Proxy_Impl { public: ~_TAO_ReplyHandler_Direct_Proxy_Impl (void); - + }; // -- cgit v1.2.1