Var_Size_Argument_T.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Var_Size_Argument_T.h
00006  *
00007  *  Var_Size_Argument_T.h,v 1.11 2006/06/27 06:22:00 jwillemsen Exp
00008  *
00009  *  @authors Jeff Parsons and Carlos O'Ryan
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_VAR_SIZE_ARGUMENT_T_H
00014 #define TAO_VAR_SIZE_ARGUMENT_T_H
00015 
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "tao/Argument.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00025 
00026 namespace TAO
00027 {
00028   /**
00029    * @class In_Var_Size_Argument_T
00030    *
00031    * @brief Template class for IN stub argument of fixed size IDL types.
00032    *
00033    */
00034   template<typename S,
00035            class Insert_Policy>
00036   class In_Var_Size_Argument_T : public InArgument
00037   {
00038   public:
00039     In_Var_Size_Argument_T (S const & x);
00040 
00041     virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);
00042 #if TAO_HAS_INTERCEPTORS == 1
00043     virtual void interceptor_value (CORBA::Any *any) const;
00044 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00045     S const & arg (void) const;
00046 
00047   private:
00048     const S * x_;
00049   };
00050 
00051   /**
00052    * @class Inout_Var_Size_Argument_T
00053    *
00054    * @brief Template class for INOUT stub argument of fixed size IDL types.
00055    *
00056    */
00057   template<typename S,
00058            class Insert_Policy>
00059   class Inout_Var_Size_Argument_T : public InoutArgument
00060   {
00061   public:
00062     Inout_Var_Size_Argument_T (S & x);
00063 
00064     virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);
00065     virtual CORBA::Boolean demarshal (TAO_InputCDR &);
00066 #if TAO_HAS_INTERCEPTORS == 1
00067     virtual void interceptor_value (CORBA::Any *any) const;
00068 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00069     S & arg (void);
00070 
00071   private:
00072     S * x_;
00073   };
00074 
00075   /**
00076    * @class Out_Var_Size_Argument_T
00077    *
00078    * @brief Template class for OUT stub argument of fixed size IDL types.
00079    *
00080    */
00081   template<typename S,
00082            class Insert_Policy>
00083   class Out_Var_Size_Argument_T : public OutArgument
00084   {
00085   public:
00086     Out_Var_Size_Argument_T (typename S::_out_type x);
00087 
00088     virtual CORBA::Boolean demarshal (TAO_InputCDR &);
00089 #if TAO_HAS_INTERCEPTORS == 1
00090     virtual void interceptor_value (CORBA::Any *any) const;
00091 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00092     S *& arg (void);
00093 
00094   private:
00095     S *& x_;
00096   };
00097 
00098   /**
00099    * @class Ret_Var_Size_Argument_T
00100    *
00101    * @brief Template class for return stub value of fixed size IDL types.
00102    *
00103    */
00104   template<typename S,
00105            class Insert_Policy>
00106   class Ret_Var_Size_Argument_T : public RetArgument
00107   {
00108   public:
00109     Ret_Var_Size_Argument_T (void);
00110 
00111     virtual CORBA::Boolean demarshal (TAO_InputCDR &);
00112 #if TAO_HAS_INTERCEPTORS == 1
00113     virtual void interceptor_value (CORBA::Any *any) const;
00114 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00115     S *& arg (void);
00116 
00117     S * excp (void);
00118     S * retn (void);
00119 
00120   protected:
00121     typename S::_var_type x_;
00122   };
00123 
00124   /**
00125    * @struct Var_Size_Arg_Traits_T
00126    *
00127    * @brief Template class for stub argument traits of
00128    *  variable size IDL types.
00129    *
00130    */
00131   template<typename T,
00132            class Insert_Policy>
00133   struct Var_Size_Arg_Traits_T
00134   {
00135     typedef T *                                         ret_type;
00136     typedef T const &                                   in_type;
00137     typedef T &                                         inout_type;
00138     typedef typename T::_out_type                       out_type;
00139 
00140     typedef In_Var_Size_Argument_T<T, Insert_Policy>    in_arg_val;
00141     typedef Inout_Var_Size_Argument_T<T, Insert_Policy> inout_arg_val;
00142     typedef Out_Var_Size_Argument_T<T, Insert_Policy>   out_arg_val;
00143     typedef Ret_Var_Size_Argument_T<T, Insert_Policy>   ret_val;
00144   };
00145 }
00146 
00147 TAO_END_VERSIONED_NAMESPACE_DECL
00148 
00149 #if defined (__ACE_INLINE__)
00150 #include "tao/Var_Size_Argument_T.inl"
00151 #endif /* __ACE_INLINE__ */
00152 
00153 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00154 #include "tao/Var_Size_Argument_T.cpp"
00155 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00156 
00157 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00158 #pragma implementation ("Var_Size_Argument_T.cpp")
00159 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00160 
00161 #include /**/ "ace/post.h"
00162 
00163 #endif /* TAO_VAR_SIZE_ARGUMENT_T_H */

Generated on Thu Nov 9 11:54:28 2006 for TAO by doxygen 1.3.6