diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2005-02-22 10:09:24 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2005-02-22 10:09:24 +0000 |
commit | 3cc357789f4d46c6cc3f78610c9ba4fe36aa4e0d (patch) | |
tree | 7ef3ccaa88be55250076d461f3e7435a6b8b9b2a /TAO/tao | |
parent | a83f2d9caf6a2ef09e08b203762e3e7785d9e86f (diff) | |
download | ATCD-3cc357789f4d46c6cc3f78610c9ba4fe36aa4e0d.tar.gz |
ChangeLogTag:Tue Feb 22 02:03:20 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
Diffstat (limited to 'TAO/tao')
91 files changed, 3191 insertions, 2400 deletions
diff --git a/TAO/tao/Abstract_Servant_Base.h b/TAO/tao/Abstract_Servant_Base.h index 2fb1e26a510..d58be951cc0 100644 --- a/TAO/tao/Abstract_Servant_Base.h +++ b/TAO/tao/Abstract_Servant_Base.h @@ -105,9 +105,6 @@ public: virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL); //@} - /// Get the correct vtable. - virtual void *_downcast (const char *repository_id) = 0; - /// This is an auxiliary method for _this() and _narrow(). virtual TAO_Stub *_create_stub (ACE_ENV_SINGLE_ARG_DECL) = 0; diff --git a/TAO/tao/Any_Arg_Traits.h b/TAO/tao/Any_Arg_Traits.h index 624e051bdd9..5cbf50e0558 100644 --- a/TAO/tao/Any_Arg_Traits.h +++ b/TAO/tao/Any_Arg_Traits.h @@ -16,14 +16,14 @@ #include /**/ "ace/pre.h" +#include "tao/TAO_Export.h" + #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/Arg_Traits_T.h" #include "tao/Var_Size_Argument_T.h" -#include "tao/Var_Size_SArgument_T.h" -#include "tao/TAO_Export.h" +#include "tao/Arg_Traits_T.h" namespace CORBA { @@ -44,17 +44,6 @@ namespace TAO > { }; - - template<> - class TAO_Export SArg_Traits<CORBA::Any> - : public - Var_Size_SArg_Traits_T< - CORBA::Any, - CORBA::Any_var, - CORBA::Any_out - > - { - }; } #include /**/ "ace/post.h" diff --git a/TAO/tao/Argument.h b/TAO/tao/Argument.h index 647b26a1685..0a42a2a7064 100644 --- a/TAO/tao/Argument.h +++ b/TAO/tao/Argument.h @@ -15,6 +15,7 @@ #define TAO_ARGUMENT_H #include /**/ "ace/pre.h" + #include "tao/Basic_Types.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -42,19 +43,58 @@ namespace TAO /** * @class Argument * - * @brief Base class for template argument classes. + * @brief Base class for argument class templates. * + * @c Argument subclasses override the virtual methods + * appropriately. For example, a stub "IN" argument class + * template would override the @c marshal() method, but wouldn't + * need to override the @c demarshal() method. */ class TAO_Export Argument { public: + + /// Destructor. virtual ~Argument (void); + + /// Marshal the argument into the given CDR output stream. + /** + * @note The default implementation simply returns @c true. + */ virtual CORBA::Boolean marshal (TAO_OutputCDR &); + + /// Demarshal the argument from the given CDR input stream. + /** + * @note The default implementation simply returns @c true. + */ virtual CORBA::Boolean demarshal (TAO_InputCDR &); + #if TAO_HAS_INTERCEPTORS == 1 + + /** + * @name Portable Interceptor Related Methods + * + * These methods are only used when setting up + * @c PortableInterceptor::RequestInfo instances with the + * appropriate operation-specific parameter list and return + * value, if either or both exist. + */ + //@{ + /// Populate the given @a Dynamic::Parameter argument. + /** + * @note The default implementation is a no-op. + */ virtual void interceptor_param (Dynamic::Parameter &); + + /// Populate the given @a CORBA::Any result argument. + /** + * @note The default implementation is a no-op. + */ virtual void interceptor_result (CORBA::Any *); + //@} + #endif /* TAO_HAS_INTERCEPTORS == 1 */ + }; } diff --git a/TAO/tao/BD_String_Argument_T.h b/TAO/tao/BD_String_Argument_T.h index 43502f0b869..20a8e86e45b 100644 --- a/TAO/tao/BD_String_Argument_T.h +++ b/TAO/tao/BD_String_Argument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -15,6 +15,7 @@ #define TAO_BD_STRING_ARGUMENT_T_H #include /**/ "ace/pre.h" + #include "ace/CDR_Stream.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -38,13 +39,17 @@ namespace TAO In_BD_String_Argument_T (const S * x); virtual CORBA::Boolean marshal (TAO_OutputCDR &); + #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - const S * arg (void) const; + + S const * arg (void) const; private: - const S * x_; + + S const * x_; + }; /** @@ -67,7 +72,7 @@ namespace TAO S *& arg (void); private: - mutable S *& x_; + S *& x_; }; /** @@ -93,7 +98,7 @@ namespace TAO S *& arg (void); private: - mutable S *& x_; + S *& x_; }; /** @@ -122,7 +127,9 @@ namespace TAO S * retn (void); private: + S_var x_; + }; /** @@ -134,7 +141,7 @@ namespace TAO struct TAO_Export BD_String_Tag {}; /** - * @struct Basic_Arg_Traits_T + * @struct BD_String_Arg_Traits_T * * @brief Template class for stub argument traits of bounded (w)strings. * @@ -148,7 +155,7 @@ namespace TAO struct BD_String_Arg_Traits_T { typedef T * ret_type; - typedef const T * in_type; + typedef T const * in_type; typedef T *& inout_type; typedef T_out out_type; diff --git a/TAO/tao/Basic_Argument_T.h b/TAO/tao/Basic_Argument_T.h index 101aa3d94c5..5f41f537813 100644 --- a/TAO/tao/Basic_Argument_T.h +++ b/TAO/tao/Basic_Argument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -66,7 +66,7 @@ namespace TAO S & arg (void); private: - mutable S & x_; + S & x_; }; /** diff --git a/TAO/tao/CDR.cpp b/TAO/tao/CDR.cpp index 89cbe621255..ccc993ff3b0 100644 --- a/TAO/tao/CDR.cpp +++ b/TAO/tao/CDR.cpp @@ -1,37 +1,5 @@ // $Id$ - -// Portions of this file are: -// Copyright 1994-1995 by Sun Microsystems Inc. -// All Rights Reserved - -// CDR: Encode/Decode basic machine data types -// -// Implementation of OMG "Common Data Representation" (CDR) ... there -// are one routine each for byte/halfword/word/doubleword put/get, -// which adjust to establish "natural" alignment (the bulk of the -// code) and then put or get with byteswapping as needed. -// -// The implementation knows that native data formats are conformant -// with OMG-IDL's (and hence CDR's) size requirements, and relies on -// the fact that (for example) CORBA::Long is always four bytes long -// even if the environment's "int" is a different size. -// -// char, octet 8 bits (1 byte) -// short, unsigned short 16 bits (2 bytes) -// long, unsigned long, float 32 bits (4 bytes) -// double, (unsigned) long long 64 bits (8 bytes) -// long double 128 bits (16 bytes) -// -// Moreover, this "knows" that the native 'char' represents ISO -// Latin/1 characters (an ASCII superset addressing Western European -// characters) and that "double" and "float" comply with the IEEE -// standards. (The "long double" may not be a native data type, -// though.) -// -// THREADING NOTE: "CDR" is a data structure which must be protected -// by external critical sections. - #include "tao/CDR.h" #include "tao/Timeprobe.h" #include "tao/ORB_Core.h" @@ -43,8 +11,9 @@ #endif /* ! __ACE_INLINE__ */ -ACE_RCSID(tao, CDR, "$Id$") - +ACE_RCSID (tao, + CDR, + "$Id$") #if defined (ACE_ENABLE_TIMEPROBES) @@ -162,22 +131,25 @@ TAO_OutputCDR::throw_skel_exception (int error_num ACE_ENV_ARG_DECL) { case 0 : break; + case EINVAL : // wchar from a GIOP 1.0 - ACE_THROW (CORBA::MARSHAL(CORBA::OMGVMCID | 5, CORBA::COMPLETED_YES)); + ACE_THROW (CORBA::MARSHAL (CORBA::OMGVMCID | 5, CORBA::COMPLETED_YES)); ACE_NOTREACHED(break); case EACCES : // wchar but no codeset - ACE_THROW (CORBA::BAD_PARAM(CORBA::OMGVMCID | 23, CORBA::COMPLETED_YES)); + ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 23, + CORBA::COMPLETED_YES)); ACE_NOTREACHED(break); #if (ERANGE != EINVAL) case ERANGE : // untranslatable character - ACE_THROW (CORBA::DATA_CONVERSION(CORBA::OMGVMCID | 1, CORBA::COMPLETED_YES)); + ACE_THROW (CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 1, + CORBA::COMPLETED_YES)); ACE_NOTREACHED(break); #endif default : - ACE_THROW (CORBA::MARSHAL(0, CORBA::COMPLETED_YES)); + ACE_THROW (CORBA::MARSHAL (0, CORBA::COMPLETED_YES)); } } diff --git a/TAO/tao/Collocated_Invocation.cpp b/TAO/tao/Collocated_Invocation.cpp index 584414397cc..6c3f17b6f1b 100644 --- a/TAO/tao/Collocated_Invocation.cpp +++ b/TAO/tao/Collocated_Invocation.cpp @@ -1,11 +1,16 @@ #include "Collocated_Invocation.h" #include "Collocation_Proxy_Broker.h" +#include "ORB_Core.h" +#include "Request_Dispatcher.h" +#include "TAO_Server_Request.h" #include "operation_details.h" + ACE_RCSID (tao, Collocated_Invocation, "$Id$") + namespace TAO { Collocated_Invocation::Collocated_Invocation (CORBA::Object_ptr t, @@ -41,15 +46,35 @@ namespace TAO ACE_TRY { - cpb->dispatch (this->effective_target (), - this->forwarded_to_.out (), - this->details_.args (), - this->details_.args_num (), - this->details_.opname (), - this->details_.opname_len (), - strat - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + if (strat == TAO_CS_THRU_POA_STRATEGY) + { + TAO_ORB_Core * const orb_core = this->orb_core (); + + TAO_ServerRequest request (orb_core, + this->details_, + this->effective_target ()); + + TAO_Request_Dispatcher * const dispatcher = + orb_core->request_dispatcher (); + + dispatcher->dispatch (orb_core, + request, + this->forwarded_to_.out () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + else + { + cpb->dispatch (this->effective_target (), + this->forwarded_to_.out (), + this->details_.args (), + this->details_.args_num (), + this->details_.opname (), + this->details_.opname_len (), + strat + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } // Invocation completed succesfully s = TAO_INVOKE_SUCCESS; diff --git a/TAO/tao/DynamicInterface/Server_Request.cpp b/TAO/tao/DynamicInterface/Server_Request.cpp index 4af2cafe296..776104d7ed6 100644 --- a/TAO/tao/DynamicInterface/Server_Request.cpp +++ b/TAO/tao/DynamicInterface/Server_Request.cpp @@ -92,7 +92,7 @@ CORBA::ServerRequest::arguments (CORBA::NVList_ptr &list // Save params for later use when marshaling the reply. this->params_ = list; - this->params_->_tao_incoming_cdr (this->orb_server_request_.incoming (), + this->params_->_tao_incoming_cdr (*this->orb_server_request_.incoming (), CORBA::ARG_IN | CORBA::ARG_INOUT, this->lazy_evaluation_ ACE_ENV_ARG_PARAMETER); diff --git a/TAO/tao/DynamicInterface/Server_Request.inl b/TAO/tao/DynamicInterface/Server_Request.inl index dea7c3e0b05..8431d78ad0d 100644 --- a/TAO/tao/DynamicInterface/Server_Request.inl +++ b/TAO/tao/DynamicInterface/Server_Request.inl @@ -65,13 +65,13 @@ CORBA::ServerRequest::_tao_lazy_evaluation (bool lazy_evaluation) ACE_INLINE int CORBA::ServerRequest::_tao_incoming_byte_order (void) const { - return this->orb_server_request_.incoming ().byte_order (); + return this->orb_server_request_.incoming ()->byte_order (); } ACE_INLINE void CORBA::ServerRequest::_tao_reply_byte_order (int byte_order) { - this->orb_server_request_.outgoing ().reset_byte_order (byte_order); + this->orb_server_request_.outgoing ()->reset_byte_order (byte_order); } diff --git a/TAO/tao/Fixed_Array_Argument_T.h b/TAO/tao/Fixed_Array_Argument_T.h index e4506ec5d8c..bf3522022e5 100644 --- a/TAO/tao/Fixed_Array_Argument_T.h +++ b/TAO/tao/Fixed_Array_Argument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -39,7 +39,7 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - const S_slice * arg (void) const; + S_slice const * arg (void) const; private: S_forany x_; @@ -84,7 +84,7 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - S_slice *& arg (void); + S_slice *& arg (void); private: S_forany x_; @@ -141,7 +141,7 @@ namespace TAO struct Fixed_Array_Arg_Traits_T { typedef T_slice * ret_type; - typedef const T in_type; + typedef T const in_type; typedef T inout_type; typedef T out_type; diff --git a/TAO/tao/Fixed_Array_SArgument_T.cpp b/TAO/tao/Fixed_Array_SArgument_T.cpp deleted file mode 100644 index 48c9cda74c8..00000000000 --- a/TAO/tao/Fixed_Array_SArgument_T.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// $Id$ - -#ifndef TAO_FIXED_ARRAY_SARGUMENT_T_C -#define TAO_FIXED_ARRAY_SARGUMENT_T_C - -#include "tao/Fixed_Array_SArgument_T.h" -#include "tao/Dynamic_ParameterC.h" - -#if !defined (__ACE_INLINE__) -#include "tao/Fixed_Array_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID (tao, - Fixed_Array_SArgument_T, - "$Id$") - -template<typename S, typename S_forany> -CORBA::Boolean -TAO::In_Fixed_Array_SArgument_T<S,S_forany>::demarshal (TAO_InputCDR &cdr) -{ - S_forany tmp (this->x_); - return cdr >> tmp; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, typename S_forany> -void -TAO::In_Fixed_Array_SArgument_T<S,S_forany>::interceptor_param ( - Dynamic::Parameter & p - ) -{ - p.argument <<= S_forany (this->x_); - p.mode = CORBA::PARAM_IN; -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// =========================================================== - -template<typename S, typename S_forany> -CORBA::Boolean -TAO::Inout_Fixed_Array_SArgument_T<S,S_forany>::marshal (TAO_OutputCDR & cdr) -{ - return cdr << S_forany (this->x_); -} - -template<typename S, typename S_forany> -CORBA::Boolean -TAO::Inout_Fixed_Array_SArgument_T<S,S_forany>::demarshal (TAO_InputCDR & cdr) -{ - S_forany tmp (this->x_); - return cdr >> tmp; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, typename S_forany> -void -TAO::Inout_Fixed_Array_SArgument_T<S,S_forany>::interceptor_param ( - Dynamic::Parameter & p - ) -{ - p.argument <<= S_forany (this->x_); - p.mode = CORBA::PARAM_INOUT; -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================== - -template<typename S, typename S_forany> -CORBA::Boolean -TAO::Out_Fixed_Array_SArgument_T<S,S_forany>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << S_forany (this->x_); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, typename S_forany> -void -TAO::Out_Fixed_Array_SArgument_T<S,S_forany>::interceptor_param ( - Dynamic::Parameter & p - ) -{ - p.argument <<= S_forany (this->x_); - p.mode = CORBA::PARAM_OUT; -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================ - -template<typename S_slice, typename S_var, typename S_forany> -CORBA::Boolean -TAO::Ret_Fixed_Array_SArgument_T<S_slice,S_var,S_forany>::marshal ( - TAO_OutputCDR & cdr - ) -{ - return cdr << S_forany (this->x_.inout ()); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_slice, typename S_var, typename S_forany> -void -TAO::Ret_Fixed_Array_SArgument_T<S_slice,S_var,S_forany>::interceptor_result ( - CORBA::Any * any - ) -{ - (*any) <<= S_forany (this->x_.ptr ()); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -#endif /* TAO_FIXED_ARRAY_SARGUMENT_T_C */ diff --git a/TAO/tao/Fixed_Array_SArgument_T.inl b/TAO/tao/Fixed_Array_SArgument_T.inl deleted file mode 100644 index 4595eecce77..00000000000 --- a/TAO/tao/Fixed_Array_SArgument_T.inl +++ /dev/null @@ -1,63 +0,0 @@ -// $Id$ - -template<typename S, typename S_forany> -ACE_INLINE -TAO::In_Fixed_Array_SArgument_T<S,S_forany>::In_Fixed_Array_SArgument_T (void) -{} - -template<typename S, typename S_forany> -ACE_INLINE -const S & -TAO::In_Fixed_Array_SArgument_T<S,S_forany>::arg (void) const -{ - return this->x_; -} - -// =========================================================================== - -template<typename S, typename S_forany> -ACE_INLINE -TAO::Inout_Fixed_Array_SArgument_T<S,S_forany>:: -Inout_Fixed_Array_SArgument_T (void) -{} - -template<typename S, typename S_forany> -ACE_INLINE -S & -TAO::Inout_Fixed_Array_SArgument_T<S,S_forany>::arg (void) -{ - return this->x_; -} - -// =========================================================================== - -template<typename S, typename S_forany> -ACE_INLINE -TAO::Out_Fixed_Array_SArgument_T<S,S_forany>::Out_Fixed_Array_SArgument_T ( - void - ) -{} - -template<typename S, typename S_forany> -ACE_INLINE -S & -TAO::Out_Fixed_Array_SArgument_T<S,S_forany>::arg (void) -{ - return this->x_; -} - -// =========================================================================== - -template<typename S_slice, typename S_var, typename S_forany> -ACE_INLINE -TAO::Ret_Fixed_Array_SArgument_T<S_slice,S_var,S_forany>:: -Ret_Fixed_Array_SArgument_T (void) -{} - -template<typename S_slice, typename S_var, typename S_forany> -ACE_INLINE -S_slice *& -TAO::Ret_Fixed_Array_SArgument_T<S_slice,S_var,S_forany>::arg (void) -{ - return this->x_.out (); -} diff --git a/TAO/tao/Fixed_Size_Argument_T.h b/TAO/tao/Fixed_Size_Argument_T.h index c2cabced3e4..c71bf4047ba 100644 --- a/TAO/tao/Fixed_Size_Argument_T.h +++ b/TAO/tao/Fixed_Size_Argument_T.h @@ -39,10 +39,10 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - const S & arg (void) const; + S const & arg (void) const; private: - const S * x_; + S const * x_; }; /** @@ -87,7 +87,8 @@ namespace TAO S & arg (void); private: - mutable S & x_; + + S & x_; }; /** @@ -133,7 +134,7 @@ namespace TAO struct Fixed_Size_Arg_Traits_T { typedef T ret_type; - typedef const T & in_type; + typedef T const & in_type; typedef T & inout_type; typedef T & out_type; diff --git a/TAO/tao/GIOP_Message_Generator_Parser_10.cpp b/TAO/tao/GIOP_Message_Generator_Parser_10.cpp index dad464a724c..c76d5b60b18 100644 --- a/TAO/tao/GIOP_Message_Generator_Parser_10.cpp +++ b/TAO/tao/GIOP_Message_Generator_Parser_10.cpp @@ -322,7 +322,7 @@ TAO_GIOP_Message_Generator_Parser_10::parse_request_header ( // infrastructure. // Get the input CDR in the request class - TAO_InputCDR& input = request.incoming (); + TAO_InputCDR & input = *request.incoming (); IOP::ServiceContextList &service_info = request.request_service_info (); diff --git a/TAO/tao/GIOP_Message_Generator_Parser_12.cpp b/TAO/tao/GIOP_Message_Generator_Parser_12.cpp index 04daba08086..411058acd2a 100644 --- a/TAO/tao/GIOP_Message_Generator_Parser_12.cpp +++ b/TAO/tao/GIOP_Message_Generator_Parser_12.cpp @@ -253,7 +253,7 @@ TAO_GIOP_Message_Generator_Parser_12::parse_request_header ( ) { // Get the input CDR in the request class - TAO_InputCDR& input = request.incoming (); + TAO_InputCDR & input = *request.incoming (); CORBA::Boolean hdr_status = (CORBA::Boolean) input.good_bit (); diff --git a/TAO/tao/GIOP_Message_Lite.cpp b/TAO/tao/GIOP_Message_Lite.cpp index 4c13403bdfe..d56e5a5dee0 100644 --- a/TAO/tao/GIOP_Message_Lite.cpp +++ b/TAO/tao/GIOP_Message_Lite.cpp @@ -1293,7 +1293,7 @@ int TAO_GIOP_Message_Lite::parse_request_header (TAO_ServerRequest &request) { // Get the input CDR in the request class - TAO_InputCDR& input = request.incoming (); + TAO_InputCDR & input = *request.incoming (); CORBA::Boolean hdr_status = (CORBA::Boolean) input.good_bit (); diff --git a/TAO/tao/Invocation_Adapter.cpp b/TAO/tao/Invocation_Adapter.cpp index ceac1257dd7..58ba52b5fa3 100644 --- a/TAO/tao/Invocation_Adapter.cpp +++ b/TAO/tao/Invocation_Adapter.cpp @@ -129,7 +129,7 @@ namespace TAO TAO_Stub * Invocation_Adapter::get_stub (ACE_ENV_SINGLE_ARG_DECL) const { - TAO_Stub *stub = + TAO_Stub * const stub = this->target_->_stubobj (); if (stub == 0) diff --git a/TAO/tao/Invocation_Adapter.h b/TAO/tao/Invocation_Adapter.h index 23e75c89b8a..d9f3ad21c1e 100644 --- a/TAO/tao/Invocation_Adapter.h +++ b/TAO/tao/Invocation_Adapter.h @@ -240,40 +240,43 @@ namespace TAO void set_response_flags (TAO_Stub *stub, TAO_Operation_Details &details); + private: + /// Dont allow default initializations + Invocation_Adapter (void); + + // Prevent copying + Invocation_Adapter (Invocation_Adapter const &); + Invocation_Adapter & operator= (const Invocation_Adapter &); + protected: /// The target object on which this invocation is carried out. CORBA::Object_ptr target_; /// Array of arguments for this operation - Argument **args_; + Argument ** const args_; /// Number of arguments for this operation. /** * This includes the return values too */ - const int number_args_; + int const number_args_; /// Name of the operation. - const char *operation_; + char const * operation_; /// String length of the operation name. - const int op_len_; - + int const op_len_; + /// Collocation proxy broker for this operation. - Collocation_Proxy_Broker *cpb_; + Collocation_Proxy_Broker * const cpb_; /// The invocation type - Invocation_Type type_; + Invocation_Type const type_; /// The invocation mode - Invocation_Mode mode_; - - private: - /// Dont allow default initializations - ACE_UNIMPLEMENTED_FUNC (Invocation_Adapter (void)) + Invocation_Mode const mode_; - ACE_UNIMPLEMENTED_FUNC (Invocation_Adapter & operator= (const Invocation_Adapter &)) }; } // End namespace TAO diff --git a/TAO/tao/Object_Argument_T.h b/TAO/tao/Object_Argument_T.h index 206d20fc631..2e2d86fb2a3 100644 --- a/TAO/tao/Object_Argument_T.h +++ b/TAO/tao/Object_Argument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -15,6 +15,7 @@ #define TAO_OBJECT_ARGUMENT_T_H #include /**/ "ace/pre.h" + #include "tao/Argument.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -70,7 +71,7 @@ namespace TAO S_ptr & arg (void); private: - mutable S_ptr & x_; + S_ptr & x_; }; /** @@ -92,7 +93,7 @@ namespace TAO S_out arg (void); private: - mutable S_ptr & x_; + S_ptr & x_; }; /** @@ -105,6 +106,7 @@ namespace TAO class Ret_Object_Argument_T : public Argument { public: + Ret_Object_Argument_T (void); virtual CORBA::Boolean demarshal (TAO_InputCDR &); diff --git a/TAO/tao/Object_Argument_T.inl b/TAO/tao/Object_Argument_T.inl index c3db6b0ffdd..feb64a6af6e 100644 --- a/TAO/tao/Object_Argument_T.inl +++ b/TAO/tao/Object_Argument_T.inl @@ -1,3 +1,5 @@ +// -*- C++ -*- +// // $Id$ template<typename S_ptr> diff --git a/TAO/tao/PolicyA.cpp b/TAO/tao/PolicyA.cpp index 86293998b21..333293fa25b 100644 --- a/TAO/tao/PolicyA.cpp +++ b/TAO/tao/PolicyA.cpp @@ -33,7 +33,7 @@ #include "tao/Any_Dual_Impl_T.h" // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:295 +// be/be_visitor_typecode/typecode_defn.cpp:295 static const CORBA::Long _oc_CORBA_PolicyErrorCode[] = { @@ -68,12 +68,12 @@ static CORBA::TypeCode _tc_TAO_tc_CORBA_PolicyErrorCode ( namespace CORBA { - ::CORBA::TypeCode_ptr _tc_PolicyErrorCode = + ::CORBA::TypeCode_ptr const _tc_PolicyErrorCode = &_tc_TAO_tc_CORBA_PolicyErrorCode; } // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:295 +// be/be_visitor_typecode/typecode_defn.cpp:295 static const CORBA::Long _oc_CORBA_Policy[] = { @@ -102,12 +102,12 @@ static CORBA::TypeCode _tc_TAO_tc_CORBA_Policy ( namespace CORBA { - ::CORBA::TypeCode_ptr _tc_Policy = + ::CORBA::TypeCode_ptr const _tc_Policy = &_tc_TAO_tc_CORBA_Policy; } // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:295 +// be/be_visitor_typecode/typecode_defn.cpp:295 static const CORBA::Long _oc_CORBA_PolicyManager[] = { @@ -139,12 +139,12 @@ static CORBA::TypeCode _tc_TAO_tc_CORBA_PolicyManager ( namespace CORBA { - ::CORBA::TypeCode_ptr _tc_PolicyManager = + ::CORBA::TypeCode_ptr const _tc_PolicyManager = &_tc_TAO_tc_CORBA_PolicyManager; } // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:295 +// be/be_visitor_typecode/typecode_defn.cpp:295 static const CORBA::Long _oc_CORBA_PolicyCurrent[] = { @@ -176,12 +176,12 @@ static CORBA::TypeCode _tc_TAO_tc_CORBA_PolicyCurrent ( namespace CORBA { - ::CORBA::TypeCode_ptr _tc_PolicyCurrent = + ::CORBA::TypeCode_ptr const _tc_PolicyCurrent = &_tc_TAO_tc_CORBA_PolicyCurrent; } // TAO_IDL - Generated from -// be\be_visitor_exception/any_op_cs.cpp:50 +// be/be_visitor_exception/any_op_cs.cpp:50 ACE_TEMPLATE_SPECIALIZATION CORBA::Boolean @@ -266,7 +266,7 @@ CORBA::Boolean operator>>= ( } // TAO_IDL - Generated from -// be\be_visitor_exception/any_op_cs.cpp:50 +// be/be_visitor_exception/any_op_cs.cpp:50 ACE_TEMPLATE_SPECIALIZATION CORBA::Boolean @@ -351,7 +351,7 @@ CORBA::Boolean operator>>= ( } // TAO_IDL - Generated from -// be\be_visitor_interface/any_op_cs.cpp:50 +// be/be_visitor_interface/any_op_cs.cpp:50 ACE_TEMPLATE_SPECIALIZATION CORBA::Boolean @@ -406,7 +406,7 @@ operator>>= ( } // TAO_IDL - Generated from -// be\be_visitor_interface/any_op_cs.cpp:50 +// be/be_visitor_interface/any_op_cs.cpp:50 ACE_TEMPLATE_SPECIALIZATION CORBA::Boolean @@ -475,7 +475,7 @@ operator>>= ( } // TAO_IDL - Generated from -// be\be_visitor_interface/any_op_cs.cpp:50 +// be/be_visitor_interface/any_op_cs.cpp:50 ACE_TEMPLATE_SPECIALIZATION CORBA::Boolean diff --git a/TAO/tao/PolicyC.cpp b/TAO/tao/PolicyC.cpp index 4ea5cc52a6c..0bada5796b5 100644 --- a/TAO/tao/PolicyC.cpp +++ b/TAO/tao/PolicyC.cpp @@ -26,7 +26,7 @@ // http://www.cs.wustl.edu/~schmidt/TAO.html // TAO_IDL - Generated from -// be\be_codegen.cpp:302 +// be/be_codegen.cpp:302 #include "PolicyC.h" @@ -48,7 +48,7 @@ #endif /* !defined INLINE */ // TAO_IDL - Generated from -// be\be_visitor_arg_traits.cpp:66 +// be/be_visitor_arg_traits.cpp:69 // Arg traits specializations. namespace TAO @@ -57,7 +57,7 @@ namespace TAO #if !defined (_CORBA_POLICY__ARG_TRAITS_CS_) #define _CORBA_POLICY__ARG_TRAITS_CS_ - ACE_TEMPLATE_SPECIALIZATION + template<> class TAO_Export Arg_Traits<CORBA::Policy> : public Object_Arg_Traits_T< @@ -74,7 +74,7 @@ namespace TAO // TAO_IDL - Generated from -// be\be_visitor_exception/exception_cs.cpp:63 +// be/be_visitor_exception/exception_cs.cpp:63 CORBA::PolicyError::PolicyError (void) : CORBA::UserException ( @@ -177,7 +177,7 @@ void CORBA::PolicyError::_tao_decode ( // TAO_IDL - Generated from -// be\be_visitor_exception/exception_ctor.cpp:66 +// be/be_visitor_exception/exception_ctor.cpp:66 CORBA::PolicyError::PolicyError ( CORBA::PolicyErrorCode _tao_reason @@ -197,7 +197,7 @@ CORBA::TypeCode_ptr CORBA::PolicyError::_type (void) const } // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:295 +// be/be_visitor_typecode/typecode_defn.cpp:295 static const CORBA::Long _oc_CORBA_PolicyError[] = { @@ -254,12 +254,12 @@ static CORBA::TypeCode _tc_TAO_tc_CORBA_PolicyError ( namespace CORBA { - ::CORBA::TypeCode_ptr _tc_PolicyError = + ::CORBA::TypeCode_ptr const _tc_PolicyError = &_tc_TAO_tc_CORBA_PolicyError; } // TAO_IDL - Generated from -// be\be_visitor_exception/exception_cs.cpp:63 +// be/be_visitor_exception/exception_cs.cpp:63 CORBA::InvalidPolicies::InvalidPolicies (void) : CORBA::UserException ( @@ -362,7 +362,7 @@ void CORBA::InvalidPolicies::_tao_decode ( // TAO_IDL - Generated from -// be\be_visitor_exception/exception_ctor.cpp:66 +// be/be_visitor_exception/exception_ctor.cpp:66 CORBA::InvalidPolicies::InvalidPolicies ( const CORBA::UShortSeq & _tao_indices @@ -382,7 +382,7 @@ CORBA::TypeCode_ptr CORBA::InvalidPolicies::_type (void) const } // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:295 +// be/be_visitor_typecode/typecode_defn.cpp:295 static const CORBA::Long _oc_CORBA_InvalidPolicies[] = { @@ -443,16 +443,15 @@ static CORBA::TypeCode _tc_TAO_tc_CORBA_InvalidPolicies ( namespace CORBA { - ::CORBA::TypeCode_ptr _tc_InvalidPolicies = + ::CORBA::TypeCode_ptr const _tc_InvalidPolicies = &_tc_TAO_tc_CORBA_InvalidPolicies; } // TAO_IDL - Generated from -// be\be_visitor_interface/interface_cs.cpp:60 +// be/be_visitor_interface/interface_cs.cpp:60 // Traits specializations for CORBA::Policy. -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION CORBA::Policy_ptr TAO::Objref_Traits<CORBA::Policy>::duplicate ( CORBA::Policy_ptr p @@ -461,7 +460,6 @@ TAO::Objref_Traits<CORBA::Policy>::duplicate ( return CORBA::Policy::_duplicate (p); } -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION void TAO::Objref_Traits<CORBA::Policy>::release ( CORBA::Policy_ptr p @@ -470,14 +468,12 @@ TAO::Objref_Traits<CORBA::Policy>::release ( CORBA::release (p); } -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION CORBA::Policy_ptr TAO::Objref_Traits<CORBA::Policy>::nil (void) { return CORBA::Policy::_nil (); } -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION CORBA::Boolean TAO::Objref_Traits<CORBA::Policy>::marshal ( CORBA::Policy_ptr p, @@ -494,7 +490,7 @@ TAO::Collocation_Proxy_Broker * ) = 0; // TAO_IDL - Generated from -// be\be_visitor_operation/operation_cs.cpp:78 +// be/be_visitor_operation/operation_cs.cpp:78 CORBA::PolicyType CORBA::Policy::policy_type ( ACE_ENV_SINGLE_ARG_DECL @@ -536,7 +532,7 @@ CORBA::PolicyType CORBA::Policy::policy_type ( } // TAO_IDL - Generated from -// be\be_visitor_operation/operation_cs.cpp:78 +// be/be_visitor_operation/operation_cs.cpp:78 ::CORBA::Policy_ptr CORBA::Policy::copy ( ACE_ENV_SINGLE_ARG_DECL @@ -578,7 +574,7 @@ CORBA::PolicyType CORBA::Policy::policy_type ( } // TAO_IDL - Generated from -// be\be_visitor_operation/operation_cs.cpp:78 +// be/be_visitor_operation/operation_cs.cpp:78 void CORBA::Policy::destroy ( ACE_ENV_SINGLE_ARG_DECL @@ -685,6 +681,12 @@ CORBA::Policy::_duplicate (Policy_ptr obj) return obj; } +void +CORBA::Policy::_tao_release (Policy_ptr obj) +{ + CORBA::release (obj); +} + CORBA::Boolean CORBA::Policy::_is_a ( const char *value @@ -725,11 +727,10 @@ CORBA::Policy::marshal (TAO_OutputCDR &cdr) } // TAO_IDL - Generated from -// be\be_visitor_interface/interface_cs.cpp:60 +// be/be_visitor_interface/interface_cs.cpp:60 // Traits specializations for CORBA::PolicyManager. -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION CORBA::PolicyManager_ptr TAO::Objref_Traits<CORBA::PolicyManager>::duplicate ( CORBA::PolicyManager_ptr p @@ -738,7 +739,6 @@ TAO::Objref_Traits<CORBA::PolicyManager>::duplicate ( return CORBA::PolicyManager::_duplicate (p); } -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION void TAO::Objref_Traits<CORBA::PolicyManager>::release ( CORBA::PolicyManager_ptr p @@ -747,14 +747,12 @@ TAO::Objref_Traits<CORBA::PolicyManager>::release ( CORBA::release (p); } -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION CORBA::PolicyManager_ptr TAO::Objref_Traits<CORBA::PolicyManager>::nil (void) { return CORBA::PolicyManager::_nil (); } -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION CORBA::Boolean TAO::Objref_Traits<CORBA::PolicyManager>::marshal ( CORBA::PolicyManager_ptr p, @@ -823,6 +821,12 @@ CORBA::PolicyManager::_duplicate (PolicyManager_ptr obj) return obj; } +void +CORBA::PolicyManager::_tao_release (PolicyManager_ptr obj) +{ + CORBA::release (obj); +} + CORBA::Boolean CORBA::PolicyManager::_is_a ( const char *value @@ -864,11 +868,10 @@ CORBA::PolicyManager::marshal (TAO_OutputCDR &) } // TAO_IDL - Generated from -// be\be_visitor_interface/interface_cs.cpp:60 +// be/be_visitor_interface/interface_cs.cpp:60 // Traits specializations for CORBA::PolicyCurrent. -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION CORBA::PolicyCurrent_ptr TAO::Objref_Traits<CORBA::PolicyCurrent>::duplicate ( CORBA::PolicyCurrent_ptr p @@ -877,7 +880,6 @@ TAO::Objref_Traits<CORBA::PolicyCurrent>::duplicate ( return CORBA::PolicyCurrent::_duplicate (p); } -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION void TAO::Objref_Traits<CORBA::PolicyCurrent>::release ( CORBA::PolicyCurrent_ptr p @@ -886,14 +888,12 @@ TAO::Objref_Traits<CORBA::PolicyCurrent>::release ( CORBA::release (p); } -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION CORBA::PolicyCurrent_ptr TAO::Objref_Traits<CORBA::PolicyCurrent>::nil (void) { return CORBA::PolicyCurrent::_nil (); } -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION CORBA::Boolean TAO::Objref_Traits<CORBA::PolicyCurrent>::marshal ( CORBA::PolicyCurrent_ptr p, @@ -962,6 +962,12 @@ CORBA::PolicyCurrent::_duplicate (PolicyCurrent_ptr obj) return obj; } +void +CORBA::PolicyCurrent::_tao_release (PolicyCurrent_ptr obj) +{ + CORBA::release (obj); +} + CORBA::Boolean CORBA::PolicyCurrent::_is_a ( const char *value @@ -1011,7 +1017,7 @@ CORBA::PolicyCurrent::marshal (TAO_OutputCDR &) } // TAO_IDL - Generated from -// be\be_visitor_exception/cdr_op_cs.cpp:60 +// be/be_visitor_exception/cdr_op_cs.cpp:60 CORBA::Boolean operator<< ( TAO_OutputCDR &strm, @@ -1044,7 +1050,7 @@ CORBA::Boolean operator>> ( } // TAO_IDL - Generated from -// be\be_visitor_exception/cdr_op_cs.cpp:60 +// be/be_visitor_exception/cdr_op_cs.cpp:60 CORBA::Boolean operator<< ( TAO_OutputCDR &strm, @@ -1105,7 +1111,7 @@ CORBA::Policy::_tao_scope (void) const // **************************************************************** // TAO_IDL - Generated from -// be\be_visitor_interface/cdr_op_cs.cpp:63 +// be/be_visitor_interface/cdr_op_cs.cpp:63 CORBA::Boolean operator<< ( TAO_OutputCDR &strm, @@ -1141,7 +1147,7 @@ CORBA::Boolean operator>> ( } // TAO_IDL - Generated from -// be\be_visitor_root/root.cpp:1509 +// be/be_visitor_root/root.cpp:1619 #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/tao/PolicyC.h b/TAO/tao/PolicyC.h index 967d2342105..28d3f9118d6 100644 --- a/TAO/tao/PolicyC.h +++ b/TAO/tao/PolicyC.h @@ -26,7 +26,7 @@ // http://www.cs.wustl.edu/~schmidt/TAO.html // TAO_IDL - Generated from -// be\be_codegen.cpp:153 +// be/be_codegen.cpp:153 #ifndef _TAO_IDL_ORIG_POLICYC_H_ #define _TAO_IDL_ORIG_POLICYC_H_ @@ -73,7 +73,7 @@ #endif /* __BORLANDC__ */ // TAO_IDL - Generated from -// be\be_visitor_root/root_ch.cpp:62 +// be/be_visitor_root/root_ch.cpp:62 namespace TAO { @@ -84,49 +84,49 @@ namespace TAO } // TAO_IDL - Generated from -// be\be_visitor_module/module_ch.cpp:48 +// be/be_visitor_module/module_ch.cpp:48 namespace CORBA { // TAO_IDL - Generated from - // be\be_visitor_typedef/typedef_ch.cpp:379 + // be/be_visitor_typedef/typedef_ch.cpp:379 typedef CORBA::Short PolicyErrorCode; typedef CORBA::Short_out PolicyErrorCode_out; // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 + // be/be_visitor_typecode/typecode_decl.cpp:44 - TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_PolicyErrorCode; + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr const _tc_PolicyErrorCode; // TAO_IDL - Generated from - // be\be_visitor_constant/constant_ch.cpp:52 + // be/be_visitor_constant/constant_ch.cpp:52 const CORBA::PolicyErrorCode BAD_POLICY = 0; // TAO_IDL - Generated from - // be\be_visitor_constant/constant_ch.cpp:52 + // be/be_visitor_constant/constant_ch.cpp:52 const CORBA::PolicyErrorCode UNSUPPORTED_POLICY = 1; // TAO_IDL - Generated from - // be\be_visitor_constant/constant_ch.cpp:52 + // be/be_visitor_constant/constant_ch.cpp:52 const CORBA::PolicyErrorCode BAD_POLICY_TYPE = 2; // TAO_IDL - Generated from - // be\be_visitor_constant/constant_ch.cpp:52 + // be/be_visitor_constant/constant_ch.cpp:52 const CORBA::PolicyErrorCode BAD_POLICY_VALUE = 3; // TAO_IDL - Generated from - // be\be_visitor_constant/constant_ch.cpp:52 + // be/be_visitor_constant/constant_ch.cpp:52 const CORBA::PolicyErrorCode UNSUPPORTED_POLICY_VALUE = 4; // TAO_IDL - Generated from - // be\be_visitor_exception/exception_ch.cpp:51 + // be/be_visitor_exception/exception_ch.cpp:51 #if !defined (_CORBA_POLICYERROR_CH_) #define _CORBA_POLICYERROR_CH_ @@ -164,27 +164,27 @@ namespace CORBA ); // TAO_IDL - Generated from - // be\be_visitor_exception/exception_ctor.cpp:66 + // be/be_visitor_exception/exception_ctor.cpp:66 PolicyError ( ACE_NESTED_CLASS (CORBA, PolicyErrorCode) _tao_reason ); // TAO_IDL - Generated from - // be\be_visitor_exception/exception_ch.cpp:127 + // be/be_visitor_exception/exception_ch.cpp:127 virtual CORBA::TypeCode_ptr _type (void) const; }; // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 + // be/be_visitor_typecode/typecode_decl.cpp:44 - TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_PolicyError; + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr const _tc_PolicyError; #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_visitor_exception/exception_ch.cpp:51 + // be/be_visitor_exception/exception_ch.cpp:51 #if !defined (_CORBA_INVALIDPOLICIES_CH_) #define _CORBA_INVALIDPOLICIES_CH_ @@ -222,27 +222,27 @@ namespace CORBA ); // TAO_IDL - Generated from - // be\be_visitor_exception/exception_ctor.cpp:66 + // be/be_visitor_exception/exception_ctor.cpp:66 InvalidPolicies ( const ACE_NESTED_CLASS (CORBA, UShortSeq) & _tao_indices ); // TAO_IDL - Generated from - // be\be_visitor_exception/exception_ch.cpp:127 + // be/be_visitor_exception/exception_ch.cpp:127 virtual CORBA::TypeCode_ptr _type (void) const; }; // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 + // be/be_visitor_typecode/typecode_decl.cpp:44 - TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_InvalidPolicies; + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr const _tc_InvalidPolicies; #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_interface.cpp:598 + // be/be_interface.cpp:598 #if !defined (_CORBA_POLICY__VAR_OUT_CH_) #define _CORBA_POLICY__VAR_OUT_CH_ @@ -265,7 +265,7 @@ namespace CORBA #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_visitor_interface/interface_ch.cpp:54 + // be/be_visitor_interface/interface_ch.cpp:54 #if !defined (_CORBA_POLICY_CH_) #define _CORBA_POLICY_CH_ @@ -281,6 +281,8 @@ namespace CORBA // The static operations. static Policy_ptr _duplicate (Policy_ptr obj); + static void _tao_release (Policy_ptr obj); + static Policy_ptr _narrow ( CORBA::Object_ptr obj ACE_ENV_ARG_DECL_WITH_DEFAULTS @@ -299,7 +301,7 @@ namespace CORBA static void _tao_any_destructor (void *); // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 + // be/be_visitor_operation/operation_ch.cpp:46 virtual CORBA::PolicyType policy_type ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS @@ -309,7 +311,7 @@ namespace CORBA )); // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 + // be/be_visitor_operation/operation_ch.cpp:46 virtual ::CORBA::Policy_ptr copy ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS @@ -319,7 +321,7 @@ namespace CORBA )); // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 + // be/be_visitor_operation/operation_ch.cpp:46 virtual void destroy ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS @@ -329,7 +331,7 @@ namespace CORBA )); // TAO_IDL - Generated from - // be\be_visitor_interface/interface_ch.cpp:208 + // be/be_visitor_interface/interface_ch.cpp:210 virtual CORBA::Boolean _is_a ( const char *type_id @@ -384,12 +386,12 @@ namespace CORBA #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 + // be/be_visitor_typecode/typecode_decl.cpp:44 - TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_Policy; + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr const _tc_Policy; // TAO_IDL - Generated from - // be\be_interface.cpp:598 + // be/be_interface.cpp:598 #if !defined (_CORBA_POLICYMANAGER__VAR_OUT_CH_) #define _CORBA_POLICYMANAGER__VAR_OUT_CH_ @@ -412,7 +414,7 @@ namespace CORBA #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_visitor_interface/interface_ch.cpp:54 + // be/be_visitor_interface/interface_ch.cpp:54 #if !defined (_CORBA_POLICYMANAGER_CH_) #define _CORBA_POLICYMANAGER_CH_ @@ -427,6 +429,8 @@ namespace CORBA // The static operations. static PolicyManager_ptr _duplicate (PolicyManager_ptr obj); + static void _tao_release (PolicyManager_ptr obj); + static PolicyManager_ptr _narrow ( CORBA::Object_ptr obj ACE_ENV_ARG_DECL_WITH_DEFAULTS @@ -445,7 +449,7 @@ namespace CORBA static void _tao_any_destructor (void *); // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 + // be/be_visitor_operation/operation_ch.cpp:46 virtual ::CORBA::PolicyList * get_policy_overrides ( const ::CORBA::PolicyTypeSeq & ts @@ -456,7 +460,7 @@ namespace CORBA )) = 0; // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 + // be/be_visitor_operation/operation_ch.cpp:46 virtual void set_policy_overrides ( const ::CORBA::PolicyList & policies, @@ -469,7 +473,7 @@ namespace CORBA )) = 0; // TAO_IDL - Generated from - // be\be_visitor_interface/interface_ch.cpp:208 + // be/be_visitor_interface/interface_ch.cpp:210 virtual CORBA::Boolean _is_a ( const char *type_id @@ -495,12 +499,12 @@ namespace CORBA #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 + // be/be_visitor_typecode/typecode_decl.cpp:44 - TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_PolicyManager; + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr const _tc_PolicyManager; // TAO_IDL - Generated from - // be\be_interface.cpp:598 + // be/be_interface.cpp:598 #if !defined (_CORBA_POLICYCURRENT__VAR_OUT_CH_) #define _CORBA_POLICYCURRENT__VAR_OUT_CH_ @@ -523,7 +527,7 @@ namespace CORBA #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_visitor_interface/interface_ch.cpp:54 + // be/be_visitor_interface/interface_ch.cpp:54 #if !defined (_CORBA_POLICYCURRENT_CH_) #define _CORBA_POLICYCURRENT_CH_ @@ -539,6 +543,8 @@ namespace CORBA // The static operations. static PolicyCurrent_ptr _duplicate (PolicyCurrent_ptr obj); + static void _tao_release (PolicyCurrent_ptr obj); + static PolicyCurrent_ptr _narrow ( CORBA::Object_ptr obj ACE_ENV_ARG_DECL_WITH_DEFAULTS @@ -557,7 +563,7 @@ namespace CORBA static void _tao_any_destructor (void *); // TAO_IDL - Generated from - // be\be_visitor_interface/interface_ch.cpp:208 + // be/be_visitor_interface/interface_ch.cpp:210 virtual CORBA::Boolean _is_a ( const char *type_id @@ -583,19 +589,19 @@ namespace CORBA #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 + // be/be_visitor_typecode/typecode_decl.cpp:44 - TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_PolicyCurrent; + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr const _tc_PolicyCurrent; // TAO_IDL - Generated from -// be\be_visitor_module/module_ch.cpp:66 +// be/be_visitor_module/module_ch.cpp:66 } // module CORBA // Proxy Broker Factory function pointer declarations. // TAO_IDL - Generated from -// be\be_visitor_root/root.cpp:120 +// be/be_visitor_root/root.cpp:230 extern TAO_Export TAO::Collocation_Proxy_Broker * @@ -604,7 +610,7 @@ TAO::Collocation_Proxy_Broker * ); // TAO_IDL - Generated from -// be\be_visitor_traits.cpp:59 +// be/be_visitor_traits.cpp:59 // Traits specializations. namespace TAO @@ -613,7 +619,7 @@ namespace TAO #if !defined (_CORBA_POLICY__TRAITS_CH_) #define _CORBA_POLICY__TRAITS_CH_ - ACE_TEMPLATE_SPECIALIZATION + template<> struct TAO_Export Objref_Traits< ::CORBA::Policy> { static ::CORBA::Policy_ptr duplicate ( @@ -634,7 +640,7 @@ namespace TAO #if !defined (_CORBA_POLICYCURRENT__TRAITS_CH_) #define _CORBA_POLICYCURRENT__TRAITS_CH_ - ACE_TEMPLATE_SPECIALIZATION + template<> struct TAO_Export Objref_Traits< ::CORBA::PolicyCurrent> { static ::CORBA::PolicyCurrent_ptr duplicate ( @@ -655,7 +661,7 @@ namespace TAO #if !defined (_CORBA_POLICYMANAGER__TRAITS_CH_) #define _CORBA_POLICYMANAGER__TRAITS_CH_ - ACE_TEMPLATE_SPECIALIZATION + template<> struct TAO_Export Objref_Traits< ::CORBA::PolicyManager> { static ::CORBA::PolicyManager_ptr duplicate ( @@ -675,7 +681,7 @@ namespace TAO } // TAO_IDL - Generated from -// be\be_visitor_exception/any_op_ch.cpp:52 +// be/be_visitor_exception/any_op_ch.cpp:52 TAO_Export void operator<<= (CORBA::Any &, const CORBA::PolicyError &); // copying version TAO_Export void operator<<= (CORBA::Any &, CORBA::PolicyError*); // noncopying version @@ -683,7 +689,7 @@ TAO_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::PolicyError *& TAO_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::PolicyError *&); // TAO_IDL - Generated from -// be\be_visitor_exception/any_op_ch.cpp:52 +// be/be_visitor_exception/any_op_ch.cpp:52 TAO_Export void operator<<= (CORBA::Any &, const CORBA::InvalidPolicies &); // copying version TAO_Export void operator<<= (CORBA::Any &, CORBA::InvalidPolicies*); // noncopying version @@ -691,46 +697,46 @@ TAO_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::InvalidPolicie TAO_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::InvalidPolicies *&); // TAO_IDL - Generated from -// be\be_visitor_interface/any_op_ch.cpp:52 +// be/be_visitor_interface/any_op_ch.cpp:52 TAO_Export void operator<<= (CORBA::Any &, CORBA::Policy_ptr); // copying TAO_Export void operator<<= (CORBA::Any &, CORBA::Policy_ptr *); // non-copying TAO_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::Policy_ptr &); // TAO_IDL - Generated from -// be\be_visitor_interface/any_op_ch.cpp:52 +// be/be_visitor_interface/any_op_ch.cpp:52 TAO_Export void operator<<= (CORBA::Any &, CORBA::PolicyManager_ptr); // copying TAO_Export void operator<<= (CORBA::Any &, CORBA::PolicyManager_ptr *); // non-copying TAO_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::PolicyManager_ptr &); // TAO_IDL - Generated from -// be\be_visitor_interface/any_op_ch.cpp:52 +// be/be_visitor_interface/any_op_ch.cpp:52 TAO_Export void operator<<= (CORBA::Any &, CORBA::PolicyCurrent_ptr); // copying TAO_Export void operator<<= (CORBA::Any &, CORBA::PolicyCurrent_ptr *); // non-copying TAO_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::PolicyCurrent_ptr &); // TAO_IDL - Generated from -// be\be_visitor_exception/cdr_op_ch.cpp:52 +// be/be_visitor_exception/cdr_op_ch.cpp:52 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const CORBA::PolicyError &); TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &, CORBA::PolicyError &); // TAO_IDL - Generated from -// be\be_visitor_exception/cdr_op_ch.cpp:52 +// be/be_visitor_exception/cdr_op_ch.cpp:52 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const CORBA::InvalidPolicies &); TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &, CORBA::InvalidPolicies &); // TAO_IDL - Generated from -// be\be_visitor_interface/cdr_op_ch.cpp:55 +// be/be_visitor_interface/cdr_op_ch.cpp:55 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const CORBA::Policy_ptr ); TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &, CORBA::Policy_ptr &); // TAO_IDL - Generated from -// be\be_codegen.cpp:961 +// be/be_codegen.cpp:961 #if defined (__ACE_INLINE__) #include "PolicyC.inl" diff --git a/TAO/tao/PolicyC.inl b/TAO/tao/PolicyC.inl index 2bc9b36e2dc..d250cfb9634 100644 --- a/TAO/tao/PolicyC.inl +++ b/TAO/tao/PolicyC.inl @@ -27,7 +27,7 @@ // TAO_IDL - Generated from -// be\be_visitor_interface/interface_ci.cpp:70 +// be/be_visitor_interface/interface_ci.cpp:70 #if !defined (_CORBA_POLICY___CI_) #define _CORBA_POLICY___CI_ diff --git a/TAO/tao/PortableServer/Any_SArg_Traits.h b/TAO/tao/PortableServer/Any_SArg_Traits.h new file mode 100644 index 00000000000..393bb958210 --- /dev/null +++ b/TAO/tao/PortableServer/Any_SArg_Traits.h @@ -0,0 +1,50 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file Any_Arg_Traits.h + * + * $Id$ + * + * @author Jeff Parsons + * @author Ossama Othman + */ +//============================================================================= + + +#ifndef TAO_ANY_SARG_TRAITS_H +#define TAO_ANY_SARG_TRAITS_H + +#include /**/ "ace/pre.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PortableServer/Var_Size_SArgument_T.h" +#include "tao/PortableServer/portableserver_export.h" + +namespace CORBA +{ + class Any; + class Any_var; + class Any_out; +} + +namespace TAO +{ + template<> + class TAO_PortableServer_Export SArg_Traits<CORBA::Any> + : public + Var_Size_SArg_Traits_T< + CORBA::Any, + CORBA::Any_var, + CORBA::Any_out + > + { + }; +} + +#include /**/ "ace/post.h" + +#endif /* TAO_ANY_ARG_TRAITS_H */ diff --git a/TAO/tao/BD_String_SArgument_T.cpp b/TAO/tao/PortableServer/BD_String_SArgument_T.cpp index d428442272a..37ae58694da 100644 --- a/TAO/tao/BD_String_SArgument_T.cpp +++ b/TAO/tao/PortableServer/BD_String_SArgument_T.cpp @@ -1,23 +1,20 @@ // $Id$ -#ifndef TAO_BD_STRING_SARGUMENT_T_C -#define TAO_BD_STRING_SARGUMENT_T_C +#ifndef TAO_BD_STRING_SARGUMENT_T_CPP +#define TAO_BD_STRING_SARGUMENT_T_CPP -#include "tao/BD_String_SArgument_T.h" +#include "tao/PortableServer/BD_String_SArgument_T.h" #include "tao/Dynamic_ParameterC.h" #if !defined (__ACE_INLINE__) #include "tao/BD_String_SArgument_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID (tao, - BD_String_SArgument_T, - "$Id$") -template<typename S, - typename S_var, - typename to_S, - typename from_S, +template<typename S, + typename S_var, + typename to_S, + typename from_S, size_t BOUND> CORBA::Boolean TAO::In_BD_String_SArgument_T<S,S_var,to_S,from_S,BOUND>::demarshal ( @@ -29,10 +26,10 @@ TAO::In_BD_String_SArgument_T<S,S_var,to_S,from_S,BOUND>::demarshal ( #if TAO_HAS_INTERCEPTORS == 1 -template<typename S, - typename S_var, - typename to_S, - typename from_S, +template<typename S, + typename S_var, + typename to_S, + typename from_S, size_t BOUND> void TAO::In_BD_String_SArgument_T<S,S_var,to_S,from_S,BOUND>::interceptor_param ( @@ -47,10 +44,10 @@ TAO::In_BD_String_SArgument_T<S,S_var,to_S,from_S,BOUND>::interceptor_param ( // =========================================================== -template<typename S, - typename S_var, - typename to_S, - typename from_S, +template<typename S, + typename S_var, + typename to_S, + typename from_S, size_t BOUND> CORBA::Boolean TAO::Inout_BD_String_SArgument_T<S,S_var,to_S,from_S,BOUND>::marshal ( @@ -60,10 +57,10 @@ TAO::Inout_BD_String_SArgument_T<S,S_var,to_S,from_S,BOUND>::marshal ( return cdr << from_S (this->x_.in (), BOUND); } -template<typename S, - typename S_var, - typename to_S, - typename from_S, +template<typename S, + typename S_var, + typename to_S, + typename from_S, size_t BOUND> CORBA::Boolean TAO::Inout_BD_String_SArgument_T<S,S_var,to_S,from_S,BOUND>::demarshal ( @@ -75,10 +72,10 @@ TAO::Inout_BD_String_SArgument_T<S,S_var,to_S,from_S,BOUND>::demarshal ( #if TAO_HAS_INTERCEPTORS == 1 -template<typename S, - typename S_var, - typename to_S, - typename from_S, +template<typename S, + typename S_var, + typename to_S, + typename from_S, size_t BOUND> void TAO::Inout_BD_String_SArgument_T<S,S_var,to_S,from_S,BOUND>:: @@ -92,11 +89,11 @@ interceptor_param (Dynamic::Parameter & p) // ============================================================== -template<typename S, +template<typename S, typename S_var, typename S_out, - typename to_S, - typename from_S, + typename to_S, + typename from_S, size_t BOUND> CORBA::Boolean TAO::Out_BD_String_SArgument_T<S,S_var,S_out,to_S,from_S,BOUND>::marshal ( @@ -108,11 +105,11 @@ TAO::Out_BD_String_SArgument_T<S,S_var,S_out,to_S,from_S,BOUND>::marshal ( #if TAO_HAS_INTERCEPTORS == 1 -template<typename S, - typename S_var, +template<typename S, + typename S_var, typename S_out, - typename to_S, - typename from_S, + typename to_S, + typename from_S, size_t BOUND> void TAO::Out_BD_String_SArgument_T<S,S_var,S_out,to_S,from_S,BOUND>:: @@ -126,10 +123,10 @@ interceptor_param (Dynamic::Parameter & p) // ============================================================ -template<typename S, - typename S_var, - typename to_S, - typename from_S, +template<typename S, + typename S_var, + typename to_S, + typename from_S, size_t BOUND> CORBA::Boolean TAO::Ret_BD_String_SArgument_T<S,S_var,to_S,from_S,BOUND>::marshal ( @@ -141,10 +138,10 @@ TAO::Ret_BD_String_SArgument_T<S,S_var,to_S,from_S,BOUND>::marshal ( #if TAO_HAS_INTERCEPTORS == 1 -template<typename S, - typename S_var, - typename to_S, - typename from_S, +template<typename S, + typename S_var, + typename to_S, + typename from_S, size_t BOUND> void TAO::Ret_BD_String_SArgument_T<S,S_var,to_S,from_S,BOUND>:: @@ -155,4 +152,4 @@ interceptor_result (CORBA::Any * any) #endif /* TAO_HAS_INTERCEPTORS */ -#endif /* TAO_BD_STRING_SARGUMENT_T_C */ +#endif /* TAO_BD_STRING_SARGUMENT_T_CPP */ diff --git a/TAO/tao/BD_String_SArgument_T.h b/TAO/tao/PortableServer/BD_String_SArgument_T.h index 829fd3dc548..0b165c2cdd5 100644 --- a/TAO/tao/BD_String_SArgument_T.h +++ b/TAO/tao/PortableServer/BD_String_SArgument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -6,7 +6,7 @@ * * $Id$ * - * @authors Jeff Parsons and Carlos O'Ryan + * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman */ //============================================================================= @@ -15,6 +15,7 @@ #define TAO_BD_STRING_SARGUMENT_T_H #include /**/ "ace/pre.h" + #include "ace/CDR_Stream.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -154,7 +155,7 @@ namespace TAO T_var, to_T, from_T, - BOUND> in_sarg_val; + BOUND> in_arg_val; typedef Inout_BD_String_SArgument_T<T, T_var, to_T, @@ -171,6 +172,14 @@ namespace TAO to_T, from_T, BOUND> ret_val; + + // Typedefs corresponding to return value of arg() method in both + // the client and server side argument class templates. + typedef in_type in_arg_type; + typedef inout_type inout_arg_type; + typedef inout_type out_arg_type; + typedef inout_type ret_arg_type; + }; /** @@ -180,7 +189,7 @@ namespace TAO */ template<size_t BOUND> - class BD_StringS_Arg_Traits + class BD_String_SArg_Traits : public BD_String_SArg_Traits_T<CORBA::Char, CORBA::String_var, CORBA::String_out, @@ -203,11 +212,11 @@ namespace TAO }; #if defined (__ACE_INLINE__) -#include "tao/BD_String_SArgument_T.inl" +#include "tao/PortableServer/BD_String_SArgument_T.inl" #endif /* __ACE_INLINE__ */ #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/BD_String_SArgument_T.cpp" +#include "tao/PortableServer/BD_String_SArgument_T.cpp" #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) diff --git a/TAO/tao/BD_String_SArgument_T.inl b/TAO/tao/PortableServer/BD_String_SArgument_T.inl index f8a76b8938f..f8a76b8938f 100644 --- a/TAO/tao/BD_String_SArgument_T.inl +++ b/TAO/tao/PortableServer/BD_String_SArgument_T.inl diff --git a/TAO/tao/Basic_SArgument_T.cpp b/TAO/tao/PortableServer/Basic_SArgument_T.cpp index 2bfd618f9a6..79301cfb9aa 100644 --- a/TAO/tao/Basic_SArgument_T.cpp +++ b/TAO/tao/PortableServer/Basic_SArgument_T.cpp @@ -1,18 +1,15 @@ // $Id$ -#ifndef TAO_BASIC_SARGUMENT_T_C -#define TAO_BASIC_SARGUMENT_T_C +#ifndef TAO_BASIC_SARGUMENT_T_CPP +#define TAO_BASIC_SARGUMENT_T_CPP -#include "tao/Basic_SArgument_T.h" +#include "tao/PortableServer/Basic_SArgument_T.h" #include "tao/Dynamic_ParameterC.h" #if !defined (__ACE_INLINE__) -#include "tao/Basic_SArgument_T.inl" +#include "tao/PortableServer/Basic_SArgument_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID (tao, - Basic_SArgument_T, - "$Id$") template<typename S> CORBA::Boolean @@ -102,4 +99,4 @@ TAO::Ret_Basic_SArgument_T<S>::interceptor_result (CORBA::Any * any) #endif /* TAO_HAS_INTERCEPTORS */ -#endif /* TAO_BASIC_SARGUMENT_T_C */ +#endif /* TAO_BASIC_SARGUMENT_T_CPP */ diff --git a/TAO/tao/Basic_SArgument_T.h b/TAO/tao/PortableServer/Basic_SArgument_T.h index f4eaf282bf0..7a5b9ac870e 100644 --- a/TAO/tao/Basic_SArgument_T.h +++ b/TAO/tao/PortableServer/Basic_SArgument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -6,7 +6,7 @@ * * $Id$ * - * @authors Jeff Parsons and Carlos O'Ryan + * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman */ //============================================================================= @@ -131,15 +131,23 @@ namespace TAO typedef Inout_Basic_SArgument_T<T> inout_arg_val; typedef Out_Basic_SArgument_T<T> out_arg_val; typedef Ret_Basic_SArgument_T<T> ret_val; + + // Typedefs corresponding to return value of arg() method in both + // the client and server side argument class templates. + typedef in_type in_arg_type; + typedef inout_type inout_arg_type; + typedef out_type out_arg_type; + typedef out_type ret_arg_type; + }; }; #if defined (__ACE_INLINE__) -#include "tao/Basic_SArgument_T.inl" +#include "tao/PortableServer/Basic_SArgument_T.inl" #endif /* __ACE_INLINE__ */ #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/Basic_SArgument_T.cpp" +#include "tao/PortableServer/Basic_SArgument_T.cpp" #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) diff --git a/TAO/tao/Basic_SArgument_T.inl b/TAO/tao/PortableServer/Basic_SArgument_T.inl index 0958abeed27..2bbaba955ab 100644 --- a/TAO/tao/Basic_SArgument_T.inl +++ b/TAO/tao/PortableServer/Basic_SArgument_T.inl @@ -1,3 +1,5 @@ +// -*- C++ -*- +// // $Id$ template<typename S> diff --git a/TAO/tao/Basic_SArguments.cpp b/TAO/tao/PortableServer/Basic_SArguments.cpp index c4a1b17ff71..75c2e33d850 100644 --- a/TAO/tao/Basic_SArguments.cpp +++ b/TAO/tao/PortableServer/Basic_SArguments.cpp @@ -1,8 +1,8 @@ // $Id$ -#include "tao/Basic_SArguments.h" +#include "Basic_SArguments.h" -ACE_RCSID (tao, +ACE_RCSID (PortableServer, Basic_SArguments, "$Id$") diff --git a/TAO/tao/Basic_SArguments.h b/TAO/tao/PortableServer/Basic_SArguments.h index 44e06b5885c..a61a5dc68b6 100644 --- a/TAO/tao/Basic_SArguments.h +++ b/TAO/tao/PortableServer/Basic_SArguments.h @@ -1,3 +1,6 @@ +// -*- C++ -*- + +//============================================================================= /** * @file Basic_SArguments.h * @@ -13,14 +16,16 @@ #include /**/ "ace/pre.h" -#include "tao/Basic_SArgument_T.h" +#include "tao/PortableServer/portableserver_export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/PortableServer/Basic_SArgument_T.h" #include "tao/Arg_Traits_T.h" + namespace TAO { /** @@ -29,12 +34,13 @@ namespace TAO * */ template<> - class TAO_Export SArg_Traits<void> + class TAO_PortableServer_Export SArg_Traits<void> { - public: - typedef void ret_type; + public: + typedef void ret_type; typedef Argument ret_val; + }; /** @@ -45,59 +51,60 @@ namespace TAO */ template<> - class TAO_Export SArg_Traits<CORBA::Short> + class TAO_PortableServer_Export SArg_Traits<CORBA::Short> : public Basic_SArg_Traits_T<CORBA::Short> { }; template<> - class TAO_Export SArg_Traits<CORBA::Long> + class TAO_PortableServer_Export SArg_Traits<CORBA::Long> : public Basic_SArg_Traits_T<CORBA::Long> { }; template<> - class TAO_Export SArg_Traits<CORBA::UShort> + class TAO_PortableServer_Export SArg_Traits<CORBA::UShort> : public Basic_SArg_Traits_T<CORBA::UShort> { }; template<> - class TAO_Export SArg_Traits<CORBA::ULong> + class TAO_PortableServer_Export SArg_Traits<CORBA::ULong> : public Basic_SArg_Traits_T<CORBA::ULong> { }; template<> - class TAO_Export SArg_Traits<CORBA::Float> + class TAO_PortableServer_Export SArg_Traits<CORBA::Float> : public Basic_SArg_Traits_T<CORBA::Float> { }; template<> - class TAO_Export SArg_Traits<CORBA::Double> + class TAO_PortableServer_Export SArg_Traits<CORBA::Double> : public Basic_SArg_Traits_T<CORBA::Double> { }; template<> - class TAO_Export SArg_Traits<CORBA::LongLong> + class TAO_PortableServer_Export SArg_Traits<CORBA::LongLong> : public Basic_SArg_Traits_T<CORBA::LongLong> { }; template<> - class TAO_Export SArg_Traits<CORBA::ULongLong> + class TAO_PortableServer_Export SArg_Traits<CORBA::ULongLong> : public Basic_SArg_Traits_T<CORBA::ULongLong> { }; template<> - class TAO_Export SArg_Traits<CORBA::LongDouble> + class TAO_PortableServer_Export SArg_Traits<CORBA::LongDouble> : public Basic_SArg_Traits_T<CORBA::LongDouble> { }; -}; + +} #include /**/ "ace/post.h" diff --git a/TAO/tao/PortableServer/Fixed_Array_SArgument_T.cpp b/TAO/tao/PortableServer/Fixed_Array_SArgument_T.cpp new file mode 100644 index 00000000000..424e0a8f5b4 --- /dev/null +++ b/TAO/tao/PortableServer/Fixed_Array_SArgument_T.cpp @@ -0,0 +1,127 @@ +// $Id$ + +#ifndef TAO_FIXED_ARRAY_SARGUMENT_T_CPP +#define TAO_FIXED_ARRAY_SARGUMENT_T_CPP + +#include "tao/PortableServer/Fixed_Array_SArgument_T.h" +#include "tao/Dynamic_ParameterC.h" + +#if !defined (__ACE_INLINE__) +#include "tao/PortableServer/Fixed_Array_SArgument_T.inl" +#endif /* __ACE_INLINE__ */ + + +template<typename S, typename S_slice, typename S_forany> +CORBA::Boolean +TAO::In_Fixed_Array_SArgument_T<S, + S_slice, + S_forany>::demarshal (TAO_InputCDR &cdr) +{ + S_forany tmp (this->x_); + return cdr >> tmp; +} + +#if TAO_HAS_INTERCEPTORS == 1 + +template<typename S, typename S_slice, typename S_forany> +void +TAO::In_Fixed_Array_SArgument_T<S, + S_slice, + S_forany>::interceptor_param ( + Dynamic::Parameter & p + ) +{ + p.argument <<= S_forany (this->x_); + p.mode = CORBA::PARAM_IN; +} + +#endif /* TAO_HAS_INTERCEPTORS */ + +// =========================================================== + +template<typename S, typename S_slice, typename S_forany> +CORBA::Boolean +TAO::Inout_Fixed_Array_SArgument_T<S, + S_slice, + S_forany>::marshal (TAO_OutputCDR & cdr) +{ + return cdr << S_forany (this->x_); +} + +template<typename S, typename S_slice, typename S_forany> +CORBA::Boolean +TAO::Inout_Fixed_Array_SArgument_T<S, + S_slice, + S_forany>::demarshal (TAO_InputCDR & cdr) +{ + S_forany tmp (this->x_); + return cdr >> tmp; +} + +#if TAO_HAS_INTERCEPTORS == 1 + +template<typename S, typename S_slice, typename S_forany> +void +TAO::Inout_Fixed_Array_SArgument_T<S, + S_slice, + S_forany>::interceptor_param ( + Dynamic::Parameter & p + ) +{ + p.argument <<= S_forany (this->x_); + p.mode = CORBA::PARAM_INOUT; +} + +#endif /* TAO_HAS_INTERCEPTORS */ + +// ============================================================== + +template<typename S, typename S_slice, typename S_forany> +CORBA::Boolean +TAO::Out_Fixed_Array_SArgument_T<S, + S_slice, + S_forany>::marshal (TAO_OutputCDR &cdr) +{ + return cdr << S_forany (this->x_); +} + +#if TAO_HAS_INTERCEPTORS == 1 + +template<typename S, typename S_slice, typename S_forany> +void +TAO::Out_Fixed_Array_SArgument_T<S, + S_slice, + S_forany>::interceptor_param ( + Dynamic::Parameter & p) +{ + p.argument <<= S_forany (this->x_); + p.mode = CORBA::PARAM_OUT; +} + +#endif /* TAO_HAS_INTERCEPTORS */ + +// ============================================================ + +template<typename S_slice, typename S_var, typename S_forany> +CORBA::Boolean +TAO::Ret_Fixed_Array_SArgument_T<S_slice,S_var,S_forany>::marshal ( + TAO_OutputCDR & cdr + ) +{ + return cdr << S_forany (this->x_.inout ()); +} + +#if TAO_HAS_INTERCEPTORS == 1 + +template<typename S_slice, typename S_var, typename S_forany> +void +TAO::Ret_Fixed_Array_SArgument_T<S_slice,S_var,S_forany>::interceptor_result ( + CORBA::Any * any + ) +{ + (*any) <<= S_forany (this->x_.ptr ()); +} + +#endif /* TAO_HAS_INTERCEPTORS */ + +#endif /* TAO_FIXED_ARRAY_SARGUMENT_T_CPP */ diff --git a/TAO/tao/Fixed_Array_SArgument_T.h b/TAO/tao/PortableServer/Fixed_Array_SArgument_T.h index 6e6fb9a52f7..246b827ff10 100644 --- a/TAO/tao/Fixed_Array_SArgument_T.h +++ b/TAO/tao/PortableServer/Fixed_Array_SArgument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -6,7 +6,7 @@ * * $Id$ * - * @authors Jeff Parsons and Carlos O'Ryan + * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman */ //============================================================================= @@ -15,6 +15,7 @@ #define TAO_FIXED_ARRAY_SARGUMENT_T_H #include /**/ "ace/pre.h" + #include "tao/Argument.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -29,7 +30,7 @@ namespace TAO * @brief IN skeleton argument of fixed size element array. * */ - template<typename S, typename S_forany> + template<typename S, typename S_slice, typename S_forany> class In_Fixed_Array_SArgument_T : public Argument { public: @@ -39,10 +40,10 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - const S & arg (void) const; + S_slice const * arg (void) const; private: - S x_; + S_forany x_; }; /** @@ -51,7 +52,7 @@ namespace TAO * @brief INOUT skeleton argument of fixed size element array. * */ - template<typename S, typename S_forany> + template<typename S, typename S_slice, typename S_forany> class Inout_Fixed_Array_SArgument_T : public Argument { public: @@ -62,10 +63,10 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - S & arg (void); + S_slice * arg (void); private: - S x_; + S_forany x_; }; /** @@ -74,7 +75,7 @@ namespace TAO * @brief OUT skeleton argument of fixed size element array. * */ - template<typename S, typename S_forany> + template<typename S, typename S_slice, typename S_forany> class Out_Fixed_Array_SArgument_T : public Argument { public: @@ -84,10 +85,10 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - S & arg (void); + S_slice *& arg (void); private: - S x_; + S_forany x_; }; /** @@ -129,21 +130,35 @@ namespace TAO typedef T inout_type; typedef T out_type; - typedef In_Fixed_Array_SArgument_T<T,T_forany> in_arg_val; - typedef Inout_Fixed_Array_SArgument_T<T,T_forany> inout_arg_val; - typedef Out_Fixed_Array_SArgument_T<T,T_forany> out_arg_val; + typedef In_Fixed_Array_SArgument_T<T, + T_slice, + T_forany> in_arg_val; + typedef Inout_Fixed_Array_SArgument_T<T, + T_slice, + T_forany> inout_arg_val; + typedef Out_Fixed_Array_SArgument_T<T, + T_slice, + T_forany> out_arg_val; typedef Ret_Fixed_Array_SArgument_T<T_slice, T_var, T_forany> ret_val; + + // Typedefs corresponding to return value of arg() method in both + // the client and server side argument class templates. + typedef T_slice const * in_arg_type; + typedef ret_type inout_arg_type; + typedef ret_type & out_arg_type; + typedef ret_type & ret_arg_type; + }; }; #if defined (__ACE_INLINE__) -#include "tao/Fixed_Array_SArgument_T.inl" +#include "tao/PortableServer/Fixed_Array_SArgument_T.inl" #endif /* __ACE_INLINE__ */ #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/Fixed_Array_SArgument_T.cpp" +#include "tao/PortableServer/Fixed_Array_SArgument_T.cpp" #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) diff --git a/TAO/tao/PortableServer/Fixed_Array_SArgument_T.inl b/TAO/tao/PortableServer/Fixed_Array_SArgument_T.inl new file mode 100644 index 00000000000..95349e884b7 --- /dev/null +++ b/TAO/tao/PortableServer/Fixed_Array_SArgument_T.inl @@ -0,0 +1,73 @@ +// -*- C++ -*- +// +// $Id$ + +template<typename S, typename S_slice, typename S_forany> +ACE_INLINE +TAO::In_Fixed_Array_SArgument_T<S, + S_slice, + S_forany>::In_Fixed_Array_SArgument_T (void) +{} + +template<typename S, typename S_slice, typename S_forany> +ACE_INLINE +S_slice const * +TAO::In_Fixed_Array_SArgument_T<S, S_slice, S_forany>::arg (void) const +{ + return this->x_.in (); +} + +// =========================================================================== + +template<typename S, typename S_slice, typename S_forany> +ACE_INLINE +TAO::Inout_Fixed_Array_SArgument_T<S, + S_slice, + S_forany>:: +Inout_Fixed_Array_SArgument_T (void) +{} + +template<typename S, typename S_slice, typename S_forany> +ACE_INLINE +S_slice * +TAO::Inout_Fixed_Array_SArgument_T<S, + S_slice, + S_forany>::arg (void) +{ + return this->x_.inout (); +} + +// =========================================================================== + +template<typename S, typename S_slice, typename S_forany> +ACE_INLINE +TAO::Out_Fixed_Array_SArgument_T<S, + S_slice, + S_forany>::Out_Fixed_Array_SArgument_T (void) +{} + +template<typename S, typename S_slice, typename S_forany> +ACE_INLINE +S_slice *& +TAO::Out_Fixed_Array_SArgument_T<S, + S_slice, + S_forany>::arg (void) +{ + return this->x_.out (); +} + +// =========================================================================== + +template<typename S_slice, typename S_var, typename S_forany> +ACE_INLINE +TAO::Ret_Fixed_Array_SArgument_T<S_slice,S_var,S_forany>:: +Ret_Fixed_Array_SArgument_T (void) +{} + +template<typename S_slice, typename S_var, typename S_forany> +ACE_INLINE +S_slice *& +TAO::Ret_Fixed_Array_SArgument_T<S_slice,S_var,S_forany>::arg (void) +{ + return this->x_.out (); +} diff --git a/TAO/tao/Fixed_Size_SArgument_T.cpp b/TAO/tao/PortableServer/Fixed_Size_SArgument_T.cpp index 28408a12af2..de4c433f7b2 100644 --- a/TAO/tao/Fixed_Size_SArgument_T.cpp +++ b/TAO/tao/PortableServer/Fixed_Size_SArgument_T.cpp @@ -1,22 +1,22 @@ // $Id$ -#ifndef TAO_FIXED_SIZE_SARGUMENT_T_C -#define TAO_FIXED_SIZE_SARGUMENT_T_C +#ifndef TAO_FIXED_SIZE_SARGUMENT_T_CPP +#define TAO_FIXED_SIZE_SARGUMENT_T_CPP -#include "tao/Fixed_Size_SArgument_T.h" -#include "tao/Dynamic_ParameterC.h" +#include "tao/PortableServer/Fixed_Size_SArgument_T.h" + +#if TAO_HAS_INTERCEPTORS == 1 +# include "tao/Dynamic_ParameterC.h" +#endif /* TAO_HAS_INTERCEPTORS == 1 */ #if !defined (__ACE_INLINE__) -#include "tao/Fixed_Size_SArgument_T.inl" +#include "tao/PortableServer/Fixed_Size_SArgument_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID (tao, - Fixed_Size_SArgument_T, - "$Id$") template<typename S> CORBA::Boolean -TAO::In_Fixed_Size_SArgument_T<S>::demarshal (TAO_InputCDR &cdr) +TAO::In_Fixed_Size_SArgument_T<S>::demarshal (TAO_InputCDR & cdr) { return cdr >> *this->x_; } @@ -78,7 +78,7 @@ template<typename S> void TAO::Out_Fixed_Size_SArgument_T<S>::interceptor_param (Dynamic::Parameter & p) { - p.argument <<= *this->x_; + p.argument <<= this->x_; p.mode = CORBA::PARAM_OUT; } diff --git a/TAO/tao/Fixed_Size_SArgument_T.h b/TAO/tao/PortableServer/Fixed_Size_SArgument_T.h index 4ba6e2f0bfa..df2699dd2bc 100644 --- a/TAO/tao/Fixed_Size_SArgument_T.h +++ b/TAO/tao/PortableServer/Fixed_Size_SArgument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -6,7 +6,9 @@ * * $Id$ * - * @authors Jeff Parsons and Carlos O'Ryan + * @author Jeff Parsons + * @author Carlos O'Ryan + * @author Ossama Othman */ //============================================================================= @@ -15,6 +17,7 @@ #define TAO_FIXED_SIZE_SARGUMENT_T_H #include /**/ "ace/pre.h" + #include "tao/Argument.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -26,25 +29,45 @@ namespace TAO /** * @class In_Fixed_Size_SArgument_T * - * @brief Template class for IN skeleton argument of fixed size IDL types. + * @brief Skeleton class template for operation "IN" arguments of + * fixed size IDL types. * + * Skeleton class template for operation "IN" arguments of fixed + * size IDL types. */ template<typename S> class In_Fixed_Size_SArgument_T : public Argument { public: - In_Fixed_Size_SArgument_T (void); - virtual CORBA::Boolean demarshal (TAO_InputCDR &); + /** + * @name @c TAO::Argument Method Overrides + * + * @c TAO::Argument method overrides specific to the type of + * operation argument represented by this class. + * + * @see @c TAO::Argument. + */ + //@{ + virtual CORBA::Boolean demarshal (TAO_InputCDR & cdr); + #if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_param (Dynamic::Parameter &); + virtual void interceptor_param (Dynamic::Parameter & p); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - const S & arg (void) const; + //@} + + /// Retrieve underlying argument. + S const & arg (void) const; private: + + /// Reference to the "IN" argument. S * x_; + }; + // ------------------------------------------------------------ + /** * @class Inout_Fixed_Size_SArgument_T * @@ -55,19 +78,35 @@ namespace TAO class Inout_Fixed_Size_SArgument_T : public Argument { public: + + /// Constructor. Inout_Fixed_Size_SArgument_T (void); + /** + * @name @c TAO::Argument Method Overrides + * + * @c TAO::Argument method overrides specific to the type of + * operation argument represented by this class. + * + * @see @c TAO::Argument. + */ + //@{ virtual CORBA::Boolean marshal (TAO_OutputCDR &); virtual CORBA::Boolean demarshal (TAO_InputCDR &); #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ + //@} + S & arg (void); private: + S * x_; }; + // ------------------------------------------------------------ + /** * @class Out_Fixed_Size_SArgument_T * @@ -78,18 +117,35 @@ namespace TAO class Out_Fixed_Size_SArgument_T : public Argument { public: + + /// Constructor. Out_Fixed_Size_SArgument_T (void); + /** + * @name @c TAO::Argument Method Overrides + * + * @c TAO::Argument method overrides specific to the type of + * operation argument represented by this class. + * + * @see @c TAO::Argument. + */ + //@{ virtual CORBA::Boolean marshal (TAO_OutputCDR &); #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ + //@} + S & arg (void); private: + S x_; + }; + // ------------------------------------------------------------ + /** * @class Ret_Fixed_Size_SArgument_T * @@ -100,20 +156,37 @@ namespace TAO class Ret_Fixed_Size_SArgument_T : public Argument { public: + + /// Constructor. Ret_Fixed_Size_SArgument_T (void); + /** + * @name @c TAO::Argument Method Overrides + * + * @c TAO::Argument method overrides specific to the type of + * operation argument represented by this class. + * + * @see @c TAO::Argument. + */ + //@{ virtual CORBA::Boolean marshal (TAO_OutputCDR &); #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_result (CORBA::Any *); #endif /* TAO_HAS_INTERCEPTORS == 1 */ + //@} + S & arg (void); private: + S * x_; + }; + // ------------------------------------------------------------ + /** - * @struct Basic_Arg_Traits_T + * @struct Fixed_Size_SArg_Traits_T * * @brief Template class for argument traits of fixed size IDL types. * @@ -122,7 +195,7 @@ namespace TAO struct Fixed_Size_SArg_Traits_T { typedef T ret_type; - typedef const T & in_type; + typedef T const & in_type; typedef T & inout_type; typedef T & out_type; @@ -130,15 +203,25 @@ namespace TAO typedef Inout_Fixed_Size_SArgument_T<T> inout_arg_val; typedef Out_Fixed_Size_SArgument_T<T> out_arg_val; typedef Ret_Fixed_Size_SArgument_T<T> ret_val; + + // Typedefs corresponding to return value of arg() method in both + // the client and server side argument class templates. + typedef in_type in_arg_type; + typedef inout_type inout_arg_type; + typedef out_type out_arg_type; + typedef ret_type ret_arg_type; + }; -}; + +} + #if defined (__ACE_INLINE__) -#include "tao/Fixed_Size_SArgument_T.inl" +#include "tao/PortableServer/Fixed_Size_SArgument_T.inl" #endif /* __ACE_INLINE__ */ #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/Fixed_Size_SArgument_T.cpp" +#include "tao/PortableServer/Fixed_Size_SArgument_T.cpp" #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) diff --git a/TAO/tao/Fixed_Size_SArgument_T.inl b/TAO/tao/PortableServer/Fixed_Size_SArgument_T.inl index 287e3a813bf..1e06b317dcf 100644 --- a/TAO/tao/Fixed_Size_SArgument_T.inl +++ b/TAO/tao/PortableServer/Fixed_Size_SArgument_T.inl @@ -1,13 +1,10 @@ +// -*- C++ -*- +// // $Id$ template<typename S> ACE_INLINE -TAO::In_Fixed_Size_SArgument_T<S>::In_Fixed_Size_SArgument_T (void) -{} - -template<typename S> -ACE_INLINE -const S & +S const & TAO::In_Fixed_Size_SArgument_T<S>::arg (void) const { return *this->x_; @@ -55,4 +52,3 @@ TAO::Ret_Fixed_Size_SArgument_T<S>::arg (void) { return *this->x_; } - diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index daac760650d..dd498fc8258 100644 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ b/TAO/tao/PortableServer/Object_Adapter.cpp @@ -726,11 +726,14 @@ TAO_Object_Adapter::dispatch (TAO::ObjectKey &key, int result = 0; #if TAO_HAS_INTERCEPTORS == 1 - TAO_ServerRequestInterceptor_Adapter sri_adapter ( - this->orb_core_.server_request_interceptors (), - request.interceptor_count ()); + TAO::ServerRequestInterceptor_Adapter sri_adapter (request); - TAO_ServerRequestInfo ri (request, 0); + TAO::ServerRequestInfo ri (request, + 0, // args + 0, // nargs + 0, // servant_upcall + 0, // exceptions + 0); // nexceptions ACE_TRY { @@ -838,10 +841,10 @@ TAO_Object_Adapter::create_collocated_object (TAO_Stub *stub, // zero. CORBA::Object_ptr x; ACE_NEW_RETURN (x, - CORBA::Object (stub, - 1, - sb), - CORBA::Object::_nil ()); + CORBA::Object (stub, + 1, + sb), + CORBA::Object::_nil ()); // Here we set the strategized Proxy Broker. x->_proxy_broker (the_tao_collocated_object_proxy_broker ()); diff --git a/TAO/tao/PortableServer/Object_SArg_Traits.h b/TAO/tao/PortableServer/Object_SArg_Traits.h new file mode 100644 index 00000000000..e8f9530e739 --- /dev/null +++ b/TAO/tao/PortableServer/Object_SArg_Traits.h @@ -0,0 +1,56 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Object_SArg_Traits.h + * + * $Id$ + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_OBJECT_SARG_TRAITS_H +#define TAO_OBJECT_SARG_TRAITS_H + +#include /**/ "ace/pre.h" + +#include "tao/CORBA_methods.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PortableServer/Object_SArgument_T.h" +#include "tao/Pseudo_VarOut_T.h" + + +namespace CORBA +{ + class Object; + typedef Object *Object_ptr; + + typedef TAO_Pseudo_Var_T<Object> Object_var; + typedef TAO_Pseudo_Out_T<Object, Object_var> Object_out; +} + +// -------------------------------------------------------------- + +namespace TAO +{ + template <typename T> class SArg_Traits; + + /// Used in generated code if CORBA::Object is an argument or + /// return type. + ACE_TEMPLATE_SPECIALIZATION + class TAO_PortableServer_Export SArg_Traits<CORBA::Object> + : public Object_SArg_Traits_T<CORBA::Object_ptr, + CORBA::Object_var, + CORBA::Object_out> + { + }; +} + +#include /**/ "ace/post.h" + +#endif /* TAO_OBJECT_SARG_TRAITS_H */ diff --git a/TAO/tao/Object_SArgument_T.cpp b/TAO/tao/PortableServer/Object_SArgument_T.cpp index cdd83d2e90f..9a0c2906035 100644 --- a/TAO/tao/Object_SArgument_T.cpp +++ b/TAO/tao/PortableServer/Object_SArgument_T.cpp @@ -1,18 +1,15 @@ // $Id$ -#ifndef TAO_OBJECT_SARGUMENT_T_C -#define TAO_OBJECT_SARGUMENT_T_C +#ifndef TAO_OBJECT_SARGUMENT_T_CPP +#define TAO_OBJECT_SARGUMENT_T_CPP -#include "tao/Object_SArgument_T.h" +#include "tao/PortableServer/Object_SArgument_T.h" #include "tao/Dynamic_ParameterC.h" #if !defined (__ACE_INLINE__) -#include "tao/Object_SArgument_T.inl" +#include "tao/PortableServer/Object_SArgument_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID (tao, - Object_SArgument_T, - "$Id$") template<typename S_ptr, typename S_var> CORBA::Boolean @@ -110,4 +107,4 @@ TAO::Ret_Object_SArgument_T<S_ptr,S_var>::interceptor_result ( #endif /* TAO_HAS_INTERCEPTORS */ -#endif /* TAO_OBJECT_SARGUMENT_T_C */ +#endif /* TAO_OBJECT_SARGUMENT_T_CPP */ diff --git a/TAO/tao/PortableServer/Object_SArgument_T.h b/TAO/tao/PortableServer/Object_SArgument_T.h new file mode 100644 index 00000000000..b1e5e1a864e --- /dev/null +++ b/TAO/tao/PortableServer/Object_SArgument_T.h @@ -0,0 +1,163 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Object_SArgument_T.h + * + * $Id$ + * + * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman + */ +//============================================================================= + + +#ifndef TAO_OBJECT_SARGUMENT_T_H +#define TAO_OBJECT_SARGUMENT_T_H + +#include /**/ "ace/pre.h" + +#include "tao/Argument.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +// This set of classes is also used by valuetype arguments. If the +// specialization is done using S * for the parameter, the semantics +// are the same as for interfaces, so there's no need for another +// set of classes. + +namespace TAO +{ + /** + * @class In_Object_SArgument_T + * + * @brief Template class for IN skeleton object argument. + * + */ + template<typename S_ptr, typename S_var> + class In_Object_SArgument_T : public Argument + { + public: + + virtual CORBA::Boolean demarshal (TAO_InputCDR &); +#if TAO_HAS_INTERCEPTORS == 1 + virtual void interceptor_param (Dynamic::Parameter &); +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + S_ptr arg (void) const; + + private: + S_var x_; + }; + + /** + * @class Inout_Object_SArgument_T + * + * @brief Template class for INOUT skeleton object argument. + * + */ + template<typename S_ptr, typename S_var> + class Inout_Object_SArgument_T : public Argument + { + public: + Inout_Object_SArgument_T (void); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); + virtual CORBA::Boolean demarshal (TAO_InputCDR &); +#if TAO_HAS_INTERCEPTORS == 1 + virtual void interceptor_param (Dynamic::Parameter &); +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + S_ptr & arg (void); + + private: + S_var x_; + }; + + /** + * @class Out_Object_SArgument_T + * + * @brief Template class for INOUT skeleton object argument. + * + */ + template<typename S_ptr, typename S_var, typename S_out> + class Out_Object_SArgument_T : public Argument + { + public: + Out_Object_SArgument_T (void); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); +#if TAO_HAS_INTERCEPTORS == 1 + virtual void interceptor_param (Dynamic::Parameter &); +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + S_out arg (void); + + private: + S_var x_; + }; + + /** + * @class Ret_Object_SArgument_T + * + * @brief Template class for return skeleton value of object. + * + */ + template<typename S_ptr, typename S_var> + class Ret_Object_SArgument_T : public Argument + { + public: + Ret_Object_SArgument_T (void); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); +#if TAO_HAS_INTERCEPTORS == 1 + virtual void interceptor_result (CORBA::Any *); +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + S_ptr & arg (void); + + private: + S_var x_; + }; + + /** + * @struct Object_SArg_Traits_T + * + * @brief Template class for skeleton argument traits of objects. + * + */ + template<typename T_ptr, typename T_var, typename T_out> + struct Object_SArg_Traits_T + { + typedef T_ptr ret_type; + typedef T_ptr in_type; + typedef T_ptr & inout_type; + typedef T_out out_type; + + typedef In_Object_SArgument_T<T_ptr,T_var> in_arg_val; + typedef Inout_Object_SArgument_T<T_ptr,T_var> inout_arg_val; + typedef Out_Object_SArgument_T<T_ptr,T_var,T_out> out_arg_val; + typedef Ret_Object_SArgument_T<T_ptr,T_var> ret_val; + + // Typedefs corresponding to return value of arg() method in both + // the client and server side argument class templates. + typedef in_type in_arg_type; + typedef inout_type inout_arg_type; + typedef out_type out_arg_type; + typedef inout_type ret_arg_type; + + }; +} + +#if defined (__ACE_INLINE__) +#include "tao/PortableServer/Object_SArgument_T.inl" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "tao/PortableServer/Object_SArgument_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Object_SArgument_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* TAO_OBJECT_SARGUMENT_T_H */ diff --git a/TAO/tao/Object_SArgument_T.inl b/TAO/tao/PortableServer/Object_SArgument_T.inl index 4fdf9f7b72f..9588e14e67b 100644 --- a/TAO/tao/Object_SArgument_T.inl +++ b/TAO/tao/PortableServer/Object_SArgument_T.inl @@ -1,9 +1,7 @@ +// -*- C++ -*- +// // $Id$ -template<typename S_ptr, typename S_var> -ACE_INLINE -TAO::In_Object_SArgument_T<S_ptr,S_var>::In_Object_SArgument_T (void) -{} template<typename S_ptr, typename S_var> ACE_INLINE @@ -59,4 +57,3 @@ TAO::Ret_Object_SArgument_T<S_ptr,S_var>::arg (void) { return this->x_.out (); } - diff --git a/TAO/tao/PortableServer/Operation_Table.cpp b/TAO/tao/PortableServer/Operation_Table.cpp index bee2f5698e9..613d26a39d9 100644 --- a/TAO/tao/PortableServer/Operation_Table.cpp +++ b/TAO/tao/PortableServer/Operation_Table.cpp @@ -59,23 +59,24 @@ TAO_Operation_Table::~TAO_Operation_Table (void) } // constructor -TAO_Dynamic_Hash_OpTable::TAO_Dynamic_Hash_OpTable (const TAO_operation_db_entry *db, - CORBA::ULong dbsize, - CORBA::ULong hashtblsize, - ACE_Allocator *alloc) +TAO_Dynamic_Hash_OpTable::TAO_Dynamic_Hash_OpTable ( + TAO_operation_db_entry const * db, + CORBA::ULong dbsize, + CORBA::ULong hashtblsize, + ACE_Allocator *alloc) : hash_ (hashtblsize, alloc) { // Iterate thru each entry in the database and bind the operation // name to its corresponding skeleton. - for (CORBA::ULong i = 0; i < dbsize; i++) + for (CORBA::ULong i = 0; i < dbsize; ++i) { TAO::Operation_Skeletons s; - s.skel_ptr_ = db[i].skel_ptr_; - s.thruPOA_skel_ptr_ = db[i].thruPOA_skel_ptr_; - s.direct_skel_ptr_ = db[i].direct_skel_ptr_; + s.skel_ptr = db[i].skel_ptr; + s.thruPOA_skel_ptr = db[i].skel_ptr; + s.direct_skel_ptr = db[i].direct_skel_ptr; // @@ (ASG): what happens if bind fails ??? - if (this->bind (db[i].opname_, s) == -1) + if (this->bind (db[i].opname, s) == -1) ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) %p\n"), ACE_TEXT ("bind failed"))); @@ -122,7 +123,7 @@ TAO_Dynamic_Hash_OpTable::find (const char *opname, if (retval != -1) { - skel_ptr = s.skel_ptr_; + skel_ptr = s.skel_ptr; } return retval; @@ -145,11 +146,8 @@ TAO_Dynamic_Hash_OpTable::find (const char *opname, { switch (s) { - case TAO::TAO_CS_THRU_POA_STRATEGY: - skel_ptr = skel.thruPOA_skel_ptr_; - break; case TAO::TAO_CS_DIRECT_STRATEGY: - skel_ptr = skel.direct_skel_ptr_; + skel_ptr = skel.direct_skel_ptr; break; default: return -1; @@ -183,14 +181,14 @@ TAO_Linear_Search_OpTable::find (const char *opname, { ACE_FUNCTION_TIMEPROBE (TAO_LINEAR_SEARCH_OPTABLE_FIND_START); - const TAO_operation_db_entry *entry = lookup (opname); + TAO_operation_db_entry const * const entry = lookup (opname); if (entry == 0) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("TAO_Linear_Search_Table:find failed\n")), -1); // Valid entry. Figure out the skel_ptr. - skelfunc = entry->skel_ptr_; + skelfunc = entry->skel_ptr; return 0; } @@ -204,7 +202,7 @@ TAO_Linear_Search_OpTable::find (const char *opname, { ACE_FUNCTION_TIMEPROBE (TAO_LINEAR_SEARCH_OPTABLE_FIND_START); - const TAO_operation_db_entry *entry = lookup (opname); + TAO_operation_db_entry const * const entry = lookup (opname); if (entry == 0) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("TAO_Linear_Search_Table:find failed\n")), @@ -212,11 +210,8 @@ TAO_Linear_Search_OpTable::find (const char *opname, switch (st) { - case TAO::TAO_CS_THRU_POA_STRATEGY: - skelfunc = entry->thruPOA_skel_ptr_; - break; case TAO::TAO_CS_DIRECT_STRATEGY: - skelfunc = entry->direct_skel_ptr_; + skelfunc = entry->direct_skel_ptr; break; default: return -1; @@ -242,12 +237,12 @@ TAO_Active_Demux_OpTable::TAO_Active_Demux_OpTable (const for (CORBA::ULong i=0; i < dbsize; i++) { TAO::Operation_Skeletons s; - s.skel_ptr_ = db[i].skel_ptr_; - s.thruPOA_skel_ptr_ = db[i].thruPOA_skel_ptr_; - s.direct_skel_ptr_ = db[i].direct_skel_ptr_; + s.skel_ptr = db[i].skel_ptr; + s.thruPOA_skel_ptr = db[i].skel_ptr; + s.direct_skel_ptr = db[i].direct_skel_ptr; // @@ (ASG): what happens if bind fails ??? - (void) this->bind (db[i].opname_, s); + (void) this->bind (db[i].opname, s); } } @@ -257,14 +252,14 @@ TAO_Active_Demux_OpTable::~TAO_Active_Demux_OpTable (void) } int -TAO_Active_Demux_OpTable::bind (const char *opname, +TAO_Active_Demux_OpTable::bind (const char * opname, const TAO::Operation_Skeletons skel_ptr) { CORBA::ULong i = ACE_OS::atoi (opname); if (i < this->tablesize_) { - if (this->tbl_[i].op_skel_ptr_.skel_ptr_ != 0) + if (this->tbl_[i].op_skel_ptr_.skel_ptr != 0) // overwriting previous one return 1; else @@ -286,7 +281,7 @@ TAO_Active_Demux_OpTable::find (const char *opname, CORBA::ULong i = ACE_OS::atoi (opname); ACE_ASSERT (i < this->tablesize_); - skel_ptr = this->tbl_[i].op_skel_ptr_.skel_ptr_; + skel_ptr = this->tbl_[i].op_skel_ptr_.skel_ptr; return 0; //success } @@ -305,11 +300,8 @@ TAO_Active_Demux_OpTable::find (const char *opname, switch (st) { - case TAO::TAO_CS_THRU_POA_STRATEGY: - skel_ptr = this->tbl_[i].op_skel_ptr_.thruPOA_skel_ptr_; - break; case TAO::TAO_CS_DIRECT_STRATEGY: - skel_ptr = this->tbl_[i].op_skel_ptr_.direct_skel_ptr_; + skel_ptr = this->tbl_[i].op_skel_ptr_.direct_skel_ptr; break; default: return -1; @@ -343,8 +335,8 @@ TAO_Perfect_Hash_OpTable::find (const char *opname, { ACE_FUNCTION_TIMEPROBE (TAO_PERFECT_HASH_OPTABLE_FIND_START); - const TAO_operation_db_entry *entry = lookup (opname, - length); + TAO_operation_db_entry const * const entry = lookup (opname, + length); if (entry == 0) { skelfunc = 0; // insure that somebody can't call a wrong function! @@ -356,7 +348,7 @@ TAO_Perfect_Hash_OpTable::find (const char *opname, } // Valid entry. Figure out the skel_ptr. - skelfunc = entry->skel_ptr_; + skelfunc = entry->skel_ptr; return 0; } @@ -369,8 +361,8 @@ TAO_Perfect_Hash_OpTable::find (const char *opname, { ACE_FUNCTION_TIMEPROBE (TAO_PERFECT_HASH_OPTABLE_FIND_START); - const TAO_operation_db_entry *entry = lookup (opname, - length); + TAO_operation_db_entry const * const entry = lookup (opname, + length); if (entry == 0) { skelfunc = 0; // insure that somebody can't call a wrong function! @@ -383,11 +375,8 @@ TAO_Perfect_Hash_OpTable::find (const char *opname, switch (st) { - case TAO::TAO_CS_THRU_POA_STRATEGY: - skelfunc = entry->thruPOA_skel_ptr_; - break; case TAO::TAO_CS_DIRECT_STRATEGY: - skelfunc = entry->direct_skel_ptr_; + skelfunc = entry->direct_skel_ptr; break; default: return -1; @@ -419,14 +408,14 @@ TAO_Binary_Search_OpTable::find (const char *opname, { ACE_FUNCTION_TIMEPROBE (TAO_BINARY_SEARCH_OPTABLE_FIND_START); - const TAO_operation_db_entry *entry = lookup (opname); + TAO_operation_db_entry const * const entry = lookup (opname); if (entry == 0) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("TAO_Binary_Search_Table:find failed\n")), -1); // Valid entry. Figure out the skel_ptr. - skelfunc = entry->skel_ptr_; + skelfunc = entry->skel_ptr; return 0; } @@ -440,7 +429,7 @@ TAO_Binary_Search_OpTable::find (const char *opname, { ACE_FUNCTION_TIMEPROBE (TAO_BINARY_SEARCH_OPTABLE_FIND_START); - const TAO_operation_db_entry *entry = lookup (opname); + TAO_operation_db_entry const * const entry = lookup (opname); if (entry == 0) ACE_ERROR_RETURN ((LM_ERROR, @@ -449,11 +438,8 @@ TAO_Binary_Search_OpTable::find (const char *opname, switch (st) { - case TAO::TAO_CS_THRU_POA_STRATEGY: - skelfunc = entry->thruPOA_skel_ptr_; - break; case TAO::TAO_CS_DIRECT_STRATEGY: - skelfunc = entry->direct_skel_ptr_; + skelfunc = entry->direct_skel_ptr; break; default: return -1; @@ -518,7 +504,7 @@ TAO_Operation_Table_Factory::~TAO_Operation_Table_Factory (void) TAO_Operation_Table * TAO_Operation_Table_Factory::opname_lookup_strategy (void) { - TAO_Operation_Table_Parameters *p = + TAO_Operation_Table_Parameters * const p = TAO_OP_TABLE_PARAMETERS::instance (); return p->concrete_strategy (); @@ -526,9 +512,9 @@ TAO_Operation_Table_Factory::opname_lookup_strategy (void) /**************************************************************/ TAO::Operation_Skeletons::Operation_Skeletons (void) - : skel_ptr_ (0) - , thruPOA_skel_ptr_ (0) - , direct_skel_ptr_ (0) + : skel_ptr (0) + , thruPOA_skel_ptr (0) + , direct_skel_ptr (0) { } diff --git a/TAO/tao/PortableServer/Operation_Table.h b/TAO/tao/PortableServer/Operation_Table.h index 34022c768dd..e98f1e3d4c4 100644 --- a/TAO/tao/PortableServer/Operation_Table.h +++ b/TAO/tao/PortableServer/Operation_Table.h @@ -61,18 +61,16 @@ typedef void (*TAO_Collocated_Skeleton)( * corresponding skeleton. A table of such entries is used to * initialize the different lookup strategies. */ -class TAO_operation_db_entry +struct TAO_operation_db_entry { -public: /// Operation name - const char* opname_; + char const * const opname; - /// Remote skeleton pointer - TAO_Skeleton skel_ptr_; + /// Remote/thru-POA skeleton pointer + TAO_Skeleton skel_ptr; /// Collocated skeleton pointers. - TAO_Collocated_Skeleton thruPOA_skel_ptr_; - TAO_Collocated_Skeleton direct_skel_ptr_; + TAO_Collocated_Skeleton direct_skel_ptr; }; @@ -92,11 +90,11 @@ namespace TAO Operation_Skeletons (void); /// Remote skeleton pointer - TAO_Skeleton skel_ptr_; + TAO_Skeleton skel_ptr; /// Collocated skeleton pointers. - TAO_Collocated_Skeleton thruPOA_skel_ptr_; - TAO_Collocated_Skeleton direct_skel_ptr_; + TAO_Skeleton thruPOA_skel_ptr; + TAO_Collocated_Skeleton direct_skel_ptr; }; } diff --git a/TAO/tao/PortableServer/PolicyS.cpp b/TAO/tao/PortableServer/PolicyS.cpp index b4f434bd14d..326e7df4f8f 100644 --- a/TAO/tao/PortableServer/PolicyS.cpp +++ b/TAO/tao/PortableServer/PolicyS.cpp @@ -27,16 +27,25 @@ // TAO_IDL - Generated from -// be\be_codegen.cpp:609 +// be/be_codegen.cpp:609 #ifndef _TAO_IDL_ORIG_POLICYS_CPP_ #define _TAO_IDL_ORIG_POLICYS_CPP_ #include "PolicyS.h" -#include "tao/PortableServer/Servant_Upcall.h" #include "tao/PortableServer/ForwardRequestC.h" #include "tao/PortableServer/Operation_Table.h" +#include "tao/PortableServer/Upcall_Command.h" +#include "tao/PortableServer/Upcall_Wrapper.h" +#include "tao/PortableServer/Basic_SArguments.h" +#include "tao/PortableServer/Object_SArgument_T.h" +#include "tao/PortableServer/Special_Basic_SArguments.h" +#include "tao/PortableServer/UB_String_SArguments.h" +#include "tao/PortableServer/TypeCode_SArg_Traits.h" +#include "tao/PortableServer/Object_SArg_Traits.h" +#include "tao/Special_Basic_Arguments.h" +#include "tao/UB_String_Arguments.h" #include "tao/TAO_Server_Request.h" #include "tao/ORB_Core.h" #include "tao/Profile.h" @@ -46,16 +55,10 @@ #include "tao/Typecode.h" #include "tao/DynamicC.h" #include "tao/CDR.h" +#include "tao/operation_details.h" +#include "tao/PortableInterceptor.h" #include "tao/Basic_Arguments.h" #include "tao/Object_Argument_T.h" -#include "tao/PortableInterceptor.h" -#if TAO_HAS_INTERCEPTORS == 1 -#include "tao/PortableServer/PICurrent_Guard.h" -#include "tao/PortableServer/ServerRequestInfo.h" -#include "tao/PortableServer/ServerInterceptorAdapter.h" -#include "tao/RequestInfo_Util.h" -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - #include "ace/Dynamic_Service.h" #include "ace/Malloc_Allocator.h" @@ -68,7 +71,32 @@ #endif /* !defined INLINE */ // TAO_IDL - Generated from -// be\be_visitor_arg_traits.cpp:66 +// be/be_visitor_arg_traits.cpp:69 + +// Arg traits specializations. +namespace TAO +{ + +#if !defined (_CORBA_POLICY__SARG_TRAITS_SS_) +#define _CORBA_POLICY__SARG_TRAITS_SS_ + + template<> + class TAO_PortableServer_Export SArg_Traits<CORBA::Policy> + : public + Object_SArg_Traits_T< + CORBA::Policy_ptr, + CORBA::Policy_var, + CORBA::Policy_out + > + { + }; + +#endif /* end #if !defined */ +} + + +// TAO_IDL - Generated from +// be/be_visitor_arg_traits.cpp:69 // Arg traits specializations. namespace TAO @@ -77,7 +105,7 @@ namespace TAO #if !defined (_CORBA_POLICY__ARG_TRAITS_SS_) #define _CORBA_POLICY__ARG_TRAITS_SS_ - ACE_TEMPLATE_SPECIALIZATION + template<> class TAO_PortableServer_Export Arg_Traits<CORBA::Policy> : public Object_Arg_Traits_T< @@ -93,8 +121,70 @@ namespace TAO } +// Stub/skeleton argument selection function templates. +// TAO_IDL - Generated from be/be_visitor_root/root.cpp:110 + +namespace +{ + template<typename T> + typename TAO::SArg_Traits<T>::ret_arg_type + get_ret_arg (TAO_Operation_Details const * details, + TAO::Argument * const * skel_args) + { + return + details + ? static_cast<typename TAO::Arg_Traits<T>::ret_val *> ( + details->args ()[0])->arg () + : static_cast<typename TAO::SArg_Traits<T>::ret_val *> ( + skel_args[0])->arg (); + } + + template<typename T> + typename TAO::SArg_Traits<T>::in_arg_type + get_in_arg (TAO_Operation_Details const * details, + TAO::Argument * const * skel_args, + size_t i) + { + return + details + ? static_cast<typename TAO::Arg_Traits<T>::in_arg_val *> ( + details->args ()[i])->arg () + : static_cast<typename TAO::SArg_Traits<T>::in_arg_val *> ( + skel_args[i])->arg (); + } + + template<typename T> + typename TAO::SArg_Traits<T>::inout_arg_type + get_inout_arg (TAO_Operation_Details const * details, + TAO::Argument * const * skel_args, + size_t i) + { + return + details + ? static_cast<typename TAO::Arg_Traits<T>::inout_arg_val *> ( + details->args ()[i])->arg () + : static_cast<typename TAO::SArg_Traits<T>::inout_arg_val *> ( + skel_args[i])->arg (); + } + + template<typename T> + typename TAO::SArg_Traits<T>::out_arg_type + get_out_arg (TAO_Operation_Details const * details, + TAO::Argument * const * skel_args, + size_t i) + { + return + details + ? static_cast<typename TAO::Arg_Traits<T>::out_arg_val *> ( + details->args ()[i])->arg () + : static_cast<typename TAO::SArg_Traits<T>::out_arg_val *> ( + skel_args[i])->arg (); + } +} + + // TAO_IDL - Generated from -// be\be_interface.cpp:1536 +// be/be_interface.cpp:1535 class TAO_CORBA_Policy_Perfect_Hash_OpTable : public TAO_Perfect_Hash_OpTable @@ -107,7 +197,7 @@ public: }; /* C++ code produced by gperf version 2.8 (ACE version) */ -/* Command-line: c:\ace\POArefactor3\ace_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0,0 -a -o -t -p -K opname_ -L C++ -Z TAO_CORBA_Policy_Perfect_Hash_OpTable -N lookup */ +/* Command-line: /home/ossama/work/skeleton-refactor-merge/ACE_wrappers/bin/gperf -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_Policy_Perfect_Hash_OpTable -N lookup */ unsigned int TAO_CORBA_Policy_Perfect_Hash_OpTable::hash (const char *str, unsigned int len) { @@ -159,7 +249,7 @@ TAO_CORBA_Policy_Perfect_Hash_OpTable::hash (const char *str, unsigned int len) return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]]; } -const class TAO_operation_db_entry * +const struct TAO_operation_db_entry * TAO_CORBA_Policy_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len) { enum @@ -174,21 +264,21 @@ TAO_CORBA_Policy_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len WORDLIST_SIZE = 11 }; - static const class TAO_operation_db_entry wordlist[] = + static const struct TAO_operation_db_entry wordlist[] = { - {"",0,0,0},{"",0,0,0},{"",0,0,0},{"",0,0,0}, - {"copy", &POA_CORBA::Policy::copy_skel, &POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::copy, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::copy}, - {"_is_a", &POA_CORBA::Policy::_is_a_skel, 0, 0}, - {"",0,0,0}, - {"destroy", &POA_CORBA::Policy::destroy_skel, &POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::destroy, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::destroy}, - {"",0,0,0},{"",0,0,0}, - {"_component", &POA_CORBA::Policy::_component_skel, 0, 0}, - {"",0,0,0},{"",0,0,0}, - {"_non_existent", &POA_CORBA::Policy::_non_existent_skel, 0, 0}, - {"",0,0,0}, - {"_interface", &POA_CORBA::Policy::_interface_skel, 0, 0}, - {"",0,0,0},{"",0,0,0},{"",0,0,0},{"",0,0,0},{"",0,0,0}, - {"_get_policy_type", &POA_CORBA::Policy::_get_policy_type_skel, &POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::_get_policy_type, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_get_policy_type}, + {"",0,0},{"",0,0},{"",0,0},{"",0,0}, + {"copy", &POA_CORBA::Policy::copy_skel, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::copy}, + {"_is_a", &POA_CORBA::Policy::_is_a_skel, 0}, + {"",0,0}, + {"destroy", &POA_CORBA::Policy::destroy_skel, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::destroy}, + {"",0,0},{"",0,0}, + {"_component", &POA_CORBA::Policy::_component_skel, 0}, + {"",0,0},{"",0,0}, + {"_non_existent", &POA_CORBA::Policy::_non_existent_skel, 0}, + {"",0,0}, + {"_interface", &POA_CORBA::Policy::_interface_skel, 0}, + {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0}, + {"_get_policy_type", &POA_CORBA::Policy::_get_policy_type_skel, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_get_policy_type}, }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) @@ -197,7 +287,7 @@ TAO_CORBA_Policy_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE) { - const char *s = wordlist[key].opname_; + const char *s = wordlist[key].opname; if (*str == *s && !strncmp (str + 1, s + 1, len - 1)) return &wordlist[key]; @@ -207,435 +297,12 @@ TAO_CORBA_Policy_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len } static TAO_CORBA_Policy_Perfect_Hash_OpTable tao_CORBA_Policy_optable; - -// TAO_IDL - Generated from -// be\be_visitor_interface/interceptors_ss.cpp:53 - -#if (TAO_HAS_INTERCEPTORS == 1) - -// TAO_IDL - Generated from -// be\be_visitor_operation/interceptors_ss.cpp:74 - -class TAO_ServerRequestInfo_CORBA_Policy_policy_type_get : public TAO_ServerRequestInfo -{ -public: - TAO_ServerRequestInfo_CORBA_Policy_policy_type_get ( - TAO_ServerRequest &_tao_server_request, - TAO::Portable_Server::Servant_Upcall *tao_servant_upcall, - POA_CORBA::Policy *tao_impl - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ); - - virtual Dynamic::ParameterList * arguments ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual Dynamic::ExceptionList * exceptions ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Any * result ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual char * target_most_derived_interface ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Boolean target_is_a ( - const char * id - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void result (CORBA::PolicyType result); - -private: - TAO_ServerRequestInfo_CORBA_Policy_policy_type_get ( - const TAO_ServerRequestInfo_CORBA_Policy_policy_type_get & - ); - - void operator= ( - const TAO_ServerRequestInfo_CORBA_Policy_policy_type_get & - ); - -private: - POA_CORBA::Policy *_tao_impl; - - CORBA::PolicyType _result; -}; - -// TAO_IDL - Generated from -// be\be_visitor_operation/interceptors_ss.cpp:438 - -TAO_ServerRequestInfo_CORBA_Policy_policy_type_get::TAO_ServerRequestInfo_CORBA_Policy_policy_type_get ( - TAO_ServerRequest &_tao_server_request, - TAO::Portable_Server::Servant_Upcall *_tao_servant_upcall, - POA_CORBA::Policy *tao_impl - ACE_ENV_ARG_DECL_NOT_USED - ) - : TAO_ServerRequestInfo (_tao_server_request, _tao_servant_upcall), - _tao_impl (tao_impl) -{} - -Dynamic::ParameterList * -TAO_ServerRequestInfo_CORBA_Policy_policy_type_get::arguments ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Generate the argument list on demand. - Dynamic::ParameterList *parameter_list = - TAO_RequestInfo_Util::make_parameter_list (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return parameter_list; -} - -Dynamic::ExceptionList * -TAO_ServerRequestInfo_CORBA_Policy_policy_type_get::exceptions ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Generate the exception list on demand. - Dynamic::ExceptionList *exception_list = - TAO_RequestInfo_Util::make_exception_list (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return exception_list; -} - -CORBA::Any * -TAO_ServerRequestInfo_CORBA_Policy_policy_type_get::result ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Generate the result on demand. - CORBA::Boolean tk_void_any = 0; - CORBA::Any *result_any = - TAO_RequestInfo_Util::make_any (tk_void_any ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CORBA::Any_var safe_result_any = result_any; - - (*result_any) <<= this->_result; - - return safe_result_any._retn (); -} - -char * -TAO_ServerRequestInfo_CORBA_Policy_policy_type_get::target_most_derived_interface ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return - CORBA::string_dup (this->_tao_impl->_interface_repository_id ()); -} - -CORBA::Boolean -TAO_ServerRequestInfo_CORBA_Policy_policy_type_get::target_is_a ( - const char * id - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->_tao_impl->_is_a (id ACE_ENV_ARG_PARAMETER); -} - -void -TAO_ServerRequestInfo_CORBA_Policy_policy_type_get::result (CORBA::PolicyType result) -{ - // Update the result. - this->_result = result; -} - -// TAO_IDL - Generated from -// be\be_visitor_operation/interceptors_ss.cpp:74 - -class TAO_ServerRequestInfo_CORBA_Policy_copy : public TAO_ServerRequestInfo -{ -public: - TAO_ServerRequestInfo_CORBA_Policy_copy ( - TAO_ServerRequest &_tao_server_request, - TAO::Portable_Server::Servant_Upcall *tao_servant_upcall, - POA_CORBA::Policy *tao_impl - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ); - - virtual Dynamic::ParameterList * arguments ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual Dynamic::ExceptionList * exceptions ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Any * result ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual char * target_most_derived_interface ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Boolean target_is_a ( - const char * id - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void result (::CORBA::Policy_ptr result); - -private: - TAO_ServerRequestInfo_CORBA_Policy_copy ( - const TAO_ServerRequestInfo_CORBA_Policy_copy & - ); - - void operator= ( - const TAO_ServerRequestInfo_CORBA_Policy_copy & - ); - -private: - POA_CORBA::Policy *_tao_impl; - - ::CORBA::Policy_ptr _result; -}; - -// TAO_IDL - Generated from -// be\be_visitor_operation/interceptors_ss.cpp:438 - -TAO_ServerRequestInfo_CORBA_Policy_copy::TAO_ServerRequestInfo_CORBA_Policy_copy ( - TAO_ServerRequest &_tao_server_request, - TAO::Portable_Server::Servant_Upcall *_tao_servant_upcall, - POA_CORBA::Policy *tao_impl - ACE_ENV_ARG_DECL_NOT_USED - ) - : TAO_ServerRequestInfo (_tao_server_request, _tao_servant_upcall), - _tao_impl (tao_impl) -{} - -Dynamic::ParameterList * -TAO_ServerRequestInfo_CORBA_Policy_copy::arguments ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Generate the argument list on demand. - Dynamic::ParameterList *parameter_list = - TAO_RequestInfo_Util::make_parameter_list (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return parameter_list; -} - -Dynamic::ExceptionList * -TAO_ServerRequestInfo_CORBA_Policy_copy::exceptions ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Generate the exception list on demand. - Dynamic::ExceptionList *exception_list = - TAO_RequestInfo_Util::make_exception_list (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return exception_list; -} - -CORBA::Any * -TAO_ServerRequestInfo_CORBA_Policy_copy::result ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Generate the result on demand. - CORBA::Boolean tk_void_any = 0; - CORBA::Any *result_any = - TAO_RequestInfo_Util::make_any (tk_void_any ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CORBA::Any_var safe_result_any = result_any; - - (*result_any) <<= this->_result; - - return safe_result_any._retn (); -} - -char * -TAO_ServerRequestInfo_CORBA_Policy_copy::target_most_derived_interface ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return - CORBA::string_dup (this->_tao_impl->_interface_repository_id ()); -} - -CORBA::Boolean -TAO_ServerRequestInfo_CORBA_Policy_copy::target_is_a ( - const char * id - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->_tao_impl->_is_a (id ACE_ENV_ARG_PARAMETER); -} - -void -TAO_ServerRequestInfo_CORBA_Policy_copy::result (::CORBA::Policy_ptr result) -{ - // Update the result. - this->_result = result; -} - -// TAO_IDL - Generated from -// be\be_visitor_operation/interceptors_ss.cpp:74 - -class TAO_ServerRequestInfo_CORBA_Policy_destroy : public TAO_ServerRequestInfo -{ -public: - TAO_ServerRequestInfo_CORBA_Policy_destroy ( - TAO_ServerRequest &_tao_server_request, - TAO::Portable_Server::Servant_Upcall *tao_servant_upcall, - POA_CORBA::Policy *tao_impl - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ); - - virtual Dynamic::ParameterList * arguments ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual Dynamic::ExceptionList * exceptions ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Any * result ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual char * target_most_derived_interface ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::Boolean target_is_a ( - const char * id - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - TAO_ServerRequestInfo_CORBA_Policy_destroy ( - const TAO_ServerRequestInfo_CORBA_Policy_destroy & - ); - - void operator= ( - const TAO_ServerRequestInfo_CORBA_Policy_destroy & - ); - -private: - POA_CORBA::Policy *_tao_impl; - -}; - -// TAO_IDL - Generated from -// be\be_visitor_operation/interceptors_ss.cpp:438 - -TAO_ServerRequestInfo_CORBA_Policy_destroy::TAO_ServerRequestInfo_CORBA_Policy_destroy ( - TAO_ServerRequest &_tao_server_request, - TAO::Portable_Server::Servant_Upcall *_tao_servant_upcall, - POA_CORBA::Policy *tao_impl - ACE_ENV_ARG_DECL_NOT_USED - ) - : TAO_ServerRequestInfo (_tao_server_request, _tao_servant_upcall), - _tao_impl (tao_impl) -{} - -Dynamic::ParameterList * -TAO_ServerRequestInfo_CORBA_Policy_destroy::arguments ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Generate the argument list on demand. - Dynamic::ParameterList *parameter_list = - TAO_RequestInfo_Util::make_parameter_list (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return parameter_list; -} - -Dynamic::ExceptionList * -TAO_ServerRequestInfo_CORBA_Policy_destroy::exceptions ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Generate the exception list on demand. - Dynamic::ExceptionList *exception_list = - TAO_RequestInfo_Util::make_exception_list (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return exception_list; -} - -CORBA::Any * -TAO_ServerRequestInfo_CORBA_Policy_destroy::result ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Generate the result on demand. - CORBA::Boolean tk_void_any = 1; - CORBA::Any *result_any = - TAO_RequestInfo_Util::make_any (tk_void_any ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return result_any; -} - -char * -TAO_ServerRequestInfo_CORBA_Policy_destroy::target_most_derived_interface ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return - CORBA::string_dup (this->_tao_impl->_interface_repository_id ()); -} - -CORBA::Boolean -TAO_ServerRequestInfo_CORBA_Policy_destroy::target_is_a ( - const char * id - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->_tao_impl->_is_a (id ACE_ENV_ARG_PARAMETER); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - /////////////////////////////////////////////////////////////////////// // Strategized Proxy Broker Implementation // // TAO_IDL - Generated from -// be\be_visitor_interface/strategized_proxy_broker_ss.cpp:40 +// be/be_visitor_interface/strategized_proxy_broker_ss.cpp:40 // Factory function Implementation. POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker * @@ -682,43 +349,17 @@ POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::dispatch ( ) ACE_THROW_SPEC ((CORBA::Exception)) { - TAO::Portable_Server::Servant_Upcall servant_upcall ( - obj->_stubobj ()->servant_orb_var ()->orb_core () - ); + TAO_Abstract_ServantBase * const servant = obj->_servant (); TAO_Collocated_Skeleton collocated_skel; - TAO_Abstract_ServantBase *servant = 0; - - if (strategy == TAO::TAO_CS_THRU_POA_STRATEGY) - { - servant_upcall.prepare_for_upcall ( - obj->_stubobj ()->object_key (), - op, - forward_obj - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK; - - servant_upcall.pre_invoke_collocated_request ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_CHECK; - - servant = servant_upcall.servant (); - } - else - { - servant = obj->_servant (); - } - - int status = servant->_find (op, - collocated_skel, - strategy, - op_len); + int const status = servant->_find (op, + collocated_skel, + strategy, + op_len); if (status == -1) { - ACE_THROW (CORBA::BAD_OPERATION (TAO::VMCID | 2, CORBA::COMPLETED_NO)); + ACE_THROW (CORBA::BAD_OPERATION (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO)); } ACE_TRY @@ -752,7 +393,7 @@ POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::dispatch ( /////////////////////////////////////////////////////////////////////// // TAO_IDL - Generated from -// be\be_visitor_interface/interface_ss.cpp:640 +// be/be_visitor_interface/interface_ss.cpp:833 TAO::Collocation_Proxy_Broker * CORBA__TAO_Policy_Proxy_Broker_Factory_function (CORBA::Object_ptr) @@ -780,98 +421,6 @@ CORBA__TAO_Policy_Proxy_Broker_Stub_Factory_Initializer_Scarecrow = ); -/////////////////////////////////////////////////////////////////////// -// ThruPOA Proxy Implementation -// - -// TAO_IDL - Generated from -// be\be_visitor_interface/thru_poa_proxy_impl_ss.cpp:37 - -POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::_TAO_Policy_ThruPOA_Proxy_Impl (void) -{} - -// ThruPOA Implementation of the IDL interface methods - -// TAO_IDL - Generated from -// be\be_visitor_operation/thru_poa_proxy_impl_ss.cpp:52 - -void -POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::_get_policy_type ( - TAO_Abstract_ServantBase *servant, - TAO::Argument ** args, - int - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) -{ - ((TAO::Arg_Traits< ::CORBA::PolicyType>::ret_val *) args[0])->arg () = - reinterpret_cast< - POA_CORBA::Policy_ptr> ( - servant->_downcast ( - "IDL:omg.org/CORBA/Policy:1.0" - ) - )->policy_type ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_CHECK; -} - -// TAO_IDL - Generated from -// be\be_visitor_operation/thru_poa_proxy_impl_ss.cpp:52 - -void -POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::copy ( - TAO_Abstract_ServantBase *servant, - TAO::Argument ** args, - int - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) -{ - ((TAO::Arg_Traits< CORBA::Policy>::ret_val *) args[0])->arg () = - reinterpret_cast< - POA_CORBA::Policy_ptr> ( - servant->_downcast ( - "IDL:omg.org/CORBA/Policy:1.0" - ) - )->copy ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_CHECK; -} - -// TAO_IDL - Generated from -// be\be_visitor_operation/thru_poa_proxy_impl_ss.cpp:52 - -void -POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::destroy ( - TAO_Abstract_ServantBase *servant, - TAO::Argument **, - int - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) -{ - reinterpret_cast< - POA_CORBA::Policy_ptr> ( - servant->_downcast ( - "IDL:omg.org/CORBA/Policy:1.0" - ) - )->destroy ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_CHECK; -} - -// -// End ThruPOA Proxy Implementation -/////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// // Direct Proxy Implementation @@ -881,7 +430,7 @@ POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_TAO_Policy_Direct_Proxy_Impl (void) {} // TAO_IDL - Generated from -// be\be_visitor_operation/direct_proxy_impl_ss.cpp:42 +// be/be_visitor_operation/direct_proxy_impl_ss.cpp:42 void POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_get_policy_type ( @@ -895,17 +444,16 @@ POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_get_policy_type ( )) { ((TAO::Arg_Traits< ::CORBA::PolicyType>::ret_val *) args[0])->arg () = - reinterpret_cast< + dynamic_cast< POA_CORBA::Policy_ptr> ( - servant->_downcast ( - "IDL:omg.org/CORBA/Policy:1.0" - ) - )->policy_type ( + servant) + ->policy_type ( ACE_ENV_SINGLE_ARG_PARAMETER ); ACE_CHECK; -}// TAO_IDL - Generated from -// be\be_visitor_operation/direct_proxy_impl_ss.cpp:42 +} +// TAO_IDL - Generated from +// be/be_visitor_operation/direct_proxy_impl_ss.cpp:42 void POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::copy ( @@ -919,17 +467,16 @@ POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::copy ( )) { ((TAO::Arg_Traits< CORBA::Policy>::ret_val *) args[0])->arg () = - reinterpret_cast< + dynamic_cast< POA_CORBA::Policy_ptr> ( - servant->_downcast ( - "IDL:omg.org/CORBA/Policy:1.0" - ) - )->copy ( + servant) + ->copy ( ACE_ENV_SINGLE_ARG_PARAMETER ); ACE_CHECK; -}// TAO_IDL - Generated from -// be\be_visitor_operation/direct_proxy_impl_ss.cpp:42 +} +// TAO_IDL - Generated from +// be/be_visitor_operation/direct_proxy_impl_ss.cpp:42 void POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::destroy ( @@ -942,25 +489,25 @@ POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::destroy ( CORBA::SystemException )) { - reinterpret_cast< + dynamic_cast< POA_CORBA::Policy_ptr> ( - servant->_downcast ( - "IDL:omg.org/CORBA/Policy:1.0" - ) - )->destroy ( + servant) + ->destroy ( ACE_ENV_SINGLE_ARG_PARAMETER ); ACE_CHECK; } + // // End Direct Proxy Implementation /////////////////////////////////////////////////////////////////////// // TAO_IDL - Generated from -// be\be_visitor_interface/interface_ss.cpp:97 +// be/be_visitor_interface/interface_ss.cpp:103 POA_CORBA::Policy::Policy (void) + : TAO_ServantBase () { this->optable_ = &tao_CORBA_Policy_optable; } @@ -976,452 +523,497 @@ POA_CORBA::Policy::~Policy (void) } // TAO_IDL - Generated from -// be\be_visitor_operation/operation_ss.cpp:98 +// be/be_visitor_operation/operation_ss.cpp:165 void POA_CORBA::Policy::_get_policy_type_skel ( - TAO_ServerRequest &_tao_server_request, - void *_tao_servant, - void *_tao_servant_upcall + TAO_ServerRequest & server_request, + void * servant_upcall, + void * servant ACE_ENV_ARG_DECL ) { - POA_CORBA::Policy *_tao_impl = - static_cast< - POA_CORBA::Policy *> ( - _tao_servant - ); - CORBA::PolicyType _tao_retval = 0; -#if (TAO_HAS_INTERCEPTORS == 1) - TAO::Portable_Server::Servant_Upcall *_tao_upcall = - static_cast< - TAO::Portable_Server::Servant_Upcall *> ( - _tao_servant_upcall - ); - - TAO_ServerRequestInterceptor_Adapter _tao_vfr ( - _tao_server_request.orb_core ()->server_request_interceptors (), - _tao_server_request.interceptor_count () - ); - TAO_ServerRequestInfo_CORBA_Policy_policy_type_get _tao_ri ( - _tao_server_request, - _tao_upcall, - _tao_impl - ACE_ENV_ARG_PARAMETER - ); + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:74 - ACE_TRY + class Upcall_Command + : public TAO::Upcall_Command + { + public: + + inline Upcall_Command ( + POA_CORBA::Policy * servant, + TAO_Operation_Details const * operation_details, + TAO::Argument * const args[]) + : servant_ (servant) + , operation_details_ (operation_details) + , args_ (args) { - { - TAO::PICurrent_Guard _tao_pi_guard (_tao_ri.server_request (), - true /* Copy TSC to RSC */); - - _tao_vfr.receive_request (&_tao_ri ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (!_tao_vfr.location_forwarded ()) - { -#endif /* TAO_HAS_INTERCEPTORS */ - _tao_retval = - _tao_impl->policy_type ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - TAO_INTERCEPTOR_CHECK; -#if (TAO_HAS_INTERCEPTORS == 1) - } - } - - if (!_tao_vfr.location_forwarded ()) - { - CORBA::PolicyType _tao_retval_info = _tao_retval; - _tao_ri.result (_tao_retval_info); - _tao_ri.reply_status (PortableInterceptor::SUCCESSFUL); - _tao_vfr.send_reply (&_tao_ri ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } } - ACE_CATCHANY + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) { - _tao_ri.exception (&ACE_ANY_EXCEPTION); - _tao_vfr.send_exception ( - &_tao_ri - ACE_ENV_ARG_PARAMETER - ); - ACE_TRY_CHECK; + TAO::SArg_Traits< ::CORBA::PolicyType>::ret_arg_type retval = + get_ret_arg< ::CORBA::PolicyType> ( + this->operation_details_, + this->args_); - PortableInterceptor::ReplyStatus _tao_status = - _tao_ri.reply_status (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - if (_tao_status == PortableInterceptor::SYSTEM_EXCEPTION - || _tao_status == PortableInterceptor::USER_EXCEPTION) - { - ACE_RE_THROW; - } + retval = + this->servant_->policy_type ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + ACE_CHECK; } -# if defined (ACE_HAS_EXCEPTIONS) \ - && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS) - ACE_CATCHALL - { - CORBA::UNKNOWN ex; - - _tao_ri.exception (&ex); - _tao_vfr.send_exception ( - &_tao_ri - ACE_ENV_ARG_PARAMETER - ); - ACE_TRY_CHECK; - - PortableInterceptor::ReplyStatus _tao_status = - _tao_ri.reply_status (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (_tao_status == PortableInterceptor::SYSTEM_EXCEPTION) - ACE_TRY_THROW (ex); - } -# endif /* ACE_HAS_EXCEPTIONS && ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS */ - ACE_ENDTRY; - ACE_CHECK; + private: + + Upcall_Command (Upcall_Command const &); + void operator= (Upcall_Command const &); + + private: + + POA_CORBA::Policy * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; + + +#if TAO_HAS_INTERCEPTORS == 1 + static CORBA::TypeCode_ptr const exceptions[] = {}; + static size_t const nexceptions = 0; #endif /* TAO_HAS_INTERCEPTORS */ - _tao_server_request.init_reply (); -#if (TAO_HAS_INTERCEPTORS == 1) - if (!_tao_vfr.location_forwarded ()) + TAO::SArg_Traits< ::CORBA::PolicyType>::ret_val retval; + + TAO::Argument * const args[] = { -#endif /* TAO_HAS_INTERCEPTORS */ - TAO_OutputCDR &_tao_out = _tao_server_request.outgoing (); - - if (!( - (_tao_out << _tao_retval) - )) - { - TAO_OutputCDR::throw_skel_exception (errno ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } -#if (TAO_HAS_INTERCEPTORS == 1) - } -#endif /* TAO_HAS_INTERCEPTORS */ + &retval + }; + static size_t const nargs = 1; + + POA_CORBA::Policy * const impl = + static_cast< + POA_CORBA::Policy *> (servant); + + Upcall_Command command ( + impl, + server_request.operation_details (), + args); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command + +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; - // In case _tao_servant_upcall is not used in this function - ACE_UNUSED_ARG (_tao_servant_upcall); } // TAO_IDL - Generated from -// be\be_visitor_operation/operation_ss.cpp:98 +// be/be_visitor_operation/operation_ss.cpp:165 void POA_CORBA::Policy::copy_skel ( - TAO_ServerRequest &_tao_server_request, - void *_tao_servant, - void *_tao_servant_upcall + TAO_ServerRequest & server_request, + void * servant_upcall, + void * servant ACE_ENV_ARG_DECL ) { - POA_CORBA::Policy *_tao_impl = - static_cast< - POA_CORBA::Policy *> ( - _tao_servant - ); - ::CORBA::Policy_var _tao_retval; -#if (TAO_HAS_INTERCEPTORS == 1) - TAO::Portable_Server::Servant_Upcall *_tao_upcall = - static_cast< - TAO::Portable_Server::Servant_Upcall *> ( - _tao_servant_upcall - ); - - TAO_ServerRequestInterceptor_Adapter _tao_vfr ( - _tao_server_request.orb_core ()->server_request_interceptors (), - _tao_server_request.interceptor_count () - ); - TAO_ServerRequestInfo_CORBA_Policy_copy _tao_ri ( - _tao_server_request, - _tao_upcall, - _tao_impl - ACE_ENV_ARG_PARAMETER - ); + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:74 - ACE_TRY + class Upcall_Command + : public TAO::Upcall_Command + { + public: + + inline Upcall_Command ( + POA_CORBA::Policy * servant, + TAO_Operation_Details const * operation_details, + TAO::Argument * const args[]) + : servant_ (servant) + , operation_details_ (operation_details) + , args_ (args) { - { - TAO::PICurrent_Guard _tao_pi_guard (_tao_ri.server_request (), - true /* Copy TSC to RSC */); - - _tao_vfr.receive_request (&_tao_ri ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (!_tao_vfr.location_forwarded ()) - { -#endif /* TAO_HAS_INTERCEPTORS */ - _tao_retval = - _tao_impl->copy ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - TAO_INTERCEPTOR_CHECK; -#if (TAO_HAS_INTERCEPTORS == 1) - } - } - - if (!_tao_vfr.location_forwarded ()) - { - ::CORBA::Policy_ptr _tao_retval_info = _tao_retval._retn (); - _tao_ri.result (_tao_retval_info); - _tao_retval = _tao_retval_info; - _tao_ri.reply_status (PortableInterceptor::SUCCESSFUL); - _tao_vfr.send_reply (&_tao_ri ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } } - ACE_CATCHANY + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) { - _tao_ri.exception (&ACE_ANY_EXCEPTION); - _tao_vfr.send_exception ( - &_tao_ri - ACE_ENV_ARG_PARAMETER - ); - ACE_TRY_CHECK; + TAO::SArg_Traits< CORBA::Policy>::ret_arg_type retval = + get_ret_arg< CORBA::Policy> ( + this->operation_details_, + this->args_); - PortableInterceptor::ReplyStatus _tao_status = - _tao_ri.reply_status (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - if (_tao_status == PortableInterceptor::SYSTEM_EXCEPTION - || _tao_status == PortableInterceptor::USER_EXCEPTION) - { - ACE_RE_THROW; - } + retval = + this->servant_->copy ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + ACE_CHECK; } -# if defined (ACE_HAS_EXCEPTIONS) \ - && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS) - ACE_CATCHALL - { - CORBA::UNKNOWN ex; - - _tao_ri.exception (&ex); - _tao_vfr.send_exception ( - &_tao_ri - ACE_ENV_ARG_PARAMETER - ); - ACE_TRY_CHECK; - - PortableInterceptor::ReplyStatus _tao_status = - _tao_ri.reply_status (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (_tao_status == PortableInterceptor::SYSTEM_EXCEPTION) - ACE_TRY_THROW (ex); - } -# endif /* ACE_HAS_EXCEPTIONS && ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS */ - ACE_ENDTRY; - ACE_CHECK; + private: + + Upcall_Command (Upcall_Command const &); + void operator= (Upcall_Command const &); + + private: + + POA_CORBA::Policy * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; + + +#if TAO_HAS_INTERCEPTORS == 1 + static CORBA::TypeCode_ptr const exceptions[] = {}; + static size_t const nexceptions = 0; #endif /* TAO_HAS_INTERCEPTORS */ - _tao_server_request.init_reply (); -#if (TAO_HAS_INTERCEPTORS == 1) - if (!_tao_vfr.location_forwarded ()) + TAO::SArg_Traits< CORBA::Policy>::ret_val retval; + + TAO::Argument * const args[] = { -#endif /* TAO_HAS_INTERCEPTORS */ - TAO_OutputCDR &_tao_out = _tao_server_request.outgoing (); - - if (!( - (_tao_out << _tao_retval.in ()) - )) - { - TAO_OutputCDR::throw_skel_exception (errno ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } -#if (TAO_HAS_INTERCEPTORS == 1) - } -#endif /* TAO_HAS_INTERCEPTORS */ + &retval + }; + + static size_t const nargs = 1; + + POA_CORBA::Policy * const impl = + static_cast< + POA_CORBA::Policy *> (servant); + Upcall_Command command ( + impl, + server_request.operation_details (), + args); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command + +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; - // In case _tao_servant_upcall is not used in this function - ACE_UNUSED_ARG (_tao_servant_upcall); } // TAO_IDL - Generated from -// be\be_visitor_operation/operation_ss.cpp:98 +// be/be_visitor_operation/operation_ss.cpp:165 void POA_CORBA::Policy::destroy_skel ( - TAO_ServerRequest &_tao_server_request, - void *_tao_servant, - void *_tao_servant_upcall + TAO_ServerRequest & server_request, + void * servant_upcall, + void * servant ACE_ENV_ARG_DECL ) { - POA_CORBA::Policy *_tao_impl = - static_cast< - POA_CORBA::Policy *> ( - _tao_servant - ); - _tao_server_request.argument_flag (0); -#if (TAO_HAS_INTERCEPTORS == 1) - TAO::Portable_Server::Servant_Upcall *_tao_upcall = - static_cast< - TAO::Portable_Server::Servant_Upcall *> ( - _tao_servant_upcall - ); - - TAO_ServerRequestInterceptor_Adapter _tao_vfr ( - _tao_server_request.orb_core ()->server_request_interceptors (), - _tao_server_request.interceptor_count () - ); - - TAO_ServerRequestInfo_CORBA_Policy_destroy _tao_ri ( - _tao_server_request, - _tao_upcall, - _tao_impl - ACE_ENV_ARG_PARAMETER - ); + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:74 - ACE_TRY + class Upcall_Command + : public TAO::Upcall_Command + { + public: + + inline Upcall_Command ( + POA_CORBA::Policy * servant) + : servant_ (servant) { - { - TAO::PICurrent_Guard _tao_pi_guard (_tao_ri.server_request (), - true /* Copy TSC to RSC */); - - _tao_vfr.receive_request (&_tao_ri ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (!_tao_vfr.location_forwarded ()) - { -#endif /* TAO_HAS_INTERCEPTORS */ - - _tao_impl->destroy ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - TAO_INTERCEPTOR_CHECK; -#if (TAO_HAS_INTERCEPTORS == 1) - } - } - - if (!_tao_vfr.location_forwarded ()) - { - _tao_ri.reply_status (PortableInterceptor::SUCCESSFUL); - _tao_vfr.send_reply (&_tao_ri ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } } - ACE_CATCHANY + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) { - _tao_ri.exception (&ACE_ANY_EXCEPTION); - _tao_vfr.send_exception ( - &_tao_ri - ACE_ENV_ARG_PARAMETER - ); - ACE_TRY_CHECK; - - PortableInterceptor::ReplyStatus _tao_status = - _tao_ri.reply_status (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->servant_->destroy ( + ACE_ENV_SINGLE_ARG_PARAMETER); - if (_tao_status == PortableInterceptor::SYSTEM_EXCEPTION - || _tao_status == PortableInterceptor::USER_EXCEPTION) - { - ACE_RE_THROW; - } + ACE_CHECK; } -# if defined (ACE_HAS_EXCEPTIONS) \ - && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS) - ACE_CATCHALL - { - CORBA::UNKNOWN ex; - - _tao_ri.exception (&ex); - _tao_vfr.send_exception ( - &_tao_ri - ACE_ENV_ARG_PARAMETER - ); - ACE_TRY_CHECK; - - PortableInterceptor::ReplyStatus _tao_status = - _tao_ri.reply_status (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (_tao_status == PortableInterceptor::SYSTEM_EXCEPTION) - ACE_TRY_THROW (ex); - } -# endif /* ACE_HAS_EXCEPTIONS && ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS */ - ACE_ENDTRY; - ACE_CHECK; + private: + + Upcall_Command (Upcall_Command const &); + void operator= (Upcall_Command const &); + + private: + + POA_CORBA::Policy * const servant_; + }; + + +#if TAO_HAS_INTERCEPTORS == 1 + static CORBA::TypeCode_ptr const exceptions[] = {}; + static size_t const nexceptions = 0; #endif /* TAO_HAS_INTERCEPTORS */ - _tao_server_request.init_reply (); + TAO::SArg_Traits< void>::ret_val retval; + + TAO::Argument * const args[] = + { + &retval + }; + + static size_t const nargs = 1; + + POA_CORBA::Policy * const impl = + static_cast< + POA_CORBA::Policy *> (servant); + + Upcall_Command command ( + impl); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command + +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; - // In case _tao_servant_upcall is not used in this function - ACE_UNUSED_ARG (_tao_servant_upcall); } // TAO_IDL - Generated from -// be\be_visitor_interface/interface_ss.cpp:162 +// be/be_visitor_interface/interface_ss.cpp:170 void POA_CORBA::Policy::_is_a_skel ( - TAO_ServerRequest &_tao_server_request, - void * _tao_servant, - void * /* Servant_Upcall */ + TAO_ServerRequest & server_request, + void * servant_upcall, + void * servant ACE_ENV_ARG_DECL ) { - TAO_InputCDR &_tao_in = _tao_server_request.incoming (); - POA_CORBA::Policy *_tao_impl = - static_cast<POA_CORBA::Policy *> (_tao_servant); - CORBA::Boolean _tao_retval = 0; - CORBA::String_var value; + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:74 - if (!(_tao_in >> value.out ())) + class Upcall_Command + : public TAO::Upcall_Command + { + public: + + inline Upcall_Command ( + POA_CORBA::Policy * servant, + TAO_Operation_Details const * operation_details, + TAO::Argument * const args[]) + : servant_ (servant) + , operation_details_ (operation_details) + , args_ (args) { - ACE_THROW (CORBA::MARSHAL ()); + } + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) + { + TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval = + get_ret_arg< ::ACE_InputCDR::to_boolean> ( + this->operation_details_, + this->args_); + + TAO::SArg_Traits< CORBA::Char *>::in_arg_type arg_1 = + get_in_arg< CORBA::Char *> ( + this->operation_details_, + this->args_, + 1); + + + retval = + this->servant_-> _is_a ( + arg_1 + ACE_ENV_ARG_PARAMETER); + + ACE_CHECK; } - _tao_retval = _tao_impl->_is_a (value.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + private: + + Upcall_Command (Upcall_Command const &); + void operator= (Upcall_Command const &); + + private: + + POA_CORBA::Policy * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; + - _tao_server_request.init_reply (); - TAO_OutputCDR &_tao_out = _tao_server_request.outgoing (); +#if TAO_HAS_INTERCEPTORS == 1 + static CORBA::TypeCode_ptr const exceptions[] = {}; + static size_t const nexceptions = 0; +#endif /* TAO_HAS_INTERCEPTORS */ - if (!(_tao_out << CORBA::Any::from_boolean (_tao_retval))) + TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval; + TAO::SArg_Traits< CORBA::Char *>::in_arg_val _tao_repository_id; + + TAO::Argument * const args[] = { - ACE_THROW (CORBA::MARSHAL ()); - } + &retval, + &_tao_repository_id + }; + + static size_t const nargs = 2; + + POA_CORBA::Policy * const impl = + static_cast< + POA_CORBA::Policy *> (servant); + + Upcall_Command command ( + impl, + server_request.operation_details (), + args); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command + +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } void POA_CORBA::Policy::_non_existent_skel ( - TAO_ServerRequest &_tao_server_request, - void * _tao_servant, - void * /* Servant_Upcall */ + TAO_ServerRequest & server_request, + void * servant_upcall, + void * servant ACE_ENV_ARG_DECL ) { - POA_CORBA::Policy *_tao_impl = - static_cast<POA_CORBA::Policy *> (_tao_servant); - CORBA::Boolean _tao_retval = - _tao_impl->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - _tao_server_request.init_reply (); - TAO_OutputCDR &_tao_out = _tao_server_request.outgoing (); + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:74 - if (!(_tao_out << CORBA::Any::from_boolean (_tao_retval))) + class Upcall_Command + : public TAO::Upcall_Command + { + public: + + inline Upcall_Command ( + POA_CORBA::Policy * servant, + TAO_Operation_Details const * operation_details, + TAO::Argument * const args[]) + : servant_ (servant) + , operation_details_ (operation_details) + , args_ (args) { - ACE_THROW (CORBA::MARSHAL ()); } + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) + { + TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval = + get_ret_arg< ::ACE_InputCDR::to_boolean> ( + this->operation_details_, + this->args_); + + + retval = + this->servant_-> _non_existent ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + ACE_CHECK; + } + + private: + + Upcall_Command (Upcall_Command const &); + void operator= (Upcall_Command const &); + + private: + + POA_CORBA::Policy * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; + + +#if TAO_HAS_INTERCEPTORS == 1 + static CORBA::TypeCode_ptr const exceptions[] = {}; + static size_t const nexceptions = 0; +#endif /* TAO_HAS_INTERCEPTORS */ + + TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval; + + TAO::Argument * const args[] = + { + &retval + }; + + static size_t const nargs = 1; + + POA_CORBA::Policy * const impl = + static_cast< + POA_CORBA::Policy *> (servant); + + Upcall_Command command ( + impl, + server_request.operation_details (), + args); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command + +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + + +// TAO_IDL - Generated from +// be/be_visitor_interface/interface_ss.cpp:386 + + + void POA_CORBA::Policy::_interface_skel ( - TAO_ServerRequest &_tao_server_request, - void * _tao_servant, - void * /* Servant_Upcall */ + TAO_ServerRequest & server_request, + void * /* servant_upcall */, + void * servant ACE_ENV_ARG_DECL ) { @@ -1432,20 +1024,21 @@ void POA_CORBA::Policy::_interface_skel ( if (_tao_adapter == 0) { - ACE_THROW (CORBA::INTF_REPOS ()); + ACE_THROW (CORBA::INTF_REPOS (CORBA::OMGVMCID | 1, + CORBA::COMPLETED_NO)); } - POA_CORBA::Policy *_tao_impl = - static_cast<POA_CORBA::Policy *> (_tao_servant); - + POA_CORBA::Policy * const impl = + static_cast< + POA_CORBA::Policy *> (servant); CORBA::InterfaceDef_ptr _tao_retval = - _tao_impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER); + impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; - _tao_server_request.init_reply (); - TAO_OutputCDR &_tao_out = _tao_server_request.outgoing (); + server_request.init_reply (); + TAO_OutputCDR &_tao_out = *server_request.outgoing (); - CORBA::Boolean _tao_result = + CORBA::Boolean const _tao_result = _tao_adapter->interfacedef_cdr_insert ( _tao_out, _tao_retval @@ -1460,26 +1053,98 @@ void POA_CORBA::Policy::_interface_skel ( } void POA_CORBA::Policy::_component_skel ( - TAO_ServerRequest &_tao_server_request, - void * _tao_object_reference, - void * /* Servant_Upcall */ + TAO_ServerRequest & server_request, + void * servant_upcall, + void * servant ACE_ENV_ARG_DECL ) { - POA_CORBA::Policy *_tao_impl = - static_cast<POA_CORBA::Policy *> (_tao_object_reference); - CORBA::Object_var _tao_retval = - _tao_impl->_get_component (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - _tao_server_request.init_reply (); - TAO_OutputCDR &_tao_out = _tao_server_request.outgoing (); + // TAO_IDL - Generated from + // be/be_visitor_operation/upcall_command_ss.cpp:74 - if (!(_tao_out << _tao_retval.in ())) + class Upcall_Command + : public TAO::Upcall_Command + { + public: + + inline Upcall_Command ( + POA_CORBA::Policy * servant, + TAO_Operation_Details const * operation_details, + TAO::Argument * const args[]) + : servant_ (servant) + , operation_details_ (operation_details) + , args_ (args) { - ACE_THROW (CORBA::MARSHAL ()); } + + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) + { + TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval = + get_ret_arg< ::CORBA::Object> ( + this->operation_details_, + this->args_); + + + retval = + this->servant_-> _get_component ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + ACE_CHECK; + } + + private: + + Upcall_Command (Upcall_Command const &); + void operator= (Upcall_Command const &); + + private: + + POA_CORBA::Policy * const servant_; + TAO_Operation_Details const * const operation_details_; + TAO::Argument * const * const args_; + }; + + +#if TAO_HAS_INTERCEPTORS == 1 + static CORBA::TypeCode_ptr const exceptions[] = {}; + static size_t const nexceptions = 0; +#endif /* TAO_HAS_INTERCEPTORS */ + + TAO::SArg_Traits< ::CORBA::Object>::ret_val retval; + + TAO::Argument * const args[] = + { + &retval + }; + + static size_t const nargs = 1; + + POA_CORBA::Policy * const impl = + static_cast< + POA_CORBA::Policy *> (servant); + + Upcall_Command command ( + impl, + server_request.operation_details (), + args); + + TAO::Upcall_Wrapper upcall_wrapper; + upcall_wrapper.upcall (server_request + , args + , nargs + , command + +#if TAO_HAS_INTERCEPTORS == 1 + , servant_upcall + , exceptions + , nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } CORBA::Boolean POA_CORBA::Policy::_is_a ( @@ -1500,36 +1165,17 @@ CORBA::Boolean POA_CORBA::Policy::_is_a ( ); } -void* POA_CORBA::Policy::_downcast ( - const char* logical_type_id - ) -{ - if (ACE_OS::strcmp (logical_type_id, - "IDL:omg.org/CORBA/Policy:1.0") == 0) - { - return static_cast<POA_CORBA::Policy_ptr> (this); - } - - if (ACE_OS::strcmp (logical_type_id, - "IDL:omg.org/CORBA/Object:1.0") == 0) - { - return static_cast<PortableServer::Servant> (this); - } - - return 0; -} - const char* POA_CORBA::Policy::_interface_repository_id (void) const { return "IDL:omg.org/CORBA/Policy:1.0"; } // TAO_IDL - Generated from -// be\be_visitor_interface/interface_ss.cpp:576 +// be/be_visitor_interface/interface_ss.cpp:781 void POA_CORBA::Policy::_dispatch ( - TAO_ServerRequest &req, - void *servant_upcall + TAO_ServerRequest & req, + void * servant_upcall ACE_ENV_ARG_DECL ) { @@ -1540,7 +1186,7 @@ void POA_CORBA::Policy::_dispatch ( } // TAO_IDL - Generated from -// be\be_visitor_interface/interface_ss.cpp:527 +// be/be_visitor_interface/interface_ss.cpp:732 CORBA::Policy * POA_CORBA::Policy::_this (ACE_ENV_SINGLE_ARG_DECL) @@ -1572,7 +1218,7 @@ POA_CORBA::Policy::_this (ACE_ENV_SINGLE_ARG_DECL) } // TAO_IDL - Generated from -// be\be_visitor_root/root.cpp:1683 +// be/be_visitor_root/root.cpp:1673 #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/tao/PortableServer/PolicyS.h b/TAO/tao/PortableServer/PolicyS.h index d971a512ff8..42c9952ea22 100644 --- a/TAO/tao/PortableServer/PolicyS.h +++ b/TAO/tao/PortableServer/PolicyS.h @@ -26,16 +26,13 @@ // http://www.cs.wustl.edu/~schmidt/TAO.html // TAO_IDL - Generated from -// be\be_codegen.cpp:390 +// be/be_codegen.cpp:390 #ifndef _TAO_IDL_ORIG_POLICYS_H_ #define _TAO_IDL_ORIG_POLICYS_H_ #include /**/ "ace/pre.h" -#include "tao/UShortSeqS.h" -#include "tao/CurrentS.h" -#include "tao/Policy_ForwardS.h" #include "tao/PolicyC.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -69,134 +66,129 @@ #endif /* TAO_EXPORT_NESTED_CLASSES */ // TAO_IDL - Generated from -// be\be_visitor_module/module_sh.cpp:49 +// be/be_visitor_module/module_sh.cpp:49 namespace POA_CORBA { - - + + // TAO_IDL - Generated from - // be\be_visitor_interface/interface_sh.cpp:87 - + // be/be_visitor_interface/interface_sh.cpp:87 + class Policy; typedef Policy *Policy_ptr; - - class _TAO_Policy_ThruPOA_Proxy_Impl; + class _TAO_Policy_Direct_Proxy_Impl; class _TAO_Policy_Strategized_Proxy_Broker; - + class TAO_PortableServer_Export Policy : public virtual PortableServer::ServantBase { protected: Policy (void); - + public: // Useful for template programming. typedef ::CORBA::Policy _stub_type; typedef ::CORBA::Policy_ptr _stub_ptr_type; typedef ::CORBA::Policy_var _stub_var_type; - + Policy (const Policy& rhs); virtual ~Policy (void); - + virtual CORBA::Boolean _is_a ( const char* logical_type_id ACE_ENV_ARG_DECL_WITH_DEFAULTS ); - - virtual void* _downcast ( - const char* logical_type_id - ); - + static void _is_a_skel ( - TAO_ServerRequest &req, - void *servant, - void *servant_upcall + TAO_ServerRequest & req, + void * servant_upcall, + void * servant ACE_ENV_ARG_DECL ); - + static void _non_existent_skel ( - TAO_ServerRequest &req, - void *servant, - void *servant_upcall + TAO_ServerRequest & req, + void * servant_upcall, + void * servant ACE_ENV_ARG_DECL ); - + static void _interface_skel ( - TAO_ServerRequest &req, - void *servant, - void *servant_upcall + TAO_ServerRequest & req, + void * servant_upcall, + void * servant ACE_ENV_ARG_DECL ); - + static void _component_skel ( - TAO_ServerRequest &req, - void *obj, - void *servant_upcall + TAO_ServerRequest & req, + void * servant_upcall, + void * servant ACE_ENV_ARG_DECL ); - + virtual void _dispatch ( - TAO_ServerRequest &req, - void *_servant_upcall + TAO_ServerRequest & req, + void * servant_upcall ACE_ENV_ARG_DECL ); - + ::CORBA::Policy *_this ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS ); - + virtual const char* _interface_repository_id (void) const; - + // TAO_IDL - Generated from - // be\be_visitor_operation/operation_sh.cpp:45 - + // be/be_visitor_operation/operation_sh.cpp:45 + virtual CORBA::PolicyType policy_type ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS ) ACE_THROW_SPEC (( CORBA::SystemException )) = 0; - + static void _get_policy_type_skel ( - TAO_ServerRequest &_tao_req, - void *_tao_servant, - void *_tao_servant_upcall + TAO_ServerRequest & server_request, + void * servant_upcall, + void * servant ACE_ENV_ARG_DECL ); - + // TAO_IDL - Generated from - // be\be_visitor_operation/operation_sh.cpp:45 - + // be/be_visitor_operation/operation_sh.cpp:45 + virtual ::CORBA::Policy_ptr copy ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS ) ACE_THROW_SPEC (( CORBA::SystemException )) = 0; - + static void copy_skel ( - TAO_ServerRequest &_tao_req, - void *_tao_servant, - void *_tao_servant_upcall + TAO_ServerRequest & server_request, + void * servant_upcall, + void * servant ACE_ENV_ARG_DECL ); - + // TAO_IDL - Generated from - // be\be_visitor_operation/operation_sh.cpp:45 - + // be/be_visitor_operation/operation_sh.cpp:45 + virtual void destroy ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS ) ACE_THROW_SPEC (( CORBA::SystemException )) = 0; - + static void destroy_skel ( - TAO_ServerRequest &_tao_req, - void *_tao_servant, - void *_tao_servant_upcall + TAO_ServerRequest & server_request, + void * servant_upcall, + void * servant ACE_ENV_ARG_DECL ); }; @@ -206,7 +198,7 @@ namespace POA_CORBA // // TAO_IDL - Generated from - // be\be_visitor_interface/strategized_proxy_broker_sh.cpp:36 + // be/be_visitor_interface/strategized_proxy_broker_sh.cpp:36 class TAO_PortableServer_Export _TAO_Policy_Strategized_Proxy_Broker : public virtual TAO::Collocation_Proxy_Broker @@ -245,69 +237,9 @@ namespace POA_CORBA /////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////// - // ThruPOA Proxy Impl. Declaration - // - - // TAO_IDL - Generated from - // be\be_visitor_interface/thru_poa_proxy_impl_sh.cpp:37 - - class TAO_PortableServer_Export _TAO_Policy_ThruPOA_Proxy_Impl - { - public: - _TAO_Policy_ThruPOA_Proxy_Impl (void); - - virtual ~_TAO_Policy_ThruPOA_Proxy_Impl (void) {} - - // TAO_IDL - Generated from - // be\be_visitor_operation/proxy_impl_xh.cpp:24 - - static void - _get_policy_type ( - TAO_Abstract_ServantBase *servant, - TAO::Argument ** args, - int num_args - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - // TAO_IDL - Generated from - // be\be_visitor_operation/proxy_impl_xh.cpp:24 - - static void - copy ( - TAO_Abstract_ServantBase *servant, - TAO::Argument ** args, - int num_args - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - // TAO_IDL - Generated from - // be\be_visitor_operation/proxy_impl_xh.cpp:24 - - static void - destroy ( - TAO_Abstract_ServantBase *servant, - TAO::Argument ** args, - int num_args - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - }; - - // - // ThruPOA Proxy Impl. Declaration - /////////////////////////////////////////////////////////////////////// // TAO_IDL - Generated from - // be\be_visitor_interface/direct_proxy_impl_sh.cpp:31 + // be/be_visitor_interface/direct_proxy_impl_sh.cpp:31 /////////////////////////////////////////////////////////////////////// // Direct Impl. Declaration @@ -321,7 +253,7 @@ namespace POA_CORBA virtual ~_TAO_Policy_Direct_Proxy_Impl (void) {} // TAO_IDL - Generated from - // be\be_visitor_operation/proxy_impl_xh.cpp:24 + // be/be_visitor_operation/proxy_impl_xh.cpp:24 static void _get_policy_type ( @@ -335,7 +267,7 @@ namespace POA_CORBA )); // TAO_IDL - Generated from - // be\be_visitor_operation/proxy_impl_xh.cpp:24 + // be/be_visitor_operation/proxy_impl_xh.cpp:24 static void copy ( @@ -349,7 +281,7 @@ namespace POA_CORBA )); // TAO_IDL - Generated from - // be\be_visitor_operation/proxy_impl_xh.cpp:24 + // be/be_visitor_operation/proxy_impl_xh.cpp:24 static void destroy ( @@ -370,12 +302,12 @@ namespace POA_CORBA // TAO_IDL - Generated from -// be\be_visitor_module/module_sh.cpp:80 +// be/be_visitor_module/module_sh.cpp:80 } // module CORBA // TAO_IDL - Generated from -// be\be_codegen.cpp:997 +// be/be_codegen.cpp:997 #include "PolicyS_T.h" diff --git a/TAO/tao/PortableServer/PolicyS_T.cpp b/TAO/tao/PortableServer/PolicyS_T.cpp index 01dfaa34975..ef925792d16 100644 --- a/TAO/tao/PortableServer/PolicyS_T.cpp +++ b/TAO/tao/PortableServer/PolicyS_T.cpp @@ -26,7 +26,7 @@ // http://www.cs.wustl.edu/~schmidt/TAO.html // TAO_IDL - Generated from -// be\be_codegen.cpp:683 +// be/be_codegen.cpp:683 #ifndef _TAO_IDL_ORIG_POLICYS_T_CPP_ #define _TAO_IDL_ORIG_POLICYS_T_CPP_ diff --git a/TAO/tao/PortableServer/PolicyS_T.h b/TAO/tao/PortableServer/PolicyS_T.h index 07d9445660a..be1a67ace7c 100644 --- a/TAO/tao/PortableServer/PolicyS_T.h +++ b/TAO/tao/PortableServer/PolicyS_T.h @@ -26,7 +26,7 @@ // http://www.cs.wustl.edu/~schmidt/TAO.html // TAO_IDL - Generated from -// be\be_codegen.cpp:546 +// be/be_codegen.cpp:546 #ifndef _TAO_IDL_ORIG_POLICYS_T_H_ #define _TAO_IDL_ORIG_POLICYS_T_H_ @@ -40,13 +40,13 @@ // TAO_IDL - Generated from -// be\be_visitor_root/root_sth.cpp:116 +// be/be_visitor_root/root_sth.cpp:116 namespace POA_CORBA { // TAO_IDL - Generated from - // be\be_visitor_interface/tie_sh.cpp:87 + // be/be_visitor_interface/tie_sh.cpp:87 // TIE class: Refer to CORBA v2.2, Section 20.34.4 template <class T> @@ -86,7 +86,7 @@ namespace POA_CORBA ); // TAO_IDL - Generated from - // be\be_visitor_operation/tie_sh.cpp:60 + // be/be_visitor_operation/tie_sh.cpp:60 CORBA::PolicyType policy_type ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS @@ -96,7 +96,7 @@ namespace POA_CORBA )); // TAO_IDL - Generated from - // be\be_visitor_operation/tie_sh.cpp:60 + // be/be_visitor_operation/tie_sh.cpp:60 ::CORBA::Policy_ptr copy ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS @@ -106,7 +106,7 @@ namespace POA_CORBA )); // TAO_IDL - Generated from - // be\be_visitor_operation/tie_sh.cpp:60 + // be/be_visitor_operation/tie_sh.cpp:60 void destroy ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS @@ -127,7 +127,7 @@ namespace POA_CORBA } // module CORBA // TAO_IDL - Generated from -// be\be_codegen.cpp:1094 +// be/be_codegen.cpp:1094 #if defined (__ACE_INLINE__) #include "PolicyS_T.inl" diff --git a/TAO/tao/PortableServer/PolicyS_T.inl b/TAO/tao/PortableServer/PolicyS_T.inl index 42c4ad90eac..b24fde0f1e8 100644 --- a/TAO/tao/PortableServer/PolicyS_T.inl +++ b/TAO/tao/PortableServer/PolicyS_T.inl @@ -27,7 +27,7 @@ // TAO_IDL - Generated from -// be\be_visitor_interface/tie_si.cpp:96 +// be/be_visitor_interface/tie_si.cpp:96 template <class T> ACE_INLINE POA_CORBA::Policy_tie<T>::Policy_tie (T &t) @@ -120,7 +120,7 @@ POA_CORBA::Policy_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL) } // TAO_IDL - Generated from -// be\be_visitor_operation/tie_si.cpp:68 +// be/be_visitor_operation/tie_si.cpp:68 template <class T> ACE_INLINE CORBA::PolicyType POA_CORBA::Policy_tie<T>::policy_type ( @@ -136,7 +136,7 @@ CORBA::PolicyType POA_CORBA::Policy_tie<T>::policy_type ( } // TAO_IDL - Generated from -// be\be_visitor_operation/tie_si.cpp:68 +// be/be_visitor_operation/tie_si.cpp:68 template <class T> ACE_INLINE ::CORBA::Policy_ptr POA_CORBA::Policy_tie<T>::copy ( @@ -152,7 +152,7 @@ template <class T> ACE_INLINE } // TAO_IDL - Generated from -// be\be_visitor_operation/tie_si.cpp:68 +// be/be_visitor_operation/tie_si.cpp:68 template <class T> ACE_INLINE void POA_CORBA::Policy_tie<T>::destroy ( diff --git a/TAO/tao/PortableServer/Servant_Base.cpp b/TAO/tao/PortableServer/Servant_Base.cpp index 75bd7654c92..98d5f2cd549 100644 --- a/TAO/tao/PortableServer/Servant_Base.cpp +++ b/TAO/tao/PortableServer/Servant_Base.cpp @@ -26,7 +26,7 @@ ACE_RCSID (PortableServer, #if defined (ACE_ENABLE_TIMEPROBES) - static const char *TAO_Servant_Base_Timeprobe_Description[] = +static const char *TAO_Servant_Base_Timeprobe_Description[] = { "Servant_Base::_find - start", "Servant_Base::_find - end" @@ -46,13 +46,13 @@ ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Servant_Base_Timeprobe_Description, TAO_ServantBase::TAO_ServantBase (void) : TAO_Abstract_ServantBase () - , optable_ (0) + , optable_ (0) { } TAO_ServantBase::TAO_ServantBase (const TAO_ServantBase &rhs) : TAO_Abstract_ServantBase () - , optable_ (rhs.optable_) + , optable_ (rhs.optable_) { } @@ -82,7 +82,7 @@ CORBA::Boolean TAO_ServantBase::_is_a (const char *logical_type_id ACE_ENV_ARG_DECL_NOT_USED) { - const char *id = "IDL:omg.org/CORBA/Object:1.0"; + static char const id[] = "IDL:omg.org/CORBA/Object:1.0"; return ACE_OS::strcmp (logical_type_id, id) == 0; } @@ -125,7 +125,7 @@ TAO_ServantBase::_find (const char *opname, const unsigned int length) { ACE_FUNCTION_TIMEPROBE (TAO_SERVANT_BASE_FIND_START); - return optable_->find (opname, skelfunc, length); + return this->optable_->find (opname, skelfunc, length); } int @@ -135,7 +135,7 @@ TAO_ServantBase::_find (const char *opname, const unsigned int length) { ACE_FUNCTION_TIMEPROBE (TAO_SERVANT_BASE_FIND_START); - return optable_->find (opname, skelfunc, st, length); + return this->optable_->find (opname, skelfunc, st, length); } TAO_Stub * @@ -187,9 +187,9 @@ TAO_ServantBase::_create_stub (ACE_ENV_SINGLE_ARG_DECL) return stub; } -void TAO_ServantBase::synchronous_upcall_dispatch (TAO_ServerRequest &req, - void *servant_upcall, - void *derived_this +void TAO_ServantBase::synchronous_upcall_dispatch (TAO_ServerRequest & req, + void * servant_upcall, + void * derived_this ACE_ENV_ARG_DECL) { TAO_Skeleton skel; @@ -218,12 +218,13 @@ void TAO_ServantBase::synchronous_upcall_dispatch (TAO_ServerRequest &req, ACE_TRY { - // Invoke the skeleton, it will demarshal the arguments, - // invoke the right operation on the skeleton class - // (<derived_this>), and marshal any results. + // Invoke the skeleton, it will demarshal the arguments, invoke + // the right operation on the skeleton class, and marshal any + // results. De/marshaling will only occur in the uncollocated + // case. skel (req, - derived_this, - servant_upcall + servant_upcall, + derived_this ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -253,9 +254,9 @@ void TAO_ServantBase::synchronous_upcall_dispatch (TAO_ServerRequest &req, return; } -void TAO_ServantBase::asynchronous_upcall_dispatch (TAO_ServerRequest &req, - void *servant_upcall, - void *derived_this +void TAO_ServantBase::asynchronous_upcall_dispatch (TAO_ServerRequest & req, + void * servant_upcall, + void * derived_this ACE_ENV_ARG_DECL) { TAO_Skeleton skel; @@ -272,17 +273,25 @@ void TAO_ServantBase::asynchronous_upcall_dispatch (TAO_ServerRequest &req, } // Fetch the skeleton for this operation - if (this->_find (opname, skel, - static_cast <unsigned int> (req.operation_length())) == -1) + if (this->_find (opname, + skel, + static_cast <unsigned int> (req.operation_length())) == -1) { ACE_THROW (CORBA::BAD_OPERATION ()); } ACE_TRY { - // Invoke the skeleton, it will demarshal the arguments, - // invoke the right operation on the skeleton class - // (<derived_this>), and marshal any results. + // Invoke the skeleton, it will demarshal the arguments, invoke + // the right operation on the skeleton class, and marshal any + // results. De/marshaling will only occur in the uncollocated + // case. + + // @@ Why does AMH have to swap the servant_upcall and + // derived_this arguments relative to synchronous upcall + // argument order? Inconsistencies for no good reason! + // *sigh* + // -Ossama skel (req, derived_this, servant_upcall diff --git a/TAO/tao/PortableServer/Servant_Base.h b/TAO/tao/PortableServer/Servant_Base.h index 0095b24f1c0..b6c714f8e10 100644 --- a/TAO/tao/PortableServer/Servant_Base.h +++ b/TAO/tao/PortableServer/Servant_Base.h @@ -39,6 +39,7 @@ class TAO_PortableServer_Export TAO_ServantBase : public virtual TAO_Abstract_ServantBase { public: + /// Destructor. virtual ~TAO_ServantBase (void); @@ -66,10 +67,7 @@ public: ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS ); - /// Get the correct vtable. - virtual void *_downcast (const char *repository_id) = 0; - - /// This is an auxiliar method for _this() and _narrow(). + /// This is an auxiliary method for _this() and _narrow(). virtual TAO_Stub *_create_stub (ACE_ENV_SINGLE_ARG_DECL); /** @@ -108,19 +106,22 @@ protected: /// Assignment operator. TAO_ServantBase &operator= (const TAO_ServantBase &); - virtual void synchronous_upcall_dispatch (TAO_ServerRequest &req, - void *servant_upcall, - void *derived_this + virtual void synchronous_upcall_dispatch (TAO_ServerRequest & req, + void * servant_upcall, + void * derived_this ACE_ENV_ARG_DECL); - virtual void asynchronous_upcall_dispatch (TAO_ServerRequest &req, - void *servant_upcall, - void *derived_this + virtual void asynchronous_upcall_dispatch (TAO_ServerRequest & req, + void * servant_upcall, + void * derived_this ACE_ENV_ARG_DECL); + protected: - /// The operation table for this servant, it is initialized by the + + /// The operation table for this servant. It is initialized by the /// most derived class. - TAO_Operation_Table *optable_; + TAO_Operation_Table * optable_; + }; /** diff --git a/TAO/tao/PortableServer/Servant_Base.i b/TAO/tao/PortableServer/Servant_Base.i index 9821c56e03e..b48403a8e3c 100644 --- a/TAO/tao/PortableServer/Servant_Base.i +++ b/TAO/tao/PortableServer/Servant_Base.i @@ -1,8 +1,9 @@ +// -*- C++ -*- +// // $Id$ ACE_INLINE u_long TAO_Servant_Hash::operator () (PortableServer::Servant servant) const { - return static_cast <u_long>(reinterpret_cast <ptrdiff_t> (servant)); + return static_cast<u_long> (reinterpret_cast<ptrdiff_t> (servant)); } - diff --git a/TAO/tao/PortableServer/ServerInterceptorAdapter.cpp b/TAO/tao/PortableServer/ServerInterceptorAdapter.cpp index f51119658fc..47ba3705d7e 100644 --- a/TAO/tao/PortableServer/ServerInterceptorAdapter.cpp +++ b/TAO/tao/PortableServer/ServerInterceptorAdapter.cpp @@ -8,23 +8,31 @@ ACE_RCSID (PortableServer, ServerInterceptorAdapter, "$Id$") -#if !defined (__ACE_INLINE__) +#ifndef __ACE_INLINE__ # include "ServerInterceptorAdapter.inl" -#endif /* __ACE_INLINE__ */ +#endif /* !__ACE_INLINE__ */ #include "ServerRequestInfo.h" #include "PICurrent_Guard.h" +#include "tao/TAO_Server_Request.h" +#include "tao/ORB_Core.h" -TAO_ServerRequestInterceptor_Adapter::~TAO_ServerRequestInterceptor_Adapter (void) + +TAO::ServerRequestInterceptor_Adapter::ServerRequestInterceptor_Adapter ( + TAO_ServerRequest & server_request) + : interceptors_ (server_request.orb_core ()->server_request_interceptors ()) + , len_ (interceptors_.size ()) + , stack_size_ (server_request.interceptor_count ()) + , location_forwarded_ (false) { } #if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1 void -TAO_ServerRequestInterceptor_Adapter::tao_ft_interception_point ( - TAO_ServerRequestInfo *ri, - CORBA::OctetSeq_out oc +TAO::ServerRequestInterceptor_Adapter::tao_ft_interception_point ( + TAO::ServerRequestInfo * ri, + CORBA::OctetSeq_out oc ACE_ENV_ARG_DECL) { // This method implements one of the "starting" server side @@ -36,8 +44,8 @@ TAO_ServerRequestInterceptor_Adapter::tao_ft_interception_point ( // current (TSC) upon leaving this scope, i.e. just after the // receive_request_service_contexts() completes. A "guard" is // used to make the copy also occur if an exception is thrown. - TAO::PICurrent_Guard pi_guard (ri->server_request (), - false /* Copy RSC to TSC */); + TAO::PICurrent_Guard const pi_guard (ri->server_request (), + false /* Copy RSC to TSC */); oc = 0; @@ -70,16 +78,15 @@ TAO_ServerRequestInterceptor_Adapter::tao_ft_interception_point ( ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - this->location_forwarded_ = 1; + this->location_forwarded_ = true; } ACE_ENDTRY; ACE_CHECK; } void -TAO_ServerRequestInterceptor_Adapter:: -receive_request_service_contexts ( - TAO_ServerRequestInfo *ri +TAO::ServerRequestInterceptor_Adapter::receive_request_service_contexts ( + TAO::ServerRequestInfo * ri ACE_ENV_ARG_DECL) { // This method implements one of the "intermediate" server side @@ -96,6 +103,7 @@ receive_request_service_contexts ( // internal error that must be corrected. ACE_THROW (CORBA::INTERNAL ()); } + ACE_TRY { for (size_t i = 0 ; i < this->stack_size_; ++i) @@ -113,7 +121,7 @@ receive_request_service_contexts ( ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - this->location_forwarded_ = 1; + this->location_forwarded_ = true; } ACE_ENDTRY; ACE_CHECK; @@ -125,9 +133,8 @@ receive_request_service_contexts ( /// messing around things in the same function, which is harder to /// read and could make the code buggier. void -TAO_ServerRequestInterceptor_Adapter:: -receive_request_service_contexts ( - TAO_ServerRequestInfo *ri +TAO::ServerRequestInterceptor_Adapter::receive_request_service_contexts ( + TAO::ServerRequestInfo * ri ACE_ENV_ARG_DECL) { @@ -140,8 +147,8 @@ receive_request_service_contexts ( // current (TSC) upon leaving this scope, i.e. just after the // receive_request_service_contexts() completes. A "guard" is // used to make the copy also occur if an exception is thrown. - TAO::PICurrent_Guard pi_guard (ri->server_request (), - false /* Copy RSC to TSC */); + TAO::PICurrent_Guard const pi_guard (ri->server_request (), + false /* Copy RSC to TSC */); for (size_t i = 0 ; i < this->len_; ++i) { @@ -162,7 +169,7 @@ receive_request_service_contexts ( ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - this->location_forwarded_ = 1; + this->location_forwarded_ = true; } ACE_ENDTRY; ACE_CHECK; @@ -171,9 +178,9 @@ receive_request_service_contexts ( #endif /*TAO_HAS_EXTENDED_FT_INTERCEPTORS*/ void -TAO_ServerRequestInterceptor_Adapter:: -receive_request (TAO_ServerRequestInfo *ri - ACE_ENV_ARG_DECL) +TAO::ServerRequestInterceptor_Adapter::receive_request ( + TAO::ServerRequestInfo * ri + ACE_ENV_ARG_DECL) { // This method implements an "intermediate" server side interception // point. Interceptors are invoked in the same order they were @@ -212,7 +219,7 @@ receive_request (TAO_ServerRequestInfo *ri ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - this->location_forwarded_ = 1; + this->location_forwarded_ = true; } ACE_ENDTRY; ACE_CHECK; @@ -220,9 +227,9 @@ receive_request (TAO_ServerRequestInfo *ri } void -TAO_ServerRequestInterceptor_Adapter:: -send_reply (TAO_ServerRequestInfo *ri - ACE_ENV_ARG_DECL) +TAO::ServerRequestInterceptor_Adapter::send_reply ( + TAO::ServerRequestInfo * ri + ACE_ENV_ARG_DECL) { // This is an "ending" interception point so we only process the // interceptors pushed on to the flow stack. @@ -232,7 +239,7 @@ send_reply (TAO_ServerRequestInfo *ri // interception point. // Unwind the stack. - const size_t len = this->stack_size_; + size_t const len = this->stack_size_; for (size_t i = 0; i < len; ++i) { // Pop the interceptor off of the flow stack before it is @@ -253,9 +260,9 @@ send_reply (TAO_ServerRequestInfo *ri } void -TAO_ServerRequestInterceptor_Adapter:: -send_exception (TAO_ServerRequestInfo *ri - ACE_ENV_ARG_DECL) +TAO::ServerRequestInterceptor_Adapter::send_exception ( + TAO::ServerRequestInfo *ri + ACE_ENV_ARG_DECL) { // This is an "ending" server side interception point so we only // process the interceptors pushed on to the flow stack. @@ -267,7 +274,7 @@ send_exception (TAO_ServerRequestInfo *ri ACE_TRY { // Unwind the flow stack. - const size_t len = this->stack_size_; + size_t const len = this->stack_size_; for (size_t i = 0; i < len; ++i) { // Pop the interceptor off of the flow stack before it is @@ -289,7 +296,7 @@ send_exception (TAO_ServerRequestInfo *ri ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - this->location_forwarded_ = 1; + this->location_forwarded_ = true; } ACE_CATCHANY { @@ -324,9 +331,9 @@ send_exception (TAO_ServerRequestInfo *ri } void -TAO_ServerRequestInterceptor_Adapter:: -send_other (TAO_ServerRequestInfo *ri - ACE_ENV_ARG_DECL) +TAO::ServerRequestInterceptor_Adapter::send_other ( + TAO::ServerRequestInfo * ri + ACE_ENV_ARG_DECL) { // This is an "ending" server side interception point so we only // process the interceptors pushed on to the flow stack. @@ -338,7 +345,7 @@ send_other (TAO_ServerRequestInfo *ri ACE_TRY { // Unwind the flow stack. - const size_t len = this->stack_size_; + size_t const len = this->stack_size_; for (size_t i = 0; i < len; ++i) { // Pop the interceptor off of the flow stack before it is @@ -360,7 +367,7 @@ send_other (TAO_ServerRequestInfo *ri ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - this->location_forwarded_ = 1; + this->location_forwarded_ = true; } ACE_ENDTRY; ACE_CHECK; diff --git a/TAO/tao/PortableServer/ServerInterceptorAdapter.h b/TAO/tao/PortableServer/ServerInterceptorAdapter.h index 3ba1051a2ee..4dacdb6fea0 100644 --- a/TAO/tao/PortableServer/ServerInterceptorAdapter.h +++ b/TAO/tao/PortableServer/ServerInterceptorAdapter.h @@ -7,7 +7,7 @@ * $Id$ * * This file contains a helper class to simplify the support of - * interceptors in tao_idl generated skeletons. + * interceptors in TAO_IDL generated skeletons. * * @author Nanbor Wang <nanbor@cs.wustl.edu> * @author Ossama Othman <ossama@uci.edu> @@ -34,97 +34,100 @@ #include "tao/Basic_Types.h" #include "tao/Interceptor_List.h" -class TAO_ServerRequestInfo; +class TAO_ServerRequest; -/** - * @class TAO_ServerRequestInterceptor_Adapter - * - * @brief TAO_ServerRequestInterceptor_Adapter - * - * A convenient helper class to invoke registered server request - * interceptor(s) in tao_idl generated code. - */ -class TAO_PortableServer_Export TAO_ServerRequestInterceptor_Adapter -{ -public: - TAO_ServerRequestInterceptor_Adapter ( - TAO_ServerRequestInterceptor_List::TYPE &interceptors, - size_t &stack_size); - - ~TAO_ServerRequestInterceptor_Adapter (void); +namespace TAO +{ + class ServerRequestInfo; /** - * @name PortableInterceptor Client Side Interception Points + * @class ServerRequestInterceptor_Adapter * - * Each of these methods corresponds to a client side interception - * point. + * @brief ServerRequestInterceptor_Adapter * + * A convenient helper class to invoke registered server request + * interceptor(s). */ - //@{ + class ServerRequestInterceptor_Adapter + { + public: + + /// Constructor. + ServerRequestInterceptor_Adapter (TAO_ServerRequest & server_request); + + /** + * @name PortableInterceptor Client Side Interception Points + * + * Each of these methods corresponds to a client side interception + * point. + */ + //@{ #if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1 - /// This method implements the "starting" server side interception - /// point. It will be used as the first interception point and it is - /// proprietary to TAO. - /// @@ Will go away once Bug 1369 is fixed - void tao_ft_interception_point ( - TAO_ServerRequestInfo *ri , - CORBA::OctetSeq_out oc - ACE_ENV_ARG_DECL); + /// This method implements the "starting" server side interception + /// point. It will be used as the first interception point and it is + /// proprietary to TAO. + /// @@ Will go away once Bug 1369 is fixed + void tao_ft_interception_point (TAO::ServerRequestInfo * ri , + CORBA::OctetSeq_out oc + ACE_ENV_ARG_DECL); #endif /*TAO_HAS_EXTENDED_FT_INTERCEPTORS*/ - /// This method implements the "intermediate" server side interception - /// point if the above #ifdef is set to 1 and a starting intercetion - /// point if it is not set to 1. - /// @@ NOTE: This method should have been the "starting" - /// interception point according to the interceptor spec. This will - /// be fixed once Bug 1369 is completely done. - void receive_request_service_contexts ( - TAO_ServerRequestInfo * ri - ACE_ENV_ARG_DECL); - - /// This method an "intermediate" server side interception point. - void receive_request (TAO_ServerRequestInfo * ri - ACE_ENV_ARG_DECL); - - /// This method implements one of the "ending" server side - /// interception points. - void send_reply (TAO_ServerRequestInfo * ri - ACE_ENV_ARG_DECL); - - /// This method implements one of the "ending" server side - /// interception points. - void send_exception (TAO_ServerRequestInfo * ri - ACE_ENV_ARG_DECL); - - /// This method implements one of the "ending" server side - /// interception points. - void send_other (TAO_ServerRequestInfo * ri - ACE_ENV_ARG_DECL); - //@} - - /// Returns true if a LOCATION_FORWARD was generated, and false - /// otherwise. - CORBA::Boolean location_forwarded (void) const; - -private: - - /// Reference to the list of registered interceptors. - TAO_ServerRequestInterceptor_List::TYPE & interceptors_; - - /// Cache the length of the interceptor list so that we don't have - /// to compute it at each stage of the current interception. - const size_t len_; - - /// The number of interceptors "pushed" onto the logical flow - /// stack. This is used when unwinding the flow stack. - size_t & stack_size_; - - /// True if a PortableInterceptor::ForwardRequest exception was - /// thrown. - CORBA::Boolean location_forwarded_; - -}; + /// This method implements the "intermediate" server side + /// interception point if the above #ifdef is set to 1 and a + /// starting intercetion point if it is not set to 1. + /// + /// @note This method should have been the "starting" interception + /// point according to the interceptor spec. This will be + /// fixed once Bug 1369 is completely done. + void receive_request_service_contexts (TAO::ServerRequestInfo * ri + ACE_ENV_ARG_DECL); + + /// This method an "intermediate" server side interception point. + void receive_request (TAO::ServerRequestInfo * ri + ACE_ENV_ARG_DECL); + + /// This method implements one of the "ending" server side + /// interception points. + void send_reply (TAO::ServerRequestInfo * ri + ACE_ENV_ARG_DECL); + + /// This method implements one of the "ending" server side + /// interception points. + void send_exception (TAO::ServerRequestInfo * ri + ACE_ENV_ARG_DECL); + + /// This method implements one of the "ending" server side + /// interception points. + void send_other (TAO::ServerRequestInfo * ri + ACE_ENV_ARG_DECL); + //@} + + /// Returns true if a LOCATION_FORWARD was generated, and false + /// otherwise. + bool location_forwarded (void) const; + + private: + + /// Reference to the list of registered interceptors. + TAO_ServerRequestInterceptor_List::TYPE & interceptors_; + + /// Cache the length of the interceptor list so that we don't have + /// to compute it at each stage of the current interception. + size_t const len_; + + /// The number of interceptors "pushed" onto the logical flow + /// stack. This is used when unwinding the flow stack. + size_t & stack_size_; + + /// True if a PortableInterceptor::ForwardRequest exception was + /// thrown. + bool location_forwarded_; + + }; + +} // End namespace TAO + #if defined (__ACE_INLINE__) # include "ServerInterceptorAdapter.inl" diff --git a/TAO/tao/PortableServer/ServerInterceptorAdapter.inl b/TAO/tao/PortableServer/ServerInterceptorAdapter.inl index 45c3bbfd4d8..30e0c4508ce 100644 --- a/TAO/tao/PortableServer/ServerInterceptorAdapter.inl +++ b/TAO/tao/PortableServer/ServerInterceptorAdapter.inl @@ -2,19 +2,8 @@ // // $Id$ -ACE_INLINE -TAO_ServerRequestInterceptor_Adapter::TAO_ServerRequestInterceptor_Adapter - (TAO_ServerRequestInterceptor_List::TYPE & interceptors, - size_t & stack_size) - : interceptors_ (interceptors), - len_ (interceptors.size ()), - stack_size_ (stack_size), - location_forwarded_ (0) -{ -} - -ACE_INLINE CORBA::Boolean -TAO_ServerRequestInterceptor_Adapter::location_forwarded (void) const +ACE_INLINE bool +TAO::ServerRequestInterceptor_Adapter::location_forwarded (void) const { return this->location_forwarded_; } diff --git a/TAO/tao/PortableServer/ServerRequestInfo.cpp b/TAO/tao/PortableServer/ServerRequestInfo.cpp index 4e6dbc4bda3..f9de6afb8eb 100644 --- a/TAO/tao/PortableServer/ServerRequestInfo.cpp +++ b/TAO/tao/PortableServer/ServerRequestInfo.cpp @@ -1,3 +1,5 @@ +// $Id$ + #include "ServerRequestInfo.h" #if (TAO_HAS_INTERCEPTORS == 1) @@ -8,11 +10,15 @@ ACE_RCSID (PortableServer, #include "Root_POA.h" #include "Servant_Upcall.h" +#include "Servant_Base.h" #include "tao/TAO_Server_Request.h" #include "tao/ORB_Core.h" #include "tao/PolicyC.h" +#include "tao/DynamicC.h" #include "tao/ORB_Core.h" +#include "tao/Service_Context.h" +#include "tao/RequestInfo_Util.h" #include "ace/OS_NS_string.h" @@ -20,18 +26,9 @@ ACE_RCSID (PortableServer, # include "ServerRequestInfo.inl" # endif /* !__ACE_INLINE__ */ -TAO_ServerRequestInfo::TAO_ServerRequestInfo ( - TAO_ServerRequest &server_request, - TAO::Portable_Server::Servant_Upcall *servant_upcall) - : server_request_ (server_request), - servant_upcall_ (servant_upcall), - caught_exception_ (0), - reply_status_ (-1) -{ -} CORBA::ULong -TAO_ServerRequestInfo::request_id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) +TAO::ServerRequestInfo::request_id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { // The request ID returned by this method need not correspond to the @@ -75,32 +72,89 @@ TAO_ServerRequestInfo::request_id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) } char * -TAO_ServerRequestInfo::operation (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) +TAO::ServerRequestInfo::operation (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { return CORBA::string_dup (this->server_request_.operation ()); } Dynamic::ParameterList * -TAO_ServerRequestInfo::arguments (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::arguments (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, - CORBA::COMPLETED_NO), - 0); + if (this->args_ == 0) + { + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, + CORBA::COMPLETED_NO), + 0); + } + + // Generate the argument list on demand. + Dynamic::ParameterList * const parameter_list = + TAO_RequestInfo_Util::make_parameter_list (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + Dynamic::ParameterList_var safe_parameter_list = parameter_list; + + // Return value is always generated as first TAO::Argument in + // skeleton. It shouldn't be included in the parameter list. + // Skip it. + + TAO::Argument * const * const begin = this->args_ + 1; + TAO::Argument * const * const end = this->args_ + this->nargs_; + + ACE_ASSERT (end - begin >= 0); + + parameter_list->length (static_cast<CORBA::ULong> (end - begin)); + + CORBA::ULong p = 0; + for (TAO::Argument * const * i = begin; i != end; ++i, ++p) + { + // Insert the operation parameters into the + // Dynamic::ParameterList. + (*i)->interceptor_param ((*parameter_list)[p]); + } + + return safe_parameter_list._retn (); } Dynamic::ExceptionList * -TAO_ServerRequestInfo::exceptions (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::exceptions (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, - CORBA::COMPLETED_NO), - 0); + if (this->args_ == 0) + { + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, + CORBA::COMPLETED_NO), + 0); + } + + // Generate the exception list on demand. + Dynamic::ExceptionList * const exception_list = + TAO_RequestInfo_Util::make_exception_list (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + Dynamic::ExceptionList_var safe_exception_list = exception_list; + + exception_list->length (this->nexceptions_); + + CORBA::TypeCode_ptr const * const begin = this->exceptions_; + CORBA::TypeCode_ptr const * const end = + this->exceptions_ + this->nexceptions_; + + CORBA::ULong e = 0; + for (CORBA::TypeCode_ptr const * i = begin; i != end; ++i, ++e) + { + TAO_Pseudo_Object_Manager<CORBA::TypeCode> tcp_object ( + const_cast<CORBA::TypeCode_ptr *> (i), 1); + (*exception_list)[e] = tcp_object; + } + + return safe_exception_list._retn (); } Dynamic::ContextList * -TAO_ServerRequestInfo::contexts (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::contexts (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, @@ -109,7 +163,7 @@ TAO_ServerRequestInfo::contexts (ACE_ENV_SINGLE_ARG_DECL) } Dynamic::RequestContext * -TAO_ServerRequestInfo::operation_context (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::operation_context (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, @@ -118,23 +172,44 @@ TAO_ServerRequestInfo::operation_context (ACE_ENV_SINGLE_ARG_DECL) } CORBA::Any * -TAO_ServerRequestInfo::result (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::result (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, - CORBA::COMPLETED_NO), - 0); + if (this->args_ == 0) + { + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, + CORBA::COMPLETED_NO), + 0); + } + + // Generate the result on demand. + + static CORBA::Boolean const tk_void_any = 1; + + CORBA::Any * result_any = + TAO_RequestInfo_Util::make_any (tk_void_any + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Any_var safe_result_any = result_any; + + // Result is always first element in TAO::Argument array. + TAO::Argument * const r = this->args_[0]; + + r->interceptor_result (result_any); + + return safe_result_any._retn (); } CORBA::Boolean -TAO_ServerRequestInfo::response_expected (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) +TAO::ServerRequestInfo::response_expected (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { return this->server_request_.response_expected (); } Messaging::SyncScope -TAO_ServerRequestInfo::sync_scope (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::sync_scope (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { if (this->server_request_.sync_with_server ()) @@ -146,7 +221,7 @@ TAO_ServerRequestInfo::sync_scope (ACE_ENV_SINGLE_ARG_DECL) } PortableInterceptor::ReplyStatus -TAO_ServerRequestInfo::reply_status (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::reply_status (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { if (this->reply_status_ == -1) @@ -159,7 +234,7 @@ TAO_ServerRequestInfo::reply_status (ACE_ENV_SINGLE_ARG_DECL) } CORBA::Object_ptr -TAO_ServerRequestInfo::forward_reference (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::forward_reference (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { if (this->reply_status_ != PortableInterceptor::LOCATION_FORWARD) @@ -173,8 +248,8 @@ TAO_ServerRequestInfo::forward_reference (ACE_ENV_SINGLE_ARG_DECL) } CORBA::Any * -TAO_ServerRequestInfo::get_slot (PortableInterceptor::SlotId id - ACE_ENV_ARG_DECL) +TAO::ServerRequestInfo::get_slot (PortableInterceptor::SlotId id + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::InvalidSlot)) { @@ -197,7 +272,7 @@ TAO_ServerRequestInfo::get_slot (PortableInterceptor::SlotId id } IOP::ServiceContext * -TAO_ServerRequestInfo::get_request_service_context ( +TAO::ServerRequestInfo::get_request_service_context ( IOP::ServiceId id ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -211,12 +286,12 @@ TAO_ServerRequestInfo::get_request_service_context ( } IOP::ServiceContext * -TAO_ServerRequestInfo::get_reply_service_context ( +TAO::ServerRequestInfo::get_reply_service_context ( IOP::ServiceId id ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - TAO_Service_Context &service_context_list = + TAO_Service_Context & service_context_list = this->server_request_.reply_service_context (); return this->get_service_context_i (service_context_list, @@ -225,8 +300,8 @@ TAO_ServerRequestInfo::get_reply_service_context ( } IOP::ServiceContext * -TAO_ServerRequestInfo::get_service_context_i ( - TAO_Service_Context &service_context_list, +TAO::ServerRequestInfo::get_service_context_i ( + TAO_Service_Context & service_context_list, IOP::ServiceId id ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -251,7 +326,7 @@ TAO_ServerRequestInfo::get_service_context_i ( // exception from an Any. This method is in place just to be compliant // with the spec. CORBA::Any * -TAO_ServerRequestInfo::sending_exception (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::sending_exception (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { if (this->reply_status_ != PortableInterceptor::SYSTEM_EXCEPTION @@ -285,17 +360,8 @@ TAO_ServerRequestInfo::sending_exception (ACE_ENV_SINGLE_ARG_DECL) return caught_exception._retn (); } -// = TAO specific method done since there currently is no simple way -// to extract exceptions from an Any -CORBA::Exception * -TAO_ServerRequestInfo::_sending_exception (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->caught_exception_; -} - char * -TAO_ServerRequestInfo::server_id (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::server_id (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { if (this->servant_upcall_ != 0) @@ -309,7 +375,7 @@ TAO_ServerRequestInfo::server_id (ACE_ENV_SINGLE_ARG_DECL) } char * -TAO_ServerRequestInfo::orb_id (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::orb_id (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { if (this->servant_upcall_ != 0) @@ -322,7 +388,7 @@ TAO_ServerRequestInfo::orb_id (ACE_ENV_SINGLE_ARG_DECL) } PortableInterceptor::AdapterName * -TAO_ServerRequestInfo::adapter_name (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::adapter_name (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { // The adapter_name attribute defines a name for the object adapter @@ -341,7 +407,7 @@ TAO_ServerRequestInfo::adapter_name (ACE_ENV_SINGLE_ARG_DECL) } PortableInterceptor::ObjectId * -TAO_ServerRequestInfo::object_id (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::object_id (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { if (this->servant_upcall_ != 0) @@ -384,7 +450,7 @@ TAO_ServerRequestInfo::object_id (ACE_ENV_SINGLE_ARG_DECL) } CORBA::OctetSeq * -TAO_ServerRequestInfo::adapter_id (ACE_ENV_SINGLE_ARG_DECL) +TAO::ServerRequestInfo::adapter_id (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { if (this->servant_upcall_ != 0) @@ -396,20 +462,28 @@ TAO_ServerRequestInfo::adapter_id (ACE_ENV_SINGLE_ARG_DECL) } char * -TAO_ServerRequestInfo::target_most_derived_interface ( +TAO::ServerRequestInfo::target_most_derived_interface ( ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - // Implemented in the generated skeleton. + PortableServer::Servant const servant = + (this->servant_upcall_ == 0 + ? 0 + : this->servant_upcall_->servant ()); - ACE_THROW_RETURN (CORBA::NO_RESOURCES (CORBA::OMGVMCID | 1, - CORBA::COMPLETED_NO), - 0); + if (servant == 0) + { + ACE_THROW_RETURN (CORBA::NO_RESOURCES (CORBA::OMGVMCID | 1, + CORBA::COMPLETED_NO), + 0); + } + + return CORBA::string_dup (servant->_interface_repository_id ()); } CORBA::Policy_ptr -TAO_ServerRequestInfo::get_server_policy (CORBA::PolicyType type - ACE_ENV_ARG_DECL) +TAO::ServerRequestInfo::get_server_policy (CORBA::PolicyType type + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { if (this->servant_upcall_ != 0) @@ -440,9 +514,9 @@ TAO_ServerRequestInfo::get_server_policy (CORBA::PolicyType type } void -TAO_ServerRequestInfo::set_slot (PortableInterceptor::SlotId id, - const CORBA::Any &data - ACE_ENV_ARG_DECL) +TAO::ServerRequestInfo::set_slot (PortableInterceptor::SlotId id, + const CORBA::Any &data + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::InvalidSlot)) { @@ -465,18 +539,31 @@ TAO_ServerRequestInfo::set_slot (PortableInterceptor::SlotId id, } CORBA::Boolean -TAO_ServerRequestInfo::target_is_a (const char * /* id */ - ACE_ENV_ARG_DECL) +TAO::ServerRequestInfo::target_is_a (const char * id + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { // Implemented in the generated skeleton. - ACE_THROW_RETURN (CORBA::NO_RESOURCES (CORBA::OMGVMCID | 1, - CORBA::COMPLETED_NO), 0); + PortableServer::Servant const servant = + (this->servant_upcall_ == 0 + ? 0 + : this->servant_upcall_->servant ()); + + + if (servant == 0) + { + ACE_THROW_RETURN (CORBA::NO_RESOURCES (CORBA::OMGVMCID | 1, + CORBA::COMPLETED_NO), + 0); + } + + return servant->_is_a (id + ACE_ENV_ARG_PARAMETER); } void -TAO_ServerRequestInfo::add_reply_service_context ( +TAO::ServerRequestInfo::add_reply_service_context ( const IOP::ServiceContext & service_context, CORBA::Boolean replace ACE_ENV_ARG_DECL) diff --git a/TAO/tao/PortableServer/ServerRequestInfo.h b/TAO/tao/PortableServer/ServerRequestInfo.h index eabc646c982..1cc2cd261ed 100644 --- a/TAO/tao/PortableServer/ServerRequestInfo.h +++ b/TAO/tao/PortableServer/ServerRequestInfo.h @@ -7,10 +7,10 @@ * $Id$ * * This is the implementation of the - * PortableInterceptor::ServerRequestInfo interface. + * @c PortableInterceptor::ServerRequestInfo interface. * * @author Kirthika Parameswaran <kirthika@cs.wustl.edu> - * @author Ossama Othman <ossama@uci.edu> + * @author Ossama Othman */ //============================================================================= @@ -19,14 +19,12 @@ #include /**/ "ace/pre.h" -#include "portableserver_export.h" +#include "tao/orbconf.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/orbconf.h" - #if (TAO_HAS_INTERCEPTORS == 1) #include "tao/PortableInterceptorC.h" @@ -50,239 +48,267 @@ namespace TAO } } -/** - * @class TAO_ServerRequestInfo - * - * @brief Implementation of the PortableInterceptor::ServerRequestInfo - * interface. - */ -class TAO_PortableServer_Export TAO_ServerRequestInfo - : public virtual PortableInterceptor::ServerRequestInfo, - public virtual CORBA::LocalObject +namespace TAO { -public: - - /// Constructor. - TAO_ServerRequestInfo (TAO_ServerRequest &server_request, - TAO::Portable_Server::Servant_Upcall *servant_upcall); - - /// Return an ID unique to the current request. This request ID may - /// or may not be the same as the GIOP request ID. - virtual CORBA::ULong request_id ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the operation name for the current request. - virtual char * operation ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the list of arguments passed to the current operation. - virtual Dynamic::ParameterList * arguments ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the list of exceptions the current operation is capable - /// of throwing. - virtual Dynamic::ExceptionList * exceptions ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual Dynamic::ContextList * contexts ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual Dynamic::RequestContext * operation_context ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the result of the current request. If there is no return - /// value then an Any with tk_void TypeCode is returned. This - /// method is not valid for oneway operations. - virtual CORBA::Any * result ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Returns true for a two-way operation, and false otherwise. - virtual CORBA::Boolean response_expected ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the sync_scope policy value for the current one-way - /// operation. If the operation is not a one-way, a - /// CORBA::BAD_INV_ORDER exception is thrown. - virtual Messaging::SyncScope sync_scope ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the reply status for the current request. Statuses can - /// be PortableInterceptor::SUCCESSFUL, SYSTEM_EXCEPTION, - /// USER_EXCEPTION, LOCATION_FORWARD, LOCATION_FORWARD_PERMANENT, - /// TRANSPORT_RETRY. - virtual PortableInterceptor::ReplyStatus reply_status ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// If the reply status is PortableInterceptor::LOCATION_FORWARD or - /// PortableInterceptor::LOCATION_FORWARD_PERMANENT, return the - /// object reference to which the request was forwarded. - virtual CORBA::Object_ptr forward_reference ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)) ; - - /// Retrieve data from the "request scope" PICurrent object. - virtual CORBA::Any * get_slot ( - PortableInterceptor::SlotId id - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::InvalidSlot)); - - /// Return the IOP::ServiceContext with the given IOP::ServiceId - /// from the request service context list. - virtual IOP::ServiceContext * get_request_service_context ( - IOP::ServiceId id - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the IOP::ServiceContext with the given IOP::ServiceId - /// from the reply service context list. - virtual IOP::ServiceContext * get_reply_service_context ( - IOP::ServiceId id - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return an Any containing the exception being sent, if any. - /// Otherwise, throw a CORBA::BAD_INV_ORDER exception. - /** - * @note There is no trivial way to extract the exception from an Any. - */ - virtual CORBA::Any * sending_exception ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /** - * @note This is TAO specific and was done to combat the previous - * problem to some extent. Avoid this method whenever - * possible. - */ - virtual CORBA::Exception * _sending_exception ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the ObjectId for the target object. - virtual PortableInterceptor::ObjectId * object_id ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the AdapterId for the POA handling the current request. - virtual CORBA::OctetSeq * adapter_id ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the server_id of the server. The value is passed to - /// the ORB via -ORBServerId parameter. - virtual char * server_id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the ORBId value that is passed to the ORB::Init call. - virtual char * orb_id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the name of the object adapter that services requests for - /// the invoked object. - virtual PortableInterceptor::AdapterName * adapter_name ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the most derived interface of the target object. - virtual char * target_most_derived_interface ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the policy of the given type in effect for the current - /// request. - virtual CORBA::Policy_ptr get_server_policy ( - CORBA::PolicyType type - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Insert data into the "request scope" PICurrent object. - virtual void set_slot ( - PortableInterceptor::SlotId id, - const CORBA::Any & data - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableInterceptor::InvalidSlot)); - - /// Returns true if the target's type corresponds to the given - /// RepositoryId. - virtual CORBA::Boolean target_is_a ( - const char * id - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Add the IOP::ServiceContext to the reply (outgoing) - /// IOP::ServiceContextList. - virtual void add_reply_service_context ( - const IOP::ServiceContext & service_context, - CORBA::Boolean replace - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -public: - /** - * @name Helper methods specific to TAO. + * @class ServerRequestInfo + * + * @brief Implementation of the + * @c PortableInterceptor::ServerRequestInfo IDL interface. + * + * Implementation of the @c PortableInterceptor::ServerRequestInfo + * IDL interface. + * + * @note This class is currently not meant to be reference counted + * since it is instantiated on the stack. */ - //@{ - - /// Change the exception status. - void exception (CORBA::Exception *exception); - - /// Set the status of the received reply. - void reply_status (PortableInterceptor::ReplyStatus s); - - /// Extract the forward object reference from the - /// PortableInterceptor::ForwardRequest exception, and set the reply - /// status flag accordingly. - void forward_reference (PortableInterceptor::ForwardRequest &exc); - - /// Set the forward reference associated with the current - /// LOCATION_FORWARD reply. This method is only invoked when a - /// PortableServer::ForwardRequest exception is thrown by a servant - /// manager. - void forward_reference (CORBA::Object_ptr obj); - - //@} - - /// Return a reference to the underlying TAO_ServerRequest object. - TAO_ServerRequest &server_request (void); - -protected: - - /// Helper method to get the request and response service contexts. - IOP::ServiceContext *get_service_context_i ( - TAO_Service_Context &service_context_list, - IOP::ServiceId id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -protected: - - /// Underlying request object that contains much of the information - /// encapsulated by this TAO_ServerRequestInfo class. - TAO_ServerRequest &server_request_; + class ServerRequestInfo + : public virtual PortableInterceptor::ServerRequestInfo, + public virtual CORBA::LocalObject + { + public: + + /// Constructor. + ServerRequestInfo (TAO_ServerRequest & server_request, + TAO::Argument * const * args, + size_t nargs, + void * servant_upcall, + CORBA::TypeCode_ptr const exceptions[], + size_t nexceptions); + + /// Return an ID unique to the current request. This request ID may + /// or may not be the same as the GIOP request ID. + virtual CORBA::ULong request_id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the operation name for the current request. + virtual char * operation (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the list of arguments passed to the current operation. + virtual Dynamic::ParameterList * arguments ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the list of exceptions the current operation is capable + /// of throwing. + virtual Dynamic::ExceptionList * exceptions ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual Dynamic::ContextList * contexts ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual Dynamic::RequestContext * operation_context ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the result of the current request. If there is no + /// return value then an @c Any with @c tk_void @c TypeCode is + /// returned. This method is not valid for oneway operations. + virtual CORBA::Any * result ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Returns @c true for a two-way operation, and @c false otherwise. + virtual CORBA::Boolean response_expected ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the @c sync_scope policy value for the current one-way + /// operation. If the operation is not a one-way, a + /// @c CORBA::BAD_INV_ORDER exception is thrown. + virtual Messaging::SyncScope sync_scope ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the reply status for the current request. + /** + * Statuses can be @c PortableInterceptor::SUCCESSFUL, + * @c SYSTEM_EXCEPTION, @c USER_EXCEPTION, @c LOCATION_FORWARD, + * @c LOCATION_FORWARD_PERMANENT, @c TRANSPORT_RETRY. + */ + virtual PortableInterceptor::ReplyStatus reply_status ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// If the reply status is + /// @c PortableInterceptor::LOCATION_FORWARD or + /// @c PortableInterceptor::LOCATION_FORWARD_PERMANENT, return the + /// object reference to which the request was forwarded. + virtual CORBA::Object_ptr forward_reference ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)) ; + + /// Retrieve data from the "request scope" @c PICurrent object. + virtual CORBA::Any * get_slot ( + PortableInterceptor::SlotId id + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::InvalidSlot)); + + /// Return the @c IOP::ServiceContext with the given + /// @c IOP::ServiceId from the request service context list. + virtual IOP::ServiceContext * get_request_service_context ( + IOP::ServiceId id + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the @c IOP::ServiceContext with the given + /// @c IOP::ServiceId from the reply service context list. + virtual IOP::ServiceContext * get_reply_service_context ( + IOP::ServiceId id + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return an @c Any containing the exception being sent, if any. + /// Otherwise, throw a @c CORBA::BAD_INV_ORDER exception. + /** + * @note There is no trivial way to extract the exception from an + * @c Any. + */ + virtual CORBA::Any * sending_exception ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the @c ObjectId for the target object. + virtual PortableInterceptor::ObjectId * object_id ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the @c AdapterId for the POA handling the current + /// request. + virtual CORBA::OctetSeq * adapter_id ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the server_id of the server. The value is passed to + /// the ORB via @c -ORBServerId parameter. + virtual char * server_id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the ORBId value that is passed to the @c ORB_init + /// call. + virtual char * orb_id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the name of the object adapter that services requests + /// for the invoked object. + virtual PortableInterceptor::AdapterName * adapter_name ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the most derived interface of the target object. + virtual char * target_most_derived_interface ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Return the policy of the given type in effect for the current + /// request. + virtual CORBA::Policy_ptr get_server_policy ( + CORBA::PolicyType type + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Insert data into the "request scope" @c PICurrent object. + virtual void set_slot (PortableInterceptor::SlotId id, + const CORBA::Any & data + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + PortableInterceptor::InvalidSlot)); + + /// Returns true if the target's type corresponds to the given + /// @c RepositoryId. + virtual CORBA::Boolean target_is_a (const char * id + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Add the @c IOP::ServiceContext to the reply (outgoing) + /// @c IOP::ServiceContextList. + virtual void add_reply_service_context ( + const IOP::ServiceContext & service_context, + CORBA::Boolean replace + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + public: + + /** + * @name Helper methods specific to TAO. + */ + //@{ + + /// Change the exception status. + void exception (CORBA::Exception *exception); + + /// Set the status of the received reply. + void reply_status (PortableInterceptor::ReplyStatus s); + + /// Extract the forward object reference from the + /// @c PortableInterceptor::ForwardRequest exception, and set the + /// reply status flag accordingly. + void forward_reference (PortableInterceptor::ForwardRequest &exc); + + /// Set the forward reference associated with the current + /// LOCATION_FORWARD reply. + /** + * @note This method is only invoked when a + * @c PortableServer::ForwardRequest exception is thrown by a + * servant manager. + */ + void forward_reference (CORBA::Object_ptr obj); + + //@} + + /// Return a reference to the underlying @c TAO_ServerRequest + /// object. + TAO_ServerRequest &server_request (void); + + protected: + + /// Helper method to get the request and response service + /// contexts. + IOP::ServiceContext * get_service_context_i ( + TAO_Service_Context & service_context_list, + IOP::ServiceId id + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + + /// Underlying request object that contains much of the + /// information encapsulated by this @c ServerRequestInfo + /// implementation. + TAO_ServerRequest & server_request_; + + /// Operation argument list. + TAO::Argument * const * const args_; + + /// Number of element in the operation argument list. + size_t const nargs_; + + /// Pointer to the @c Servant_Upcall object that contains the + /// object ID, among other things. + TAO::Portable_Server::Servant_Upcall * const servant_upcall_; + + /// Array of @c TypeCodes for user exceptions the operation is + /// capable of raising. + CORBA::TypeCode_ptr const * const exceptions_; + + /// The number of elements in the @c exceptions_ array. + size_t const nexceptions_; - /// Pointer to the Servant_Upcall object that contains the object - /// ID, among other things. - TAO::Portable_Server::Servant_Upcall *servant_upcall_; + /// Pointer to the caught exception. + CORBA::Exception * caught_exception_; + + /// Reply status for the current request. + PortableInterceptor::ReplyStatus reply_status_; + + }; - /// Pointer to the caught exception. - CORBA::Exception *caught_exception_; +} // End namespace TAO - /// Reply status for the current request. - PortableInterceptor::ReplyStatus reply_status_; -}; # if defined (__ACE_INLINE__) # include "ServerRequestInfo.inl" diff --git a/TAO/tao/PortableServer/ServerRequestInfo.inl b/TAO/tao/PortableServer/ServerRequestInfo.inl index c3a98809fd1..838b5d3fc8b 100644 --- a/TAO/tao/PortableServer/ServerRequestInfo.inl +++ b/TAO/tao/PortableServer/ServerRequestInfo.inl @@ -2,8 +2,31 @@ // // $Id$ +#include "tao/PortableServer/Servant_Upcall.h" + + +ACE_INLINE +TAO::ServerRequestInfo::ServerRequestInfo ( + TAO_ServerRequest & server_request, + TAO::Argument * const * args, + size_t nargs, + void * servant_upcall, + CORBA::TypeCode_ptr const exceptions[], + size_t nexceptions) + : server_request_ (server_request) + , args_ (args) + , nargs_ (nargs) + , servant_upcall_ ( + static_cast<TAO::Portable_Server::Servant_Upcall *> (servant_upcall)) + , exceptions_ (exceptions) + , nexceptions_ (nexceptions) + , caught_exception_ (0) + , reply_status_ (-1) +{ +} + ACE_INLINE void -TAO_ServerRequestInfo::exception (CORBA::Exception *exception) +TAO::ServerRequestInfo::exception (CORBA::Exception * exception) { if (CORBA::SystemException::_downcast (exception) != 0) this->reply_status_ = PortableInterceptor::SYSTEM_EXCEPTION; @@ -16,13 +39,13 @@ TAO_ServerRequestInfo::exception (CORBA::Exception *exception) } ACE_INLINE void -TAO_ServerRequestInfo::reply_status (PortableInterceptor::ReplyStatus s) +TAO::ServerRequestInfo::reply_status (PortableInterceptor::ReplyStatus s) { this->reply_status_ = s; } ACE_INLINE void -TAO_ServerRequestInfo::forward_reference ( +TAO::ServerRequestInfo::forward_reference ( PortableInterceptor::ForwardRequest &exc) { // Note that we're converting the ForwardRequest exception in to a @@ -35,7 +58,7 @@ TAO_ServerRequestInfo::forward_reference ( } ACE_INLINE void -TAO_ServerRequestInfo::forward_reference (CORBA::Object_ptr obj) +TAO::ServerRequestInfo::forward_reference (CORBA::Object_ptr obj) { // We only get here if a servant manager threw a // PortableServer::ForwardRequest exception. @@ -47,7 +70,7 @@ TAO_ServerRequestInfo::forward_reference (CORBA::Object_ptr obj) } ACE_INLINE TAO_ServerRequest & -TAO_ServerRequestInfo::server_request (void) +TAO::ServerRequestInfo::server_request (void) { return this->server_request_; } diff --git a/TAO/tao/Special_Basic_SArgument_T.cpp b/TAO/tao/PortableServer/Special_Basic_SArgument_T.cpp index c997f057d98..515032f91a2 100644 --- a/TAO/tao/Special_Basic_SArgument_T.cpp +++ b/TAO/tao/PortableServer/Special_Basic_SArgument_T.cpp @@ -1,18 +1,15 @@ // $Id$ -#ifndef TAO_SPECIAL_BASIC_SARGUMENT_T_C -#define TAO_SPECIAL_BASIC_SARGUMENT_T_C +#ifndef TAO_SPECIAL_BASIC_SARGUMENT_T_CPP +#define TAO_SPECIAL_BASIC_SARGUMENT_T_CPP -#include "tao/Special_Basic_SArgument_T.h" +#include "tao/PortableServer/Special_Basic_SArgument_T.h" #include "tao/Dynamic_ParameterC.h" #if !defined (__ACE_INLINE__) -#include "tao/Special_Basic_SArgument_T.inl" +#include "tao/PortableServer/Special_Basic_SArgument_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID (tao, - Special_Basic_SArgument_T, - "$Id$") // ============================================================ @@ -122,5 +119,4 @@ TAO::Ret_Special_Basic_SArgument_T<S,to_S,from_S>::interceptor_result ( #endif /* TAO_HAS_INTERCEPTORS */ -#endif /* TAO_SPECIAL_BASIC_SARGUMENT_T_C */ - +#endif /* TAO_SPECIAL_BASIC_SARGUMENT_T_CPP */ diff --git a/TAO/tao/Special_Basic_SArgument_T.h b/TAO/tao/PortableServer/Special_Basic_SArgument_T.h index fcd4254358c..e9ae2bee3b3 100644 --- a/TAO/tao/Special_Basic_SArgument_T.h +++ b/TAO/tao/PortableServer/Special_Basic_SArgument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -6,7 +6,7 @@ * * $Id$ * - * @authors Jeff Parsons and Carlos O'Ryan + * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman */ //============================================================================= @@ -16,12 +16,12 @@ #include /**/ "ace/pre.h" +#include "tao/Argument.h" + #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/Argument.h" - namespace TAO { /** @@ -31,7 +31,7 @@ namespace TAO * */ template<typename S, typename to_S, typename from_S> - class TAO_Export In_Special_Basic_SArgument_T : public Argument + class In_Special_Basic_SArgument_T : public Argument { public: In_Special_Basic_SArgument_T (void); @@ -40,7 +40,7 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - S arg (void) const; + S const & arg (void) const; private: S x_; @@ -53,7 +53,7 @@ namespace TAO * */ template<typename S, typename to_S, typename from_S> - class TAO_Export Inout_Special_Basic_SArgument_T : public Argument + class Inout_Special_Basic_SArgument_T : public Argument { public: Inout_Special_Basic_SArgument_T (void); @@ -76,7 +76,7 @@ namespace TAO * */ template<typename S, typename to_S, typename from_S> - class TAO_Export Out_Special_Basic_SArgument_T : public Argument + class Out_Special_Basic_SArgument_T : public Argument { public: Out_Special_Basic_SArgument_T (void); @@ -98,7 +98,7 @@ namespace TAO * */ template<typename S, typename to_S, typename from_S> - class TAO_Export Ret_Special_Basic_SArgument_T : public Argument + class Ret_Special_Basic_SArgument_T : public Argument { public: Ret_Special_Basic_SArgument_T (void); @@ -121,7 +121,7 @@ namespace TAO * */ template<typename T, typename to_T, typename from_T> - struct TAO_Export Special_Basic_SArg_Traits_T + struct Special_Basic_SArg_Traits_T { typedef T ret_type; typedef T in_type; @@ -132,15 +132,23 @@ namespace TAO typedef Inout_Special_Basic_SArgument_T<T,to_T,from_T> inout_arg_val; typedef Out_Special_Basic_SArgument_T<T,to_T,from_T> out_arg_val; typedef Ret_Special_Basic_SArgument_T<T,to_T,from_T> ret_val; + + // Typedefs corresponding to return value of arg() method in both + // the client and server side argument class templates. + typedef T const & in_arg_type; + typedef inout_type inout_arg_type; + typedef out_type out_arg_type; + typedef out_type ret_arg_type; + }; }; #if defined (__ACE_INLINE__) -#include "tao/Special_Basic_SArgument_T.inl" +#include "tao/PortableServer/Special_Basic_SArgument_T.inl" #endif /* __ACE_INLINE__ */ #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/Special_Basic_SArgument_T.cpp" +#include "tao/PortableServer/Special_Basic_SArgument_T.cpp" #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) diff --git a/TAO/tao/Special_Basic_SArgument_T.inl b/TAO/tao/PortableServer/Special_Basic_SArgument_T.inl index f6a161f7d09..a0fd902d4fd 100644 --- a/TAO/tao/Special_Basic_SArgument_T.inl +++ b/TAO/tao/PortableServer/Special_Basic_SArgument_T.inl @@ -1,3 +1,5 @@ +// -*- C++ -*- +// // $Id$ template<typename S, typename to_S, typename from_S> @@ -8,7 +10,7 @@ In_Special_Basic_SArgument_T (void) template<typename S, typename to_S, typename from_S> ACE_INLINE -S +S const & TAO::In_Special_Basic_SArgument_T<S,to_S,from_S>::arg (void) const { return this->x_; diff --git a/TAO/tao/Special_Basic_SArguments.cpp b/TAO/tao/PortableServer/Special_Basic_SArguments.cpp index ece6387e035..70f5f0c0eb6 100644 --- a/TAO/tao/Special_Basic_SArguments.cpp +++ b/TAO/tao/PortableServer/Special_Basic_SArguments.cpp @@ -1,8 +1,8 @@ // $Id$ -#include "tao/Special_Basic_SArguments.h" +#include "Special_Basic_SArguments.h" -ACE_RCSID (tao, +ACE_RCSID (PortableServer, Special_Basic_SArguments, "$Id$") diff --git a/TAO/tao/Special_Basic_SArguments.h b/TAO/tao/PortableServer/Special_Basic_SArguments.h index 6ecfb99b52f..b334c347597 100644 --- a/TAO/tao/Special_Basic_SArguments.h +++ b/TAO/tao/PortableServer/Special_Basic_SArguments.h @@ -15,14 +15,18 @@ #define TAO_SPECIAL_BASIC_SARGUMENTS_H #include /**/ "ace/pre.h" -#include "ace/CDR_Stream.h" + +#include "tao/PortableServer/portableserver_export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/Special_Basic_SArgument_T.h" -#include "Arg_Traits_T.h" +#include "tao/PortableServer/Special_Basic_SArgument_T.h" +#include "tao/Arg_Traits_T.h" + +#include "ace/CDR_Stream.h" + namespace TAO { @@ -33,7 +37,7 @@ namespace TAO */ template<> - class TAO_Export SArg_Traits<ACE_InputCDR::to_char> + class TAO_PortableServer_Export SArg_Traits<ACE_InputCDR::to_char> : public Special_Basic_SArg_Traits_T<CORBA::Char, ACE_InputCDR::to_char, ACE_OutputCDR::from_char> @@ -41,7 +45,7 @@ namespace TAO }; template<> - class TAO_Export SArg_Traits<ACE_InputCDR::to_wchar> + class TAO_PortableServer_Export SArg_Traits<ACE_InputCDR::to_wchar> : public Special_Basic_SArg_Traits_T<CORBA::WChar, ACE_InputCDR::to_wchar, ACE_OutputCDR::from_wchar> @@ -49,7 +53,7 @@ namespace TAO }; template<> - class TAO_Export SArg_Traits<ACE_InputCDR::to_octet> + class TAO_PortableServer_Export SArg_Traits<ACE_InputCDR::to_octet> : public Special_Basic_SArg_Traits_T<CORBA::Octet, ACE_InputCDR::to_octet, ACE_OutputCDR::from_octet> @@ -57,7 +61,7 @@ namespace TAO }; template<> - class TAO_Export SArg_Traits<ACE_InputCDR::to_boolean> + class TAO_PortableServer_Export SArg_Traits<ACE_InputCDR::to_boolean> : public Special_Basic_SArg_Traits_T<CORBA::Boolean, ACE_InputCDR::to_boolean, ACE_OutputCDR::from_boolean> diff --git a/TAO/tao/PortableServer/TypeCode_SArg_Traits.h b/TAO/tao/PortableServer/TypeCode_SArg_Traits.h new file mode 100644 index 00000000000..5a40a393b43 --- /dev/null +++ b/TAO/tao/PortableServer/TypeCode_SArg_Traits.h @@ -0,0 +1,56 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file TypeCode_SArg_Traits.h + * + * $Id$ + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_TYPECODE_SARG_TRAITS_H +#define TAO_TYPECODE_SARG_TRAITS_H + +#include /**/ "ace/pre.h" + +#include "tao/CORBA_methods.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PortableServer/Object_SArgument_T.h" +#include "tao/Pseudo_VarOut_T.h" + + +namespace CORBA +{ + class TypeCode; + typedef TypeCode *TypeCode_ptr; + + typedef TAO_Pseudo_Var_T<TypeCode> TypeCode_var; + typedef TAO_Pseudo_Out_T<TypeCode, TypeCode_var> TypeCode_out; +} + +// -------------------------------------------------------------- + +namespace TAO +{ + template <typename T> class SArg_Traits; + + /// Used in generated code if CORBA::TypeCode is an argument or + /// return type. + ACE_TEMPLATE_SPECIALIZATION + class TAO_PortableServer_Export SArg_Traits<CORBA::TypeCode> + : public Object_SArg_Traits_T<CORBA::TypeCode_ptr, + CORBA::TypeCode_var, + CORBA::TypeCode_out> + { + }; +} + +#include /**/ "ace/post.h" + +#endif /* TAO_TYPECODE_SARG_TRAITS_H */ diff --git a/TAO/tao/UB_String_SArgument_T.cpp b/TAO/tao/PortableServer/UB_String_SArgument_T.cpp index 04844f9fea0..d73fa550b34 100644 --- a/TAO/tao/UB_String_SArgument_T.cpp +++ b/TAO/tao/PortableServer/UB_String_SArgument_T.cpp @@ -1,18 +1,15 @@ // $Id$ -#ifndef TAO_UB_STRING_SARGUMENT_T_C -#define TAO_UB_STRING_SARGUMENT_T_C +#ifndef TAO_UB_STRING_SARGUMENT_T_CPP +#define TAO_UB_STRING_SARGUMENT_T_CPP -#include "tao/UB_String_SArgument_T.h" +#include "tao/PortableServer/UB_String_SArgument_T.h" #include "tao/Dynamic_ParameterC.h" #if !defined (__ACE_INLINE__) -#include "tao/UB_String_SArgument_T.inl" +#include "tao/PortableServer/UB_String_SArgument_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID (tao, - UB_String_SArgument_T, - "$Id$") template<typename S, typename S_var> CORBA::Boolean @@ -108,4 +105,4 @@ TAO::Ret_UB_String_SArgument_T<S,S_var>::interceptor_result (CORBA::Any * any) #endif /* TAO_HAS_INTERCEPTORS */ -#endif /* TAO_UB_STRING_SARGUMENT_T_C */ +#endif /* TAO_UB_STRING_SARGUMENT_T_CPP */ diff --git a/TAO/tao/UB_String_SArgument_T.h b/TAO/tao/PortableServer/UB_String_SArgument_T.h index f6e2d0f6297..3f3faeaa299 100644 --- a/TAO/tao/UB_String_SArgument_T.h +++ b/TAO/tao/PortableServer/UB_String_SArgument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -6,7 +6,7 @@ * * $Id$ * - * @authors Jeff Parsons and Carlos O'Ryan + * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman */ //============================================================================= @@ -14,6 +14,7 @@ #define TAO_UB_STRING_SARGUMENT_T_H #include /**/ "ace/pre.h" + #include "tao/Argument.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -38,7 +39,7 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - const S * arg (void) const; + S const * arg (void) const; private: S_var x_; @@ -129,15 +130,23 @@ namespace TAO typedef Inout_UB_String_SArgument_T<T,T_var> inout_arg_val; typedef Out_UB_String_SArgument_T<T,T_var> out_arg_val; typedef Ret_UB_String_SArgument_T<T,T_var> ret_val; + + // Typedefs corresponding to return value of arg() method in both + // the client and server side argument class templates. + typedef in_type in_arg_type; + typedef inout_type inout_arg_type; + typedef inout_type out_arg_type; + typedef inout_type ret_arg_type; + }; }; #if defined (__ACE_INLINE__) -#include "tao/UB_String_SArgument_T.inl" +#include "tao/PortableServer/UB_String_SArgument_T.inl" #endif /* __ACE_INLINE__ */ #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/UB_String_SArgument_T.cpp" +#include "tao/PortableServer/UB_String_SArgument_T.cpp" #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) diff --git a/TAO/tao/UB_String_SArgument_T.inl b/TAO/tao/PortableServer/UB_String_SArgument_T.inl index daf8637012c..daf8637012c 100644 --- a/TAO/tao/UB_String_SArgument_T.inl +++ b/TAO/tao/PortableServer/UB_String_SArgument_T.inl diff --git a/TAO/tao/UB_String_SArguments.cpp b/TAO/tao/PortableServer/UB_String_SArguments.cpp index 217b9143790..ccc5b449a7e 100644 --- a/TAO/tao/UB_String_SArguments.cpp +++ b/TAO/tao/PortableServer/UB_String_SArguments.cpp @@ -1,8 +1,8 @@ // $Id$ -#include "tao/UB_String_SArguments.h" +#include "UB_String_SArguments.h" -ACE_RCSID (tao, +ACE_RCSID (PortableServer, Special_Basic_SArguments, "$Id$") @@ -11,10 +11,10 @@ ACE_RCSID (tao, template class TAO::SArg_Traits<CORBA::String>; template class TAO::SArg_Traits<CORBA::WString>; -template class TAO::UB_String_SArg_Traits_T<CORBA::Char, - CORBA::String_var, +template class TAO::UB_String_SArg_Traits_T<CORBA::Char, + CORBA::String_var, CORBA::String_out>; -template class TAO::UB_String_SArg_Traits_T<CORBA::WChar, +template class TAO::UB_String_SArg_Traits_T<CORBA::WChar, CORBA::WString_var, CORBA::WString_out>; diff --git a/TAO/tao/UB_String_SArguments.h b/TAO/tao/PortableServer/UB_String_SArguments.h index 1a2ee106a1a..d70ebf0e941 100644 --- a/TAO/tao/UB_String_SArguments.h +++ b/TAO/tao/PortableServer/UB_String_SArguments.h @@ -15,12 +15,13 @@ #include /**/ "ace/pre.h" -#include "tao/UB_String_SArgument_T.h" +#include "tao/PortableServer/portableserver_export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/PortableServer/UB_String_SArgument_T.h" #include "tao/Arg_Traits_T.h" namespace TAO @@ -32,7 +33,7 @@ namespace TAO */ template<> - class TAO_Export SArg_Traits<CORBA::Char *> + class TAO_PortableServer_Export SArg_Traits<CORBA::Char *> : public UB_String_SArg_Traits_T<CORBA::Char, CORBA::String_var, CORBA::String_out> @@ -40,7 +41,7 @@ namespace TAO }; template<> - class TAO_Export SArg_Traits<CORBA::WChar *> + class TAO_PortableServer_Export SArg_Traits<CORBA::WChar *> : public UB_String_SArg_Traits_T<CORBA::WChar, CORBA::WString_var, CORBA::WString_out> diff --git a/TAO/tao/PortableServer/Upcall_Command.h b/TAO/tao/PortableServer/Upcall_Command.h new file mode 100644 index 00000000000..be65d5b2349 --- /dev/null +++ b/TAO/tao/PortableServer/Upcall_Command.h @@ -0,0 +1,54 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Upcall_Command.h + * + * $Id$ + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_UPCALL_COMMAND_H +#define TAO_UPCALL_COMMAND_H + +#include /**/ "ace/pre.h" + +#include "ace/CORBA_macros.h" + +#ifndef ACE_LACKS_PRAGMA_ONCE +# pragma once +#endif /* !ACE_LACKS_PRAGMA_ONCE */ + + +namespace TAO +{ + + /** + * @class Upcall_Command + * + * @brief "ABC" that all operation-specific command objects must + * subclass. + * + * The actual upcall into a servant is executed through a concrete + * @c Upcall_Command object. This is necessary to simplify upcall + * interactions in the presence of interceptors, such as when the + * @c send_exception() interception point must be invoked when the + * servant operation throws an exception. + */ + class Upcall_Command + { + public: + + /// Execute the upcall. + virtual void execute (ACE_ENV_SINGLE_ARG_DECL) = 0; + + }; + +} // End namespace TAO + + +#include /**/ "ace/post.h" + +#endif /* TAO_UPCALL_COMMAND_H */ diff --git a/TAO/tao/PortableServer/Upcall_Wrapper.cpp b/TAO/tao/PortableServer/Upcall_Wrapper.cpp new file mode 100644 index 00000000000..d5ecfac2d19 --- /dev/null +++ b/TAO/tao/PortableServer/Upcall_Wrapper.cpp @@ -0,0 +1,215 @@ +// $Id$ + +#include "Upcall_Wrapper.h" + +#include "Upcall_Command.h" + +#if TAO_HAS_INTERCEPTORS == 1 +# include "PICurrent_Guard.h" + +# include "tao/PortableInterceptor.h" +# include "tao/PortableServer/ServerRequestInfo.h" +# include "tao/PortableServer/ServerInterceptorAdapter.h" + +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + +#include "tao/TAO_Server_Request.h" +#include "tao/CDR.h" + + +ACE_RCSID (PortableServer, + Upcall_Wrapper, + "$Id$") + + +void +TAO::Upcall_Wrapper::upcall (TAO_ServerRequest & server_request, + TAO::Argument * const args[], + size_t nargs, + TAO::Upcall_Command & command + +#if TAO_HAS_INTERCEPTORS == 1 + , void * servant_upcall + , CORBA::TypeCode_ptr const exceptions[] + , size_t nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + + ACE_ENV_ARG_DECL + ) +{ + if (server_request.incoming ()) + { + this->pre_upcall (*server_request.incoming (), + args, + nargs + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + +#if TAO_HAS_INTERCEPTORS == 1 + + TAO::ServerRequestInfo request_info (server_request, + args, + nargs, + servant_upcall, + exceptions, + nexceptions); + + TAO::ServerRequestInterceptor_Adapter interceptor_adapter (server_request); + + ACE_TRY + { + TAO::PICurrent_Guard pi_guard (server_request, + true /* Copy TSC to RSC */); + + // Invoke intermediate server side interception points. + interceptor_adapter.receive_request (&request_info + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // Don't bother performing the upcall if an interceptor caused a + // location forward. + if (!interceptor_adapter.location_forwarded ()) + { +#endif /* TAO_HAS_INTERCEPTORS */ + + // The actual upcall. + command.execute (ACE_ENV_SINGLE_ARG_PARAMETER); + TAO_INTERCEPTOR_CHECK; + +#if TAO_HAS_INTERCEPTORS == 1 + } + + // Do not execute the send_reply() interception point if an + // interceptor caused a location forward. The send_other() + // interception point should already have been executed by the + // ServerRequestInterceptor_Adapter object. + // + // It should actually be safe to call this interception point, + // regardless, since the interceptor flow stack should have been + // emptied by the send_other() interception point. Note that + // we'd still need to avoid resetting the reply status to + // SUCCESSFUL, however. + if (!interceptor_adapter.location_forwarded ()) + { + // No location forward by interceptors and successful upcall. + + request_info.reply_status (PortableInterceptor::SUCCESSFUL); + interceptor_adapter.send_reply (&request_info + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + } + ACE_CATCHANY + { + request_info.exception (&ACE_ANY_EXCEPTION); + interceptor_adapter.send_exception (&request_info + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + PortableInterceptor::ReplyStatus status = + request_info.reply_status (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (status == PortableInterceptor::SYSTEM_EXCEPTION + || status == PortableInterceptor::USER_EXCEPTION) + { + ACE_RE_THROW; + } + } +# if defined (ACE_HAS_EXCEPTIONS) \ + && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS) + ACE_CATCHALL + { + CORBA::UNKNOWN ex; + + request_info.exception (&ex); + interceptor_adapter.send_exception (&request_info + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + PortableInterceptor::ReplyStatus status = + request_info.reply_status (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (status == PortableInterceptor::SYSTEM_EXCEPTION) + ACE_TRY_THROW (ex); + } +# endif /* ACE_HAS_EXCEPTIONS && ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS */ + ACE_ENDTRY; + ACE_CHECK; +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + + if (server_request.response_expected () + && !server_request.sync_with_server ()) + { + server_request.init_reply (); + } + +#if TAO_HAS_INTERCEPTORS == 1 + // Don't bother marshaling inout/out/return values if an interceptor + // caused a location forward. + if (!interceptor_adapter.location_forwarded ()) +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + { + if (server_request.outgoing ()) + { + this->post_upcall (*server_request.outgoing (), + args, + nargs + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + } +} + +void +TAO::Upcall_Wrapper::pre_upcall (TAO_InputCDR & cdr, + TAO::Argument * const * args, + size_t nargs + ACE_ENV_ARG_DECL) +{ + // Demarshal the operation "in" and "inout" arguments, if any. + + // NOTE: The TAO::Argument corresponding to the return value is + // always the first element in the array, regardless of + // whether or not the return type is void. + + ACE_ASSERT (nargs != 0); + + TAO::Argument * const * const begin = args + 1; // Skip the return value. + TAO::Argument * const * const end = args + nargs; + + for (TAO::Argument * const * i = begin; i != end; ++i) + { + if (!(*i)->demarshal (cdr)) + { + TAO_InputCDR::throw_skel_exception (errno + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + } +} + +void +TAO::Upcall_Wrapper::post_upcall (TAO_OutputCDR & cdr, + TAO::Argument * const * args, + size_t nargs + ACE_ENV_ARG_DECL) +{ + // Marshal the operation "inout" and "out" arguments and return + // value, if any. + + TAO::Argument * const * const begin = args; + TAO::Argument * const * const end = args + nargs; + + for (TAO::Argument * const * i = begin; i != end; ++i) + { + if (!(*i)->marshal (cdr)) + { + TAO_OutputCDR::throw_skel_exception (errno + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + } +} diff --git a/TAO/tao/PortableServer/Upcall_Wrapper.h b/TAO/tao/PortableServer/Upcall_Wrapper.h index 1ac32dc06ee..f7c612e54fa 100644 --- a/TAO/tao/PortableServer/Upcall_Wrapper.h +++ b/TAO/tao/PortableServer/Upcall_Wrapper.h @@ -1,4 +1,4 @@ -/* -*- C++ -*- */ +// -*- C++ -*- //============================================================================= /** @@ -6,6 +6,7 @@ * * $Id$ * + * @author Ossama Othman * @author Jeff Parsons * @author Carlos O'Ryan */ @@ -18,52 +19,105 @@ #include "portableserver_export.h" -#if !defined (ACE_LACKS_PRAGMA_ONCE) +#ifndef ACE_LACKS_PRAGMA_ONCE # pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ +#endif /* !ACE_LACKS_PRAGMA_ONCE */ -#include "ServerInterceptorAdapter.h" -#include "tao/SArgument_T.h" -#include "tao/TAO_Server_Request.h" +#include "tao/Basic_Types.h" +#include "tao/orbconf.h" +#include "ace/CORBA_macros.h" -/** - * @class TAO_Upcall_Wrapper - * - * @brief Wraps the activities of the _skel operations. - * - */ -class TAO_PortableServer_Export TAO_Upcall_Wrapper + +class TAO_ServantBase; +class TAO_ServerRequest; +class TAO_InputCDR; +class TAO_OutputCDR; + +namespace PortableServer { -public: - TAO_Upcall_Wrapper (TAO::SArgument * _tao_arguments, - size_t nargs, - TAO::SArgument * _tao_retval, - TAO_ServerRequest * _tao_server_request, - void * _tao_servant_upcall) - : arglist_ (_tao_arguments), - nargs_ (nargs), - retval (_tao_retval), - tao_server_request (_tao_server_request), - servant_upcall_ (_tao_servant_upcall) - {} - - virtual ~TAO_Upcall_Wrapper (void); - - void pre_upcall (void) - { - } + typedef ::TAO_ServantBase ServantBase; +} + - void post_upcall (void) +namespace TAO +{ + class Argument; + class Upcall_Command; + + /** + * @class Upcall_Wrapper + * + * @brief Wraps the activities of the _skel operations. + * + */ + class TAO_PortableServer_Export Upcall_Wrapper { - } - -private: - TAO::SArgument * arglist_; - size_t nargs_; - TAO::SArgument * retval_; - TAO_ServerRequest * tao_server_request_; - void * servant_upcall_; -}; + public: + + /** + * @note The TAO::Argument corresponding to the return value is + * always the first element in the array, regardless of + * whether or not the return type is void. + */ + + /// Perform the upcall. + /** + * @param server_request Object containing server side messaging + * operations (e.g. CDR reply construction, etc). + * @param args Operation argument list. + * @param nargs Number of arguments in the operation + * argument list. + * @param command @c Command object that performs the + * actual upcall into the servant. + * + * @param servant_upcall Object containing information for POA + * that dispatched the servant. + * @param servant The servant handling the upcall. + * @param exceptions Array of user exceptions the operation + * may raise. + * @param nexceptions The number of exceptions in the operation + * user exception array. + */ + void upcall (TAO_ServerRequest & server_request, + TAO::Argument * const args[], + size_t nargs, + TAO::Upcall_Command & command + +#if TAO_HAS_INTERCEPTORS == 1 + , void * servant_upcall + , CORBA::TypeCode_ptr const exceptions[] + , size_t nexceptions +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + + ACE_ENV_ARG_DECL); + + private: + + + /// Perform pre-upcall operations. + /** + * Perform pre-upcall operations, including operation @c IN and + * @c INOUT argument demarshaling. + */ + void pre_upcall (TAO_InputCDR & cdr, + TAO::Argument * const * args, + size_t nargs + ACE_ENV_ARG_DECL); + + /// Perform post-upcall operations. + /** + * Perform post-upcall operations, including operation @c INOUT + * and @c OUT argument marshaling. + */ + void post_upcall (TAO_OutputCDR & cdr, + TAO::Argument * const * args, + size_t nargs + ACE_ENV_ARG_DECL); + + }; + +} // End namespace TAO + #include /**/ "ace/post.h" diff --git a/TAO/tao/Var_Array_SArgument_T.cpp b/TAO/tao/PortableServer/Var_Array_SArgument_T.cpp index 216b9071d74..3bf33ee7e48 100644 --- a/TAO/tao/Var_Array_SArgument_T.cpp +++ b/TAO/tao/PortableServer/Var_Array_SArgument_T.cpp @@ -1,36 +1,35 @@ // $Id$ -#ifndef TAO_VAR_ARRAY_SARGUMENT_T_C -#define TAO_VAR_ARRAY_SARGUMENT_T_C +#ifndef TAO_VAR_ARRAY_SARGUMENT_T_CPP +#define TAO_VAR_ARRAY_SARGUMENT_T_CPP -#include "tao/Var_Array_SArgument_T.h" +#include "tao/PortableServer/Var_Array_SArgument_T.h" #include "tao/Dynamic_ParameterC.h" #if !defined (__ACE_INLINE__) -#include "tao/Var_Array_SArgument_T.inl" +#include "tao/PortableServer/Var_Array_SArgument_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID (tao, - Var_Array_SArgument_T, - "$Id$") -template<typename S, typename S_forany> +template<typename S, typename S_slice, typename S_forany> CORBA::Boolean -TAO::In_Var_Array_SArgument_T<S,S_forany>::demarshal (TAO_InputCDR &cdr) +TAO::In_Var_Array_SArgument_T<S, + S_slice, + S_forany>::demarshal (TAO_InputCDR & cdr) { - S_forany tmp (this->x_); - return cdr >> tmp; + return cdr >> this->x_; } #if TAO_HAS_INTERCEPTORS == 1 -template<typename S, typename S_forany> +template<typename S, typename S_slice, typename S_forany> void -TAO::In_Var_Array_SArgument_T<S,S_forany>::interceptor_param ( - Dynamic::Parameter & p - ) +TAO::In_Var_Array_SArgument_T<S, + S_slice, + S_forany>::interceptor_param ( + Dynamic::Parameter & p) { - p.argument <<= S_forany (this->x_); + p.argument <<= this->x_; p.mode = CORBA::PARAM_IN; } @@ -38,30 +37,32 @@ TAO::In_Var_Array_SArgument_T<S,S_forany>::interceptor_param ( // =========================================================== -template<typename S, typename S_forany> +template<typename S, typename S_slice, typename S_forany> CORBA::Boolean -TAO::Inout_Var_Array_SArgument_T<S,S_forany>::marshal (TAO_OutputCDR & cdr) +TAO::Inout_Var_Array_SArgument_T<S, + S_slice, + S_forany>::marshal (TAO_OutputCDR & cdr) { - return cdr << S_forany (this->x_); + return cdr << this->x_; } -template<typename S, typename S_forany> +template<typename S, typename S_slice, typename S_forany> CORBA::Boolean -TAO::Inout_Var_Array_SArgument_T<S,S_forany>::demarshal (TAO_InputCDR & cdr) +TAO::Inout_Var_Array_SArgument_T<S, + S_slice, + S_forany>::demarshal (TAO_InputCDR & cdr) { - S_forany tmp (this->x_); - return cdr >> tmp; + return cdr >> this->x_; } #if TAO_HAS_INTERCEPTORS == 1 -template<typename S, typename S_forany> +template<typename S, typename S_slice, typename S_forany> void -TAO::Inout_Var_Array_SArgument_T<S,S_forany>::interceptor_param ( - Dynamic::Parameter & p - ) +TAO::Inout_Var_Array_SArgument_T<S, S_slice, S_forany>::interceptor_param ( + Dynamic::Parameter & p) { - p.argument <<= S_forany (this->x_); + p.argument <<= this->x_; p.mode = CORBA::PARAM_INOUT; } @@ -75,7 +76,7 @@ TAO::Out_Var_Array_SArgument_T<S_slice,S_var,S_forany>::marshal ( TAO_OutputCDR & cdr ) { - return cdr << S_forany (this->x_.ptr ()); + return cdr << this->x_.ptr (); } #if TAO_HAS_INTERCEPTORS == 1 @@ -116,4 +117,4 @@ TAO::Ret_Var_Array_SArgument_T<S_slice,S_var,S_forany>::interceptor_result ( #endif /* TAO_HAS_INTERCEPTORS */ -#endif /* TAO_VAR_ARRAY_SARGUMENT_T_C */ +#endif /* TAO_VAR_ARRAY_SARGUMENT_T_CPP */ diff --git a/TAO/tao/Var_Array_SArgument_T.h b/TAO/tao/PortableServer/Var_Array_SArgument_T.h index 70f5caad9fa..f8dd6e884e8 100644 --- a/TAO/tao/Var_Array_SArgument_T.h +++ b/TAO/tao/PortableServer/Var_Array_SArgument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -6,7 +6,7 @@ * * $Id$ * - * @authors Jeff Parsons and Carlos O'Ryan + * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman */ //============================================================================= @@ -14,6 +14,7 @@ #define TAO_VAR_ARRAY_SARGUMENT_T_H #include /**/ "ace/pre.h" + #include "tao/Argument.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -28,20 +29,21 @@ namespace TAO * @brief IN skeleton argument of variable size element array. * */ - template<typename S, typename S_forany> + template<typename S, typename S_slice, typename S_forany> class In_Var_Array_SArgument_T : public Argument { public: + In_Var_Array_SArgument_T (void); virtual CORBA::Boolean demarshal (TAO_InputCDR &); #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - const S & arg (void) const; + S_slice const * arg (void) const; private: - S x_; + S_forany x_; }; /** @@ -50,7 +52,7 @@ namespace TAO * @brief INOUT skeleton argument of variable size element array. * */ - template<typename S, typename S_forany> + template<typename S, typename S_slice, typename S_forany> class Inout_Var_Array_SArgument_T : public Argument { public: @@ -61,10 +63,10 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - S & arg (void); + S_slice * arg (void); private: - S x_; + S_forany x_; }; /** @@ -129,23 +131,35 @@ namespace TAO typedef T inout_type; typedef T_out out_type; - typedef In_Var_Array_SArgument_T<T,T_forany> in_arg_val; - typedef Inout_Var_Array_SArgument_T<T,T_forany> inout_arg_val; + typedef In_Var_Array_SArgument_T<T, + T_slice, + T_forany> in_arg_val; + typedef Inout_Var_Array_SArgument_T<T, + T_slice, + T_forany> inout_arg_val; typedef Out_Var_Array_SArgument_T<T_slice, T_var, T_forany> out_arg_val; typedef Ret_Var_Array_SArgument_T<T_slice, T_var, T_forany> ret_val; + + // Typedefs corresponding to return value of arg() method in both + // the client and server side argument class templates. + typedef T_slice const * in_arg_type; + typedef ret_type inout_arg_type; + typedef ret_type & out_arg_type; + typedef ret_type & ret_arg_type; + }; }; #if defined (__ACE_INLINE__) -#include "tao/Var_Array_SArgument_T.inl" +#include "tao/PortableServer/Var_Array_SArgument_T.inl" #endif /* __ACE_INLINE__ */ #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/Var_Array_SArgument_T.cpp" +#include "tao/PortableServer/Var_Array_SArgument_T.cpp" #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) diff --git a/TAO/tao/Var_Array_SArgument_T.inl b/TAO/tao/PortableServer/Var_Array_SArgument_T.inl index 74909b17512..58bf2c6dbb9 100644 --- a/TAO/tao/Var_Array_SArgument_T.inl +++ b/TAO/tao/PortableServer/Var_Array_SArgument_T.inl @@ -1,32 +1,41 @@ +// -*- C++ -*- +// // $Id$ -template<typename S, typename S_forany> +template<typename S, typename S_slice, typename S_forany> ACE_INLINE -TAO::In_Var_Array_SArgument_T<S,S_forany>::In_Var_Array_SArgument_T (void) +TAO::In_Var_Array_SArgument_T<S, + S_slice, + S_forany>::In_Var_Array_SArgument_T (void) {} -template<typename S, typename S_forany> +template<typename S, typename S_slice, typename S_forany> ACE_INLINE -const S & -TAO::In_Var_Array_SArgument_T<S,S_forany>::arg (void) const +S_slice const * +TAO::In_Var_Array_SArgument_T<S, + S_slice, + S_forany>::arg (void) const { - return this->x_; + return this->x_.in (); } // ========================================================================== -template<typename S, typename S_forany> +template<typename S, typename S_slice, typename S_forany> ACE_INLINE -TAO::Inout_Var_Array_SArgument_T<S,S_forany>:: -Inout_Var_Array_SArgument_T (void) +TAO::Inout_Var_Array_SArgument_T<S, + S_slice, + S_forany>::Inout_Var_Array_SArgument_T (void) {} -template<typename S, typename S_forany> -S & -TAO::Inout_Var_Array_SArgument_T<S,S_forany>::arg (void) +template<typename S, typename S_slice, typename S_forany> +S_slice * +TAO::Inout_Var_Array_SArgument_T<S, + S_slice, + S_forany>::arg (void) { - return this->x_; + return this->x_.inout (); } // ========================================================================== diff --git a/TAO/tao/Var_Size_SArgument_T.cpp b/TAO/tao/PortableServer/Var_Size_SArgument_T.cpp index 682b18ac6a3..d2e25bebae1 100644 --- a/TAO/tao/Var_Size_SArgument_T.cpp +++ b/TAO/tao/PortableServer/Var_Size_SArgument_T.cpp @@ -1,18 +1,15 @@ // $Id$ -#ifndef TAO_VAR_SIZE_SARGUMENT_T_C -#define TAO_VAR_SIZE_SARGUMENT_T_C +#ifndef TAO_VAR_SIZE_SARGUMENT_T_CPP +#define TAO_VAR_SIZE_SARGUMENT_T_CPP -#include "tao/Var_Size_SArgument_T.h" +#include "tao/PortableServer/Var_Size_SArgument_T.h" #include "tao/Dynamic_ParameterC.h" #if !defined (__ACE_INLINE__) -#include "tao/Var_Size_SArgument_T.inl" +#include "tao/PortableServer/Var_Size_SArgument_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID (tao, - Var_Size_SArgument_T, - "$Id$") template<typename S> CORBA::Boolean @@ -78,7 +75,7 @@ TAO::Out_Var_Size_SArgument_T<S,S_var>::interceptor_param ( Dynamic::Parameter & p ) { - p.argument <<= *this->x_; + p.argument <<= this->x_.in (); p.mode = CORBA::PARAM_OUT; } @@ -104,4 +101,4 @@ TAO::Ret_Var_Size_SArgument_T<S,S_var>::interceptor_result (CORBA::Any * any) #endif /* TAO_HAS_INTERCEPTORS */ -#endif /* TAO_VAR_SIZE_SARGUMENT_T_C */ +#endif /* TAO_VAR_SIZE_SARGUMENT_T_CPP */ diff --git a/TAO/tao/PortableServer/Var_Size_SArgument_T.h b/TAO/tao/PortableServer/Var_Size_SArgument_T.h new file mode 100644 index 00000000000..d135d1815a9 --- /dev/null +++ b/TAO/tao/PortableServer/Var_Size_SArgument_T.h @@ -0,0 +1,157 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Var_Size_SArgument_T.h + * + * $Id$ + * + * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman + */ +//============================================================================= + +#ifndef TAO_VAR_SIZE_SARGUMENT_T_H +#define TAO_VAR_SIZE_SARGUMENT_T_H + +#include /**/ "ace/pre.h" +#include "tao/Argument.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace TAO +{ + /** + * @class In_Var_Size_SArgument_T + * + * @brief Template class for IN skeleton argument of fixed size IDL types. + * + */ + template<typename S> + class In_Var_Size_SArgument_T : public Argument + { + public: + + virtual CORBA::Boolean demarshal (TAO_InputCDR &); +#if TAO_HAS_INTERCEPTORS == 1 + virtual void interceptor_param (Dynamic::Parameter &); +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + S const & arg (void) const; + + private: + S * x_; + }; + + /** + * @class Inout_Var_Size_SArgument_T + * + * @brief Template class for INOUT skeleton arg of fixed size IDL types. + * + */ + template<typename S> + class Inout_Var_Size_SArgument_T : public Argument + { + public: + Inout_Var_Size_SArgument_T (void); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); + virtual CORBA::Boolean demarshal (TAO_InputCDR &); +#if TAO_HAS_INTERCEPTORS == 1 + virtual void interceptor_param (Dynamic::Parameter &); +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + S & arg (void); + + private: + S * x_; + }; + + /** + * @class Out_Var_Size_SArgument_T + * + * @brief Template class for OUT skeleton argument of fixed size IDL types. + * + */ + template<typename S, typename S_var> + class Out_Var_Size_SArgument_T : public Argument + { + public: + Out_Var_Size_SArgument_T (void); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); +#if TAO_HAS_INTERCEPTORS == 1 + virtual void interceptor_param (Dynamic::Parameter &); +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + S *& arg (void); + + private: + S_var x_; + }; + + /** + * @class Ret_Var_Size_SArgument_T + * + * @brief Template class for return skeleton value of fixed size IDL types. + * + */ + template<typename S, typename S_var> + class Ret_Var_Size_SArgument_T : public Argument + { + public: + Ret_Var_Size_SArgument_T (void); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); +#if TAO_HAS_INTERCEPTORS == 1 + virtual void interceptor_result (CORBA::Any *); +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + S *& arg (void); + + private: + S_var x_; + }; + + /** + * @struct Basic_SArg_Traits_T + * + * @brief Template class for skeleton argument traits of + * variable size IDL types. + * + */ + template<typename T, typename T_var, typename T_out> + struct Var_Size_SArg_Traits_T + { + typedef T * ret_type; + typedef const T & in_type; + typedef T & inout_type; + typedef T_out out_type; + + typedef In_Var_Size_SArgument_T<T> in_arg_val; + typedef Inout_Var_Size_SArgument_T<T> inout_arg_val; + typedef Out_Var_Size_SArgument_T<T,T_var> out_arg_val; + typedef Ret_Var_Size_SArgument_T<T,T_var> ret_val; + + // Typedefs corresponding to return value of arg() method in both + // the client and server side argument class templates. + typedef in_type in_arg_type; + typedef inout_type inout_arg_type; + typedef ret_type & out_arg_type; + typedef ret_type & ret_arg_type; + + }; +} + +#if defined (__ACE_INLINE__) +#include "tao/PortableServer/Var_Size_SArgument_T.inl" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "tao/PortableServer/Var_Size_SArgument_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Var_Size_SArgument_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* TAO_VAR_SIZE_SARGUMENT_T_H */ diff --git a/TAO/tao/Var_Size_SArgument_T.inl b/TAO/tao/PortableServer/Var_Size_SArgument_T.inl index 2d9f217bd39..5c53ed118ef 100644 --- a/TAO/tao/Var_Size_SArgument_T.inl +++ b/TAO/tao/PortableServer/Var_Size_SArgument_T.inl @@ -1,9 +1,5 @@ // $Id$ -template<typename S> -ACE_INLINE -TAO::In_Var_Size_SArgument_T<S>::In_Var_Size_SArgument_T (void) -{} template<typename S> const S & diff --git a/TAO/tao/Special_Basic_Argument_T.h b/TAO/tao/Special_Basic_Argument_T.h index 6d405e4bbaa..b132bb85aa1 100644 --- a/TAO/tao/Special_Basic_Argument_T.h +++ b/TAO/tao/Special_Basic_Argument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -41,7 +41,7 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - S const & arg (void); + S const & arg (void) const; private: S const & x_; @@ -67,7 +67,7 @@ namespace TAO S & arg (void); private: - mutable S & x_; + S & x_; }; /** diff --git a/TAO/tao/Special_Basic_Argument_T.inl b/TAO/tao/Special_Basic_Argument_T.inl index ee170d6dd53..66887ab09a3 100644 --- a/TAO/tao/Special_Basic_Argument_T.inl +++ b/TAO/tao/Special_Basic_Argument_T.inl @@ -1,3 +1,5 @@ +// -*- C++ -*- +// // $Id$ template<typename S, typename to_S, typename from_S> @@ -11,7 +13,7 @@ TAO::In_Special_Basic_Argument_T<S,to_S,from_S>::In_Special_Basic_Argument_T ( template<typename S, typename to_S, typename from_S> ACE_INLINE S const & -TAO::In_Special_Basic_Argument_T<S,to_S,from_S>::arg (void) +TAO::In_Special_Basic_Argument_T<S,to_S,from_S>::arg (void) const { return this->x_; } diff --git a/TAO/tao/TAO_Server_Request.cpp b/TAO/tao/TAO_Server_Request.cpp index 879a332ccfc..50376438d16 100644 --- a/TAO/tao/TAO_Server_Request.cpp +++ b/TAO/tao/TAO_Server_Request.cpp @@ -6,6 +6,8 @@ #include "debug.h" #include "Pluggable_Messaging.h" #include "GIOP_Utils.h" +#include "Stub.h" +#include "operation_details.h" #include "Transport.h" #include "CDR.h" #include "SystemException.h" @@ -20,7 +22,7 @@ ACE_RCSID (tao, #if defined (ACE_ENABLE_TIMEPROBES) - static const char *TAO_Server_Request_Timeprobe_Description[] = +static const char * TAO_Server_Request_Timeprobe_Description[] = { "TAO_ServerRequest::TAO_ServerRequest - start", "TAO_ServerRequest::TAO_ServerRequest - end", @@ -51,17 +53,18 @@ TAO_ServerRequest::TAO_ServerRequest (TAO_Pluggable_Messaging *mesg_base, // transport already duplicated in // TAO_Transport::process_parsed_messages () transport_(transport), - response_expected_ (0), - deferred_reply_ (0), - sync_with_server_ (0), + response_expected_ (false), + deferred_reply_ (false), + sync_with_server_ (false), + is_dsi_ (false), // @@ We shouldn't be using GIOP specific types here. Need to be revisited. exception_type_ (TAO_GIOP_NO_EXCEPTION), orb_core_ (orb_core), request_id_ (0), profile_ (orb_core), requesting_principal_ (0), - is_dsi_ (0), dsi_nvlist_align_ (0), + operation_details_ (0), argument_flag_ (1) #if TAO_HAS_INTERCEPTORS == 1 , interceptor_count_ (0) @@ -94,15 +97,16 @@ TAO_ServerRequest::TAO_ServerRequest (TAO_Pluggable_Messaging *mesg_base, transport_ (transport), response_expected_ (response_expected), deferred_reply_ (deferred_reply), - sync_with_server_ (0), + sync_with_server_ (false), + is_dsi_ (false), exception_type_ (TAO_GIOP_NO_EXCEPTION), orb_core_ (orb_core), request_id_ (request_id), profile_ (orb_core), requesting_principal_ (0), - is_dsi_ (0), dsi_nvlist_align_ (0), - argument_flag_ (1) + operation_details_ (0), + argument_flag_ (true) #if TAO_HAS_INTERCEPTORS == 1 , interceptor_count_ (0) , rs_pi_current_ () @@ -113,6 +117,39 @@ TAO_ServerRequest::TAO_ServerRequest (TAO_Pluggable_Messaging *mesg_base, parse_error = 0; } +// Constructor used in Thru-POA collocation code. +TAO_ServerRequest::TAO_ServerRequest (TAO_ORB_Core * orb_core, + TAO_Operation_Details const & details, + CORBA::Object_ptr target) + : mesg_base_ (0), + operation_ (details.opname ()), + incoming_ (0), + outgoing_ (0), + transport_ (0), + response_expected_ (details.response_flags () == TAO_TWOWAY_RESPONSE_FLAG + || details.response_flags () == static_cast<CORBA::Octet> (Messaging::SYNC_WITH_SERVER) + || details.response_flags () == static_cast<CORBA::Octet> (Messaging::SYNC_WITH_TARGET)), + deferred_reply_ (false), + sync_with_server_ (details.response_flags () == static_cast<CORBA::Octet> (Messaging::SYNC_WITH_SERVER)), + is_dsi_ (false), + exception_type_ (TAO_GIOP_NO_EXCEPTION), + orb_core_ (orb_core), + request_id_ (0), + profile_ (orb_core), + requesting_principal_ (0), + dsi_nvlist_align_ (0), + operation_details_ (&details), + argument_flag_ (false) +#if TAO_HAS_INTERCEPTORS == 1 + , interceptor_count_ (0) + , rs_pi_current_ () + , result_seq_ (0) +#endif /* TAO_HAS_INTERCEPTORS == 1 */ +{ + // Have to use a const_cast<>. *sigh* + this->profile_.object_key (const_cast<TAO::ObjectKey &> (target->_stubobj ()->object_key ())); +} + TAO_ServerRequest::~TAO_ServerRequest (void) { } @@ -126,6 +163,9 @@ TAO_ServerRequest::orb (void) void TAO_ServerRequest::init_reply (void) { + if (!this->outgoing_) + return; // Collocated + // Construct our reply generator. TAO_Pluggable_Reply_Params_Base reply_params; @@ -134,9 +174,9 @@ TAO_ServerRequest::init_reply (void) // pluggable_messaging_interface. One point to be noted however is // that, it was the pluggable_messaging classes who created us and // delegated us to do work on its behalf. But we would be calling - // back. As we dont have a LOCK or any such things we can call + // back. As we don't have a LOCK or any such things we can call // pluggable_messaging guys again. We would be on the same thread of - // invocation. So *theoratically* there should not be a problem. + // invocation. So *theoretically* there should not be a problem. reply_params.request_id_ = this->request_id_; reply_params.is_dsi_ = this->is_dsi_; reply_params.dsi_nvlist_align_ = this->dsi_nvlist_align_; @@ -180,7 +220,7 @@ TAO_ServerRequest::init_reply (void) ACE_TEXT ("marshal encoding forwarded objref failed\n"))); } } - this->transport_->assign_translators (0,this->outgoing_); + this->transport_->assign_translators (0, this->outgoing_); } void diff --git a/TAO/tao/TAO_Server_Request.h b/TAO/tao/TAO_Server_Request.h index 8796f78d207..f878aad1591 100644 --- a/TAO/tao/TAO_Server_Request.h +++ b/TAO/tao/TAO_Server_Request.h @@ -44,6 +44,8 @@ namespace CORBA typedef ORB *ORB_ptr; } +class TAO_Operation_Details; + /** * @class TAO_ServerRequest * @@ -88,6 +90,11 @@ public: TAO_ORB_Core *orb_core, int &parse_error); + /// Constructor used by thru-POA collocated invocation path. + TAO_ServerRequest (TAO_ORB_Core * orb_core, + TAO_Operation_Details const & details, + CORBA::Object_ptr target); + /// Destructor. virtual ~TAO_ServerRequest (void); @@ -111,16 +118,16 @@ public: CORBA::ORB_ptr orb (void); /// Return the ORB core pointer member. - TAO_ORB_Core *orb_core (void); + TAO_ORB_Core *orb_core (void) const; /// Start a Reply message. void init_reply (void); /// Retrieve the incoming stream. - TAO_InputCDR &incoming (void); + TAO_InputCDR * incoming (void) const; /// Retrieve the outgoing stream. - TAO_OutputCDR &outgoing (void); + TAO_OutputCDR * outgoing (void) const; /// Is the response expected? CORBA::Boolean response_expected (void) const; @@ -204,6 +211,9 @@ public: /// Set the member. void dsi_nvlist_align (ptrdiff_t alignment); + // Get the operation details for the current request. + TAO_Operation_Details const * operation_details (void) const; + /// Get/Set operations for the argument_flag void argument_flag (CORBA::Boolean flag); CORBA::Boolean argument_flag (void); @@ -270,6 +280,9 @@ private: /// 0: anything else CORBA::Boolean sync_with_server_; + /// Did we get passed to a CORBA::ServerRequest? + CORBA::Boolean is_dsi_; + // TAO_GIOP_ReplyStatusType exception_type_; /// Exception type (will be NO_EXCEPTION in the majority of the cases). CORBA::ULong exception_type_; @@ -291,12 +304,11 @@ private: /// Identifies the requester. CORBA::OctetSeq_var requesting_principal_; - /// Did we get passed to a CORBA::ServerRequest? - CORBA::Boolean is_dsi_; - /// Used to pad CDR stream if we have used DSI. ptrdiff_t dsi_nvlist_align_; + TAO_Operation_Details const * const operation_details_; + /** * An argument flag to indicate whether there is any data that is * going to get marshalled along as a reply. The default will be 1 diff --git a/TAO/tao/TAO_Server_Request.i b/TAO/tao/TAO_Server_Request.i index f87daa86d7b..82f4a9cf919 100644 --- a/TAO/tao/TAO_Server_Request.i +++ b/TAO/tao/TAO_Server_Request.i @@ -3,21 +3,21 @@ // $Id$ ACE_INLINE TAO_ORB_Core * -TAO_ServerRequest::orb_core (void) +TAO_ServerRequest::orb_core (void) const { return this->orb_core_; } -ACE_INLINE TAO_InputCDR & -TAO_ServerRequest::incoming (void) +ACE_INLINE TAO_InputCDR * +TAO_ServerRequest::incoming (void) const { - return *this->incoming_; + return this->incoming_; } -ACE_INLINE TAO_OutputCDR & -TAO_ServerRequest::outgoing (void) +ACE_INLINE TAO_OutputCDR * +TAO_ServerRequest::outgoing (void) const { - return *this->outgoing_; + return this->outgoing_; } ACE_INLINE const char * @@ -168,6 +168,12 @@ TAO_ServerRequest::is_dsi (void) this->is_dsi_ = 1; } +ACE_INLINE TAO_Operation_Details const * +TAO_ServerRequest::operation_details (void) const +{ + return this->operation_details_; +} + ACE_INLINE void TAO_ServerRequest::dsi_nvlist_align (ptrdiff_t alignment) { diff --git a/TAO/tao/UB_String_Argument_T.h b/TAO/tao/UB_String_Argument_T.h index 4553e79a9e2..b7ba07c21d1 100644 --- a/TAO/tao/UB_String_Argument_T.h +++ b/TAO/tao/UB_String_Argument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -14,6 +14,7 @@ #define TAO_UB_STRING_ARGUMENT_T_H #include /**/ "ace/pre.h" + #include "tao/Argument.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -38,10 +39,10 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - const S * arg (void) const; + S const * arg (void) const; private: - const S * x_; + S const * x_; }; /** @@ -132,7 +133,7 @@ namespace TAO struct UB_String_Arg_Traits_T { typedef T * ret_type; - typedef const T * in_type; + typedef T const * in_type; typedef T *& inout_type; typedef T_out out_type; diff --git a/TAO/tao/Var_Array_Argument_T.h b/TAO/tao/Var_Array_Argument_T.h index 342acbc5311..0e411bf87dc 100644 --- a/TAO/tao/Var_Array_Argument_T.h +++ b/TAO/tao/Var_Array_Argument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -14,6 +14,7 @@ #define TAO_VAR_ARRAY_ARGUMENT_T_H #include /**/ "ace/pre.h" + #include "tao/Argument.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -38,7 +39,7 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - const S_slice * arg (void) const; + S_slice const * arg (void) const; private: S_forany x_; diff --git a/TAO/tao/Var_Array_Argument_T.inl b/TAO/tao/Var_Array_Argument_T.inl index bc1c0bf0f45..a189584da2e 100644 --- a/TAO/tao/Var_Array_Argument_T.inl +++ b/TAO/tao/Var_Array_Argument_T.inl @@ -11,7 +11,7 @@ In_Var_Array_Argument_T (const S_slice * x) template<typename S, typename S_slice, typename S_forany> ACE_INLINE -const S_slice * +S_slice const * TAO::In_Var_Array_Argument_T<S,S_slice,S_forany>::arg (void) const { return this->x_.in (); diff --git a/TAO/tao/Var_Size_Argument_T.h b/TAO/tao/Var_Size_Argument_T.h index 88b81297218..e417f5b72fe 100644 --- a/TAO/tao/Var_Size_Argument_T.h +++ b/TAO/tao/Var_Size_Argument_T.h @@ -1,4 +1,4 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** @@ -14,6 +14,7 @@ #define TAO_VAR_SIZE_ARGUMENT_T_H #include /**/ "ace/pre.h" + #include "tao/Argument.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -38,7 +39,7 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 virtual void interceptor_param (Dynamic::Parameter &); #endif /* TAO_HAS_INTERCEPTORS == 1 */ - const S & arg (void) const; + S const & arg (void) const; private: const S * x_; @@ -133,7 +134,7 @@ namespace TAO struct Var_Size_Arg_Traits_T { typedef T * ret_type; - typedef const T & in_type; + typedef T const & in_type; typedef T & inout_type; typedef T_out out_type; diff --git a/TAO/tao/operation_details.h b/TAO/tao/operation_details.h index 5950a8b3235..c793cc47d9b 100644 --- a/TAO/tao/operation_details.h +++ b/TAO/tao/operation_details.h @@ -149,7 +149,7 @@ public: //@} /// Accessors for the argumet list - TAO::Argument **args (void); + TAO::Argument ** args (void) const; CORBA::ULong args_num (void) const ; private: diff --git a/TAO/tao/operation_details.i b/TAO/tao/operation_details.i index beaf554c50b..7c75e72cf79 100644 --- a/TAO/tao/operation_details.i +++ b/TAO/tao/operation_details.i @@ -168,7 +168,7 @@ TAO_Operation_Details::addressing_mode (CORBA::Short mode) } ACE_INLINE TAO::Argument ** -TAO_Operation_Details::args (void) +TAO_Operation_Details::args (void) const { return this->args_; } |