Object_Argument_T.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Object_Argument_T.h
00006  *
00007  *  $Id: Object_Argument_T.h 74007 2006-08-14 12:50:21Z elliott_c $
00008  *
00009  *  @authors Jeff Parsons and Carlos O'Ryan
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_OBJECT_ARGUMENT_T_H
00015 #define TAO_OBJECT_ARGUMENT_T_H
00016 
00017 #include /**/ "ace/pre.h"
00018 
00019 #include "tao/Argument.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00026 
00027 namespace TAO
00028 {
00029   /**
00030    * @class In_Object_Argument_T
00031    *
00032    * @brief Template class for IN object argument.
00033    *
00034    */
00035   template<typename S_ptr,
00036            class Insert_Policy>
00037   class In_Object_Argument_T : public InArgument
00038   {
00039   public:
00040     In_Object_Argument_T (S_ptr x);
00041 
00042     virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);
00043 #if TAO_HAS_INTERCEPTORS == 1
00044     virtual void interceptor_value (CORBA::Any *any) const;
00045 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00046     S_ptr arg (void) const;
00047 
00048   protected:
00049     S_ptr x_;
00050   };
00051 
00052   template<typename S_ptr>
00053   struct In_Object_Argument_Cloner_T
00054   {
00055     static void duplicate(S_ptr objref);
00056     static void release(S_ptr objref);
00057   };
00058 
00059   /**
00060    * @class In_Object_Clonable_Argument_T
00061    *
00062    * @brief Template class for IN object argument.
00063    *
00064    */
00065   template<typename S_ptr,
00066            class Insert_Policy>
00067   class In_Object_Clonable_Argument_T :
00068           public In_Object_Argument_T<S_ptr, Insert_Policy>
00069   {
00070   public:
00071     In_Object_Clonable_Argument_T (S_ptr x);
00072     virtual ~In_Object_Clonable_Argument_T (void);
00073 
00074     virtual Argument* clone (void);
00075 
00076   private:
00077     bool is_clone_;
00078   };
00079 
00080   /**
00081    * @class Inout_Object_Argument_T
00082    *
00083    * @brief Template class for INOUT object argument.
00084    *
00085    */
00086   template<typename S_ptr,
00087            typename S_traits,
00088            class Insert_Policy>
00089   class Inout_Object_Argument_T : public InoutArgument
00090   {
00091   public:
00092     Inout_Object_Argument_T (S_ptr & x);
00093 
00094     virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);
00095     virtual CORBA::Boolean demarshal (TAO_InputCDR &cdr);
00096 #if TAO_HAS_INTERCEPTORS == 1
00097     virtual void interceptor_value (CORBA::Any *any) const;
00098 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00099     S_ptr & arg (void);
00100 
00101   private:
00102     S_ptr & x_;
00103   };
00104 
00105   /**
00106    * @class Out_Object_Argument_T
00107    *
00108    * @brief Template class for OUT object argument.
00109    *
00110    */
00111   template<typename S_ptr,
00112            typename S_out,
00113            class Insert_Policy>
00114   class Out_Object_Argument_T : public OutArgument
00115   {
00116   public:
00117     Out_Object_Argument_T (S_out & x);
00118 
00119     virtual CORBA::Boolean demarshal (TAO_InputCDR &cdr);
00120 #if TAO_HAS_INTERCEPTORS == 1
00121     virtual void interceptor_value (CORBA::Any *any) const;
00122 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00123     S_out arg (void);
00124 
00125   private:
00126     S_ptr & x_;
00127   };
00128 
00129   /**
00130    * @class Ret_Object_Argument_T
00131    *
00132    * @brief Template class for return stub value of object argument.
00133    *
00134    */
00135   template<typename S_ptr,
00136            typename S_var,
00137            class Insert_Policy>
00138   class Ret_Object_Argument_T : public RetArgument
00139   {
00140   public:
00141 
00142     Ret_Object_Argument_T (void);
00143 
00144     virtual CORBA::Boolean demarshal (TAO_InputCDR &);
00145 #if TAO_HAS_INTERCEPTORS == 1
00146     virtual void interceptor_value (CORBA::Any *any) const;
00147 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00148     S_ptr & arg (void);
00149 
00150     S_ptr excp (void);
00151     S_ptr retn (void);
00152 
00153   private:
00154     S_var x_;
00155   };
00156 
00157   /**
00158    * @struct Object_Arg_Traits_T
00159    *
00160    * @brief Template class for stub argument traits of objects.
00161    */
00162   template<typename T_ptr,
00163            typename T_var,
00164            typename T_out,
00165            typename T_traits,
00166            class Insert_Policy>
00167   struct Object_Arg_Traits_T
00168   {
00169     typedef T_ptr                                         ret_type;
00170     typedef T_ptr                                         in_type;
00171     typedef T_ptr &                                       inout_type;
00172     typedef T_out                                         out_type;
00173 
00174     typedef In_Object_Argument_T<T_ptr,
00175                                  Insert_Policy>           in_arg_val;
00176     typedef In_Object_Clonable_Argument_T<T_ptr,
00177                                           Insert_Policy>  in_clonable_arg_val;
00178     typedef Inout_Object_Argument_T<T_ptr,
00179                                     T_traits,
00180                                     Insert_Policy>        inout_arg_val;
00181     typedef Out_Object_Argument_T<T_ptr,
00182                                   T_out,
00183                                   Insert_Policy>          out_arg_val;
00184     typedef Ret_Object_Argument_T<T_ptr,
00185                                   T_var,
00186                                   Insert_Policy>          ret_val;
00187   };
00188 }
00189 
00190 TAO_END_VERSIONED_NAMESPACE_DECL
00191 
00192 #if defined (__ACE_INLINE__)
00193 #include "tao/Object_Argument_T.inl"
00194 #endif /* __ACE_INLINE__ */
00195 
00196 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00197 #include "tao/Object_Argument_T.cpp"
00198 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00199 
00200 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00201 #pragma implementation ("Object_Argument_T.cpp")
00202 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00203 
00204 #include /**/ "ace/post.h"
00205 
00206 #endif /* TAO_OBJECT_ARGUMENT_T_H */

Generated on Tue Feb 2 17:37:52 2010 for TAO by  doxygen 1.4.7