From aae3ede2d22f3f391b1fa6815d2686b798a6ce3a Mon Sep 17 00:00:00 2001 From: parsons Date: Mon, 23 Jun 2003 21:58:27 +0000 Subject: ChangeLogTag: Mon Jun 23 16:50:31 2003 Jeff Parsons --- TAO/ChangeLog_ref | 27 ++++ TAO/tao/Cleanup_Func_Registry.h | 1 + TAO/tao/Fixed_Array_Argument_T.cpp | 309 ++++++++++++++++++++++++++++++++++++ TAO/tao/Fixed_Array_Argument_T.h | 265 +++++++++++++++++++++++++++++++ TAO/tao/Makefile.tao | 2 + TAO/tao/TAO.dsp | 17 ++ TAO/tao/Var_Array_Argument_T.cpp | 317 +++++++++++++++++++++++++++++++++++++ TAO/tao/Var_Array_Argument_T.h | 271 +++++++++++++++++++++++++++++++ TAO/tao/Var_Size_Argument_T.cpp | 4 +- 9 files changed, 1211 insertions(+), 2 deletions(-) create mode 100644 TAO/tao/Fixed_Array_Argument_T.cpp create mode 100644 TAO/tao/Fixed_Array_Argument_T.h create mode 100644 TAO/tao/Var_Array_Argument_T.cpp create mode 100644 TAO/tao/Var_Array_Argument_T.h diff --git a/TAO/ChangeLog_ref b/TAO/ChangeLog_ref index 35b0be65700..433ca176172 100644 --- a/TAO/ChangeLog_ref +++ b/TAO/ChangeLog_ref @@ -1,3 +1,30 @@ +Mon Jun 23 16:50:31 2003 Jeff Parsons + + * tao/Cleanup_Func_Registry.h: + + Added #include that was added in the main trunk, to avoid a + build errorin this branch. + + * tao/Fixed_Array_Argument_T.cpp: + * tao/Fixed_Array_Argument_T.h: + * tao/Var_Array_Argument_T.cpp: + * tao/Var_Array_Argument_T.h: + + New files, for handling array arguments. + + * tao/TAO.dsp: + * tao/Makefile.tao: + + Added new files to project and makefile. + + * tao/Var_Size_Argument_T.cpp: + + Changed demarshaling and Any extraction methods to call + .inout() on the _var member instead of .out(). The _var's + pointer has already been allocated but not initialized, + and calling .out() will destroy it, expecting a new + allocation, which is not the intended behavior. + Sun Jun 22 000:31:20 2003 Jeff Parsons * tao/BD_String_Argument_T.cpp: diff --git a/TAO/tao/Cleanup_Func_Registry.h b/TAO/tao/Cleanup_Func_Registry.h index 1a6bfaf294f..44dc16bfac8 100644 --- a/TAO/tao/Cleanup_Func_Registry.h +++ b/TAO/tao/Cleanup_Func_Registry.h @@ -21,6 +21,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Array_Base.h" +#include "ace/OS.h" /** * @class TAO_Cleanup_Func_Registry diff --git a/TAO/tao/Fixed_Array_Argument_T.cpp b/TAO/tao/Fixed_Array_Argument_T.cpp new file mode 100644 index 00000000000..b9746a6ca3f --- /dev/null +++ b/TAO/tao/Fixed_Array_Argument_T.cpp @@ -0,0 +1,309 @@ +// $Id$ + +#ifndef TAO_FIXED_ARRAY_ARGUMENT_T_C +#define TAO_FIXED_ARRAY_ARGUMENT_T_C + +#include "tao/Fixed_Array_Argument_T.h" + +ACE_RCSID (tao, + Fixed_Array_Argument_T, + "$Id$") + +template +TAO::In_Fixed_Array_Argument_T:: +In_Fixed_Array_Argument_T (const S x) + : x_ ((S_slice *) x) +{} + +template +CORBA::Boolean +TAO::In_Fixed_Array_Argument_T::marshal ( + TAO_OutputCDR & cdr + ) +{ + return cdr << this->x_; +} + +template +void +TAO::In_Fixed_Array_Argument_T::interceptor_param ( + Dynamic::Parameter & p + ) +{ + p.argument <<= this->x_; + p.mode = CORBA::PARAM_IN; +} + +template +CORBA::Boolean +TAO::In_Fixed_Array_Argument_T::interceptor_replace ( + CORBA::Any & any + ) +{ + return any >>= this->x_; +} + +// =========================================================== + +template +TAO::Inout_Fixed_Array_Argument_T::Inout_Fixed_Array_Argument_T ( + S x + ) + : x_ (x) +{} + +template +CORBA::Boolean +TAO::Inout_Fixed_Array_Argument_T::marshal (TAO_OutputCDR & cdr) +{ + return cdr << this->x_; +} + +template +CORBA::Boolean +TAO::Inout_Fixed_Array_Argument_T::demarshal (TAO_InputCDR & cdr) +{ + return cdr >> this->x_; +} + +template +void +TAO::Inout_Fixed_Array_Argument_T::interceptor_param ( + Dynamic::Parameter & p + ) +{ + p.argument <<= this->x_; + p.mode = CORBA::PARAM_INOUT; +} + +template +CORBA::Boolean +TAO::Inout_Fixed_Array_Argument_T::interceptor_replace ( + CORBA::Any & any + ) +{ + return any >>= this->x_; +} + +// ============================================================== + +template +TAO::Out_Fixed_Array_Argument_T::Out_Fixed_Array_Argument_T (S x) + : x_ (x) +{} + +template +CORBA::Boolean +TAO::Out_Fixed_Array_Argument_T::demarshal (TAO_InputCDR & cdr) +{ + return cdr >> this->x_; +} + +// ============================================================ + +template +TAO::Ret_Fixed_Array_Argument_T:: +Ret_Fixed_Array_Argument_T (void) +{ + S_slice * tmp = 0; + ACE_ALLOCATOR (tmp, + S_life::tao_alloc ()); + this->x_ = tmp; +} + +template +CORBA::Boolean +TAO::Ret_Fixed_Array_Argument_T::demarshal ( + TAO_InputCDR & cdr + ) +{ + S_forany tmp (this->x_.ptr ()); + return cdr >> tmp; +} + +template +void +TAO::Ret_Fixed_Array_Argument_T:: +interceptor_result (CORBA::Any * any) +{ + (*any) <<= S_forany (this->x_.ptr ()); +} + +template +CORBA::Boolean +TAO::Ret_Fixed_Array_Argument_T:: +interceptor_replace (CORBA::Any & any) +{ + S_forany tmp (this->x_.ptr ()); + return any >>= tmp; +} + +template +S_slice * +TAO::Ret_Fixed_Array_Argument_T::excp (void) +{ + return this->x_.ptr (); +} + +template +S_slice * +TAO::Ret_Fixed_Array_Argument_T::retn (void) +{ + return this->x_._retn (); +} + +// ============================================================ + +template +TAO::In_Fixed_Array_SArgument_T::In_Fixed_Array_SArgument_T (void) +{} + +template +CORBA::Boolean +TAO::In_Fixed_Array_SArgument_T::demarshal (TAO_InputCDR &cdr) +{ + S_forany tmp (this->x_); + return cdr >> tmp; +} + +template +void +TAO::In_Fixed_Array_SArgument_T::interceptor_param ( + Dynamic::Parameter & p + ) +{ + p.argument <<= S_forany (this->x_); + p.mode = CORBA::PARAM_IN; +} + +template +CORBA::Boolean +TAO::In_Fixed_Array_SArgument_T::interceptor_replace ( + CORBA::Any & any + ) +{ + S_forany tmp (this->x_); + return any >>= tmp; +} + +template +const S & +TAO::In_Fixed_Array_SArgument_T::arg (void) const +{ + return this->x_; +} + +// =========================================================== + +template +TAO::Inout_Fixed_Array_SArgument_T:: +Inout_Fixed_Array_SArgument_T (void) +{} + +template +CORBA::Boolean +TAO::Inout_Fixed_Array_SArgument_T::marshal (TAO_OutputCDR & cdr) +{ + return cdr << S_forany (this->x_); +} + +template +CORBA::Boolean +TAO::Inout_Fixed_Array_SArgument_T::demarshal (TAO_InputCDR & cdr) +{ + S_forany tmp (this->x_); + return cdr >> tmp; +} + +template +void +TAO::Inout_Fixed_Array_SArgument_T::interceptor_param ( + Dynamic::Parameter & p + ) +{ + p.argument <<= S_forany (this->x_); + p.mode = CORBA::PARAM_INOUT; +} + +template +CORBA::Boolean +TAO::Inout_Fixed_Array_SArgument_T::interceptor_replace ( + CORBA::Any & any + ) +{ + S_forany tmp (this->x_); + return any >>= tmp; +} + +template +S & +TAO::Inout_Fixed_Array_SArgument_T::arg (void) +{ + return this->x_; +} + +// ============================================================== + +template +TAO::Out_Fixed_Array_SArgument_T::Out_Fixed_Array_SArgument_T ( + void + ) +{} + +template +CORBA::Boolean +TAO::Out_Fixed_Array_SArgument_T::marshal (TAO_OutputCDR &cdr) +{ + return cdr << S_forany (this->x_); +} + +template +S & +TAO::Out_Fixed_Array_SArgument_T::arg (void) +{ + return this->x_; +} + +// ============================================================ + +template +TAO::Ret_Fixed_Array_SArgument_T:: +Ret_Fixed_Array_SArgument_T (void) +{ +} + +template +CORBA::Boolean +TAO::Ret_Fixed_Array_SArgument_T::marshal ( + TAO_OutputCDR & cdr + ) +{ + return cdr << S_forany (this->x_.inout ()); +} + +template +void +TAO::Ret_Fixed_Array_SArgument_T::interceptor_result ( + CORBA::Any * any + ) +{ + (*any) <<= S_forany (this->x_.ptr ()); +} + +template +CORBA::Boolean +TAO::Ret_Fixed_Array_SArgument_T:: +interceptor_replace (CORBA::Any & any) +{ + S_forany tmp (this->x_.inout ()); + return any >>= tmp; +} + +template +S_slice *& +TAO::Ret_Fixed_Array_SArgument_T::arg (void) +{ + return this->x_.out (); +} + +#endif /* TAO_FIXED_ARRAY_ARGUMENT_T_C */ diff --git a/TAO/tao/Fixed_Array_Argument_T.h b/TAO/tao/Fixed_Array_Argument_T.h new file mode 100644 index 00000000000..ab2b3156cf9 --- /dev/null +++ b/TAO/tao/Fixed_Array_Argument_T.h @@ -0,0 +1,265 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file Fixed_Array_Argument_T.h + * + * $Id$ + * + * @authors Jeff Parsons and Carlos O'Ryan + */ +//============================================================================= + + +#ifndef TAO_FIXED_ARRAY_ARGUMENT_T_H +#define TAO_FIXED_ARRAY_ARGUMENT_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_Fixed_Array_Argument_T + * + * @brief IN stub argument of fixed size element array. + * + */ + template + class In_Fixed_Array_Argument_T : public Argument + { + public: + In_Fixed_Array_Argument_T (const S x); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); + + virtual void interceptor_param (Dynamic::Parameter &); + virtual CORBA::Boolean interceptor_replace (CORBA::Any &); + + private: + S_forany x_; + }; + + /** + * @class Inout_Fixed_Array_Argument_T + * + * @brief INOUT stub argument of fixed size element array. + * + */ + template + class Inout_Fixed_Array_Argument_T : public Argument + { + public: + Inout_Fixed_Array_Argument_T (S x); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); + virtual CORBA::Boolean demarshal (TAO_InputCDR &); + + virtual void interceptor_param (Dynamic::Parameter &); + virtual CORBA::Boolean interceptor_replace (CORBA::Any &); + + private: + S_forany x_; + }; + + /** + * @class Out_Fixed_Array_Argument_T + * + * @brief OUT stub argument of fixed size element array. + * + */ + template + class Out_Fixed_Array_Argument_T : public Argument + { + public: + Out_Fixed_Array_Argument_T (S x); + + virtual CORBA::Boolean demarshal (TAO_InputCDR &); + + private: + S_forany x_; + }; + + /** + * @class Ret_Fixed_Array_Argument_T + * + * @brief Return stub value of fixed size element array. + * + */ + template + class Ret_Fixed_Array_Argument_T : public Argument + { + public: + Ret_Fixed_Array_Argument_T (void); + + virtual CORBA::Boolean demarshal (TAO_InputCDR &); + + virtual void interceptor_result (CORBA::Any *); + virtual CORBA::Boolean interceptor_replace (CORBA::Any &); + + S_slice * excp (void); + S_slice * retn (void); + + private: + S_var x_; + }; + + /** + * @class In_Fixed_Array_SArgument_T + * + * @brief IN skeleton argument of fixed size element array. + * + */ + template + class In_Fixed_Array_SArgument_T : public Argument + { + public: + In_Fixed_Array_SArgument_T (void); + + virtual CORBA::Boolean demarshal (TAO_InputCDR &); + + virtual void interceptor_param (Dynamic::Parameter &); + virtual CORBA::Boolean interceptor_replace (CORBA::Any &); + + const S & arg (void) const; + + private: + S x_; + }; + + /** + * @class Inout_Fixed_Array_SArgument_T + * + * @brief INOUT skeleton argument of fixed size element array. + * + */ + template + class Inout_Fixed_Array_SArgument_T : public Argument + { + public: + Inout_Fixed_Array_SArgument_T (void); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); + virtual CORBA::Boolean demarshal (TAO_InputCDR &); + + virtual void interceptor_param (Dynamic::Parameter &); + virtual CORBA::Boolean interceptor_replace (CORBA::Any &); + + S & arg (void); + + private: + S x_; + }; + + /** + * @class Out_Fixed_Array_SArgument_T + * + * @brief OUT skeleton argument of fixed size element array. + * + */ + template + class Out_Fixed_Array_SArgument_T : public Argument + { + public: + Out_Fixed_Array_SArgument_T (void); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); + + S & arg (void); + + private: + S x_; + }; + + /** + * @class Ret_Fixed_Array_SArgument_T + * + * @brief Skeleton value of fixed size element array. + * + */ + template + class Ret_Fixed_Array_SArgument_T : public Argument + { + public: + Ret_Fixed_Array_SArgument_T (void); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); + + virtual void interceptor_result (CORBA::Any *); + virtual CORBA::Boolean interceptor_replace (CORBA::Any &); + + S_slice *& arg (void); + + private: + S_var x_; + }; + + /** + * @struct Fixed_Array_Tag + * + * @brief Struct for fixed size element array argument id tag. + * + */ + struct TAO_Export Fixed_Array_Tag {}; + + /** + * @struct Fixed_Array_Arg_Traits_T + * + * @brief Argument traits of fixed size element array. + * + */ + template + struct Fixed_Array_Arg_Traits_T + { + typedef T_slice * ret_type; + typedef const T in_type; + typedef T inout_type; + typedef T out_type; + + typedef In_Fixed_Array_Argument_T in_arg_val; + typedef Inout_Fixed_Array_Argument_T inout_arg_val; + typedef Out_Fixed_Array_Argument_T out_arg_val; + typedef Ret_Fixed_Array_Argument_T stub_ret_val; + + typedef In_Fixed_Array_SArgument_T in_sarg_val; + typedef Inout_Fixed_Array_SArgument_T inout_sarg_val; + typedef Out_Fixed_Array_SArgument_T out_sarg_val; + typedef Ret_Fixed_Array_SArgument_T skel_ret_val; + + typedef Fixed_Array_Tag idl_tag; + }; +}; + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "tao/Fixed_Array_Argument_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Fixed_Array_Argument_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include "ace/post.h" + +#endif /* TAO_FIXED_ARRAY_ARGUMENT_T_H */ diff --git a/TAO/tao/Makefile.tao b/TAO/tao/Makefile.tao index 6da005b0925..c461dc5300b 100644 --- a/TAO/tao/Makefile.tao +++ b/TAO/tao/Makefile.tao @@ -334,6 +334,8 @@ TEMPLATE_FILES = \ UB_String_Argument_T \ Fixed_Size_Argument_T \ Var_Size_Argument_T \ + Fixed_Array_Argument_T \ + Var_Array_Argument_T \ TAO_Singleton ifndef TAO_ROOT diff --git a/TAO/tao/TAO.dsp b/TAO/tao/TAO.dsp index 27b6e8304e7..6922d80c0bf 100644 --- a/TAO/tao/TAO.dsp +++ b/TAO/tao/TAO.dsp @@ -1084,6 +1084,10 @@ SOURCE=.\Argument.h # End Source File # Begin Source File +SOURCE=.\Array_VarOut_T.h +# End Source File +# Begin Source File + SOURCE=.\Asynch_Invocation.h # End Source File # Begin Source File @@ -1328,6 +1332,10 @@ SOURCE=.\FILE_Parser.h # End Source File # Begin Source File +SOURCE=.\Fixed_Array_Argument_T.h +# End Source File +# Begin Source File + SOURCE=.\Fixed_Size_Argument_T.h # End Source File # Begin Source File @@ -1584,6 +1592,10 @@ SOURCE=.\Object_Argument_T.h # End Source File # Begin Source File +SOURCE=.\PortableServer\Object_Argument_T.h +# End Source File +# Begin Source File + SOURCE=.\Object_KeyC.h # End Source File # Begin Source File @@ -2674,6 +2686,11 @@ SOURCE=.\Codeset_Translator_Factory_T.cpp # End Source File # Begin Source File +SOURCE=.\Fixed_Array_Argument_T.cpp +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + SOURCE=.\Fixed_Size_Argument_T.cpp # PROP Exclude_From_Build 1 # End Source File diff --git a/TAO/tao/Var_Array_Argument_T.cpp b/TAO/tao/Var_Array_Argument_T.cpp new file mode 100644 index 00000000000..b8301513e0d --- /dev/null +++ b/TAO/tao/Var_Array_Argument_T.cpp @@ -0,0 +1,317 @@ +// $Id$ + +#ifndef TAO_VAR_ARRAY_ARGUMENT_T_C +#define TAO_VAR_ARRAY_ARGUMENT_T_C + +#include "tao/Var_Array_Argument_T.h" + +ACE_RCSID (tao, + Var_Array_Argument_T, + "$Id$") + +template +TAO::In_Var_Array_Argument_T:: +In_Var_Array_Argument_T (const S x) + : x_ ((S_slice *) x) +{} + +template +CORBA::Boolean +TAO::In_Var_Array_Argument_T::marshal ( + TAO_OutputCDR & cdr + ) +{ + return cdr << this->x_; +} + +template +void +TAO::In_Var_Array_Argument_T::interceptor_param ( + Dynamic::Parameter & p + ) +{ + p.argument <<= this->x_; + p.mode = CORBA::PARAM_IN; +} + +template +CORBA::Boolean +TAO::In_Var_Array_Argument_T::interceptor_replace ( + CORBA::Any & any + ) +{ + return any >>= this->x_; +} + +// =========================================================== + +template +TAO::Inout_Var_Array_Argument_T::Inout_Var_Array_Argument_T ( + S x + ) + : x_ (x) +{} + +template +CORBA::Boolean +TAO::Inout_Var_Array_Argument_T::marshal (TAO_OutputCDR & cdr) +{ + return cdr << this->x_; +} + +template +CORBA::Boolean +TAO::Inout_Var_Array_Argument_T::demarshal (TAO_InputCDR & cdr) +{ + return cdr >> this->x_; +} + +template +void +TAO::Inout_Var_Array_Argument_T::interceptor_param ( + Dynamic::Parameter & p + ) +{ + p.argument <<= this->x_; + p.mode = CORBA::PARAM_INOUT; +} + +template +CORBA::Boolean +TAO::Inout_Var_Array_Argument_T::interceptor_replace ( + CORBA::Any & any + ) +{ + return any >>= this->x_; +} + +// ============================================================== + +template +TAO::Out_Var_Array_Argument_T:: +Out_Var_Array_Argument_T (S_out x) +{ + ACE_ALLOCATOR (x.ptr (), + S_life::tao_alloc ()); + this->x_ = x.ptr (); +} + +template +CORBA::Boolean +TAO::Out_Var_Array_Argument_T::demarshal ( + TAO_InputCDR & cdr + ) +{ + S_forany tmp (this->x_.ptr ()); + return cdr >> tmp; +} + +// ============================================================ + +template +TAO::Ret_Var_Array_Argument_T:: +Ret_Var_Array_Argument_T (void) +{ + S_slice * tmp = 0; + ACE_ALLOCATOR (tmp, + S_life::tao_alloc ()); + this->x_ = tmp; +} + +template +CORBA::Boolean +TAO::Ret_Var_Array_Argument_T::demarshal ( + TAO_InputCDR & cdr + ) +{ + S_forany tmp (this->x_.ptr ()); + return cdr >> tmp; +} + +template +void +TAO::Ret_Var_Array_Argument_T:: +interceptor_result (CORBA::Any * any) +{ + (*any) <<= S_forany (this->x_.ptr ()); +} + +template +CORBA::Boolean +TAO::Ret_Var_Array_Argument_T:: +interceptor_replace (CORBA::Any & any) +{ + S_forany tmp (this->x_.ptr ()); + return any >>= tmp; +} + +template +S_slice * +TAO::Ret_Var_Array_Argument_T::excp (void) +{ + return this->x_.ptr (); +} + +template +S_slice * +TAO::Ret_Var_Array_Argument_T::retn (void) +{ + return this->x_._retn (); +} + +// ============================================================ + +template +TAO::In_Var_Array_SArgument_T::In_Var_Array_SArgument_T (void) +{} + +template +CORBA::Boolean +TAO::In_Var_Array_SArgument_T::demarshal (TAO_InputCDR &cdr) +{ + S_forany tmp (this->x_); + return cdr >> tmp; +} + +template +void +TAO::In_Var_Array_SArgument_T::interceptor_param ( + Dynamic::Parameter & p + ) +{ + p.argument <<= S_forany (this->x_); + p.mode = CORBA::PARAM_IN; +} + +template +CORBA::Boolean +TAO::In_Var_Array_SArgument_T::interceptor_replace ( + CORBA::Any & any + ) +{ + S_forany tmp (this->x_); + return any >>= tmp; +} + +template +const S & +TAO::In_Var_Array_SArgument_T::arg (void) const +{ + return this->x_; +} + +// =========================================================== + +template +TAO::Inout_Var_Array_SArgument_T:: +Inout_Var_Array_SArgument_T (void) +{} + +template +CORBA::Boolean +TAO::Inout_Var_Array_SArgument_T::marshal (TAO_OutputCDR & cdr) +{ + return cdr << S_forany (this->x_); +} + +template +CORBA::Boolean +TAO::Inout_Var_Array_SArgument_T::demarshal (TAO_InputCDR & cdr) +{ + S_forany tmp (this->x_); + return cdr >> tmp; +} + +template +void +TAO::Inout_Var_Array_SArgument_T::interceptor_param ( + Dynamic::Parameter & p + ) +{ + p.argument <<= S_forany (this->x_); + p.mode = CORBA::PARAM_INOUT; +} + +template +CORBA::Boolean +TAO::Inout_Var_Array_SArgument_T::interceptor_replace ( + CORBA::Any & any + ) +{ + S_forany tmp (this->x_); + return any >>= tmp; +} + +template +S & +TAO::Inout_Var_Array_SArgument_T::arg (void) +{ + return this->x_; +} + +// ============================================================== + +template +TAO::Out_Var_Array_SArgument_T:: +Out_Var_Array_SArgument_T (void) +{} + +template +CORBA::Boolean +TAO::Out_Var_Array_SArgument_T::marshal ( + TAO_OutputCDR & cdr + ) +{ + return cdr << S_forany (this->x_.ptr ()); +} + +template +S_slice *& +TAO::Out_Var_Array_SArgument_T::arg (void) +{ + return this->x_.out (); +} + +// ============================================================ + +template +TAO::Ret_Var_Array_SArgument_T:: +Ret_Var_Array_SArgument_T (void) +{ +} + +template +CORBA::Boolean +TAO::Ret_Var_Array_SArgument_T::marshal ( + TAO_OutputCDR & cdr + ) +{ + return cdr << S_forany (this->x_.ptr ()); +} + +template +void +TAO::Ret_Var_Array_SArgument_T::interceptor_result ( + CORBA::Any * any + ) +{ + (*any) <<= S_forany (this->x_.ptr ()); +} + +template +CORBA::Boolean +TAO::Ret_Var_Array_SArgument_T:: +interceptor_replace (CORBA::Any & any) +{ + S_forany tmp (this->x_.ptr ()); + return any >>= tmp; +} + +template +S_slice *& +TAO::Ret_Var_Array_SArgument_T::arg (void) +{ + return this->x_.out (); +} + +#endif /* TAO_VAR_ARRAY_ARGUMENT_T_C */ diff --git a/TAO/tao/Var_Array_Argument_T.h b/TAO/tao/Var_Array_Argument_T.h new file mode 100644 index 00000000000..506f7da6a61 --- /dev/null +++ b/TAO/tao/Var_Array_Argument_T.h @@ -0,0 +1,271 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file Var_Array_Argument_T.h + * + * $Id$ + * + * @authors Jeff Parsons and Carlos O'Ryan + */ +//============================================================================= + + +#ifndef TAO_VAR_ARRAY_ARGUMENT_T_H +#define TAO_VAR_ARRAY_ARGUMENT_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_Array_Argument_T + * + * @brief IN stub argument of variable size element array. + * + */ + template + class In_Var_Array_Argument_T : public Argument + { + public: + In_Var_Array_Argument_T (const S x); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); + + virtual void interceptor_param (Dynamic::Parameter &); + virtual CORBA::Boolean interceptor_replace (CORBA::Any &); + + private: + S_forany x_; + }; + + /** + * @class Inout_Var_Array_Argument_T + * + * @brief INOUT stub argument of variable size element array. + * + */ + template + class Inout_Var_Array_Argument_T : public Argument + { + public: + Inout_Var_Array_Argument_T (S x); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); + virtual CORBA::Boolean demarshal (TAO_InputCDR &); + + virtual void interceptor_param (Dynamic::Parameter &); + virtual CORBA::Boolean interceptor_replace (CORBA::Any &); + + private: + S_forany x_; + }; + + /** + * @class Out_Var_Array_Argument_T + * + * @brief OUT stub argument of variable size element array. + * + */ + template + class Out_Var_Array_Argument_T : public Argument + { + public: + Out_Var_Array_Argument_T (S_out x); + + virtual CORBA::Boolean demarshal (TAO_InputCDR &); + + private: + S_var x_; + }; + + /** + * @class Ret_Var_Array_Argument_T + * + * @brief Return stub value of variable size element array. + * + */ + template + class Ret_Var_Array_Argument_T : public Argument + { + public: + Ret_Var_Array_Argument_T (void); + + virtual CORBA::Boolean demarshal (TAO_InputCDR &); + + virtual void interceptor_result (CORBA::Any *); + virtual CORBA::Boolean interceptor_replace (CORBA::Any &); + + S_slice * excp (void); + S_slice * retn (void); + + private: + S_var x_; + }; + + /** + * @class In_Var_Array_SArgument_T + * + * @brief IN skeleton argument of variable size element array. + * + */ + template + class In_Var_Array_SArgument_T : public Argument + { + public: + In_Var_Array_SArgument_T (void); + + virtual CORBA::Boolean demarshal (TAO_InputCDR &); + + virtual void interceptor_param (Dynamic::Parameter &); + virtual CORBA::Boolean interceptor_replace (CORBA::Any &); + + const S & arg (void) const; + + private: + S x_; + }; + + /** + * @class Inout_Var_Array_SArgument_T + * + * @brief INOUT skeleton argument of variable size element array. + * + */ + template + class Inout_Var_Array_SArgument_T : public Argument + { + public: + Inout_Var_Array_SArgument_T (void); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); + virtual CORBA::Boolean demarshal (TAO_InputCDR &); + + virtual void interceptor_param (Dynamic::Parameter &); + virtual CORBA::Boolean interceptor_replace (CORBA::Any &); + + S & arg (void); + + private: + S x_; + }; + + /** + * @class Out_Var_Array_SArgument_T + * + * @brief OUT skeleton argument of variable size element array. + * + */ + template + class Out_Var_Array_SArgument_T : public Argument + { + public: + Out_Var_Array_SArgument_T (void); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); + + S_slice *& arg (void); + + private: + S_var x_; + }; + + /** + * @class Ret_Var_Array_SArgument_T + * + * @brief Skeleton value of variable size element array. + * + */ + template + class Ret_Var_Array_SArgument_T : public Argument + { + public: + Ret_Var_Array_SArgument_T (void); + + virtual CORBA::Boolean marshal (TAO_OutputCDR &); + + virtual void interceptor_result (CORBA::Any *); + virtual CORBA::Boolean interceptor_replace (CORBA::Any &); + + S_slice *& arg (void); + + private: + S_var x_; + }; + + /** + * @struct Var_Array_Tag + * + * @brief Struct for variable size element array argument id tag. + * + */ + struct TAO_Export Var_Array_Tag {}; + + /** + * @struct Var_Array_Arg_Traits_T + * + * @brief Argument traits of variable size element array. + * + */ + template + struct Var_Array_Arg_Traits_T + { + typedef T_slice * ret_type; + typedef const T in_type; + typedef T inout_type; + typedef T_out out_type; + + typedef In_Var_Array_Argument_T in_arg_val; + typedef Inout_Var_Array_Argument_T inout_arg_val; + typedef Out_Var_Array_Argument_T out_arg_val; + typedef Ret_Var_Array_Argument_T stub_ret_val; + + typedef In_Var_Array_SArgument_T in_sarg_val; + typedef Inout_Var_Array_SArgument_T inout_sarg_val; + typedef Out_Var_Array_SArgument_T out_sarg_val; + typedef Ret_Var_Array_SArgument_T skel_ret_val; + + typedef Var_Array_Tag idl_tag; + }; +}; + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "tao/Var_Array_Argument_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Var_Array_Argument_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include "ace/post.h" + +#endif /* TAO_VAR_ARRAY_ARGUMENT_T_H */ diff --git a/TAO/tao/Var_Size_Argument_T.cpp b/TAO/tao/Var_Size_Argument_T.cpp index 655cb59e81f..c8e4f40c39f 100644 --- a/TAO/tao/Var_Size_Argument_T.cpp +++ b/TAO/tao/Var_Size_Argument_T.cpp @@ -102,7 +102,7 @@ template CORBA::Boolean TAO::Ret_Var_Size_Argument_T::demarshal (TAO_InputCDR & cdr) { - return cdr >> *this->x_.out (); + return cdr >> *this->x_.inout (); } template @@ -116,7 +116,7 @@ template CORBA::Boolean TAO::Ret_Var_Size_Argument_T::interceptor_replace (CORBA::Any & any) { - return any >>= this->x_.out (); + return any >>= this->x_.inout (); } template -- cgit v1.2.1