Fixed_Array_Argument_T.cpp

Go to the documentation of this file.
00001 // $Id: Fixed_Array_Argument_T.cpp 74007 2006-08-14 12:50:21Z elliott_c $
00002 
00003 #ifndef TAO_FIXED_ARRAY_ARGUMENT_T_CPP
00004 #define TAO_FIXED_ARRAY_ARGUMENT_T_CPP
00005 
00006 #include "tao/Fixed_Array_Argument_T.h"
00007 
00008 #if !defined (__ACE_INLINE__)
00009 #include "tao/Fixed_Array_Argument_T.inl"
00010 #endif /* __ACE_INLINE__ */
00011 
00012 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00013 
00014 template<typename S_forany,
00015          class Insert_Policy>
00016 CORBA::Boolean
00017 TAO::In_Fixed_Array_Argument_T<S_forany,Insert_Policy>::marshal (
00018     TAO_OutputCDR & cdr
00019   )
00020 {
00021   return cdr << this->x_;
00022 }
00023 
00024 #if TAO_HAS_INTERCEPTORS == 1
00025 
00026 template<typename S_forany,
00027          class Insert_Policy>
00028 void
00029 TAO::In_Fixed_Array_Argument_T<S_forany,Insert_Policy>::
00030   interceptor_value (CORBA::Any *any) const
00031 {
00032   Insert_Policy::any_insert (any, this->x_);
00033 }
00034 
00035 #endif /* TAO_HAS_INTERCEPTORS */
00036 
00037 template<typename S_forany,
00038          class Insert_Policy>
00039 TAO::In_Fixed_Array_Clonable_Argument_T<S_forany,Insert_Policy>::~In_Fixed_Array_Clonable_Argument_T (void)
00040 {
00041   if (this->is_clone_)
00042     {
00043       typedef TAO::details::array_traits<S_forany> ARRAY_TRAITS;
00044       typename ARRAY_TRAITS::slice_type * tmp =
00045                const_cast<typename ARRAY_TRAITS::slice_type *>(this->x_.in ());
00046       ARRAY_TRAITS::free (tmp);
00047     }
00048 }
00049 
00050 template<typename S_forany,
00051          class Insert_Policy>
00052 TAO::Argument*
00053 TAO::In_Fixed_Array_Clonable_Argument_T<S_forany,Insert_Policy>::clone (void)
00054 {
00055   typedef TAO::details::array_traits<S_forany> ARRAY_TRAITS;
00056   typename ARRAY_TRAITS::slice_type * tmp_ptr = 0;
00057   ACE_ALLOCATOR_RETURN (tmp_ptr,
00058                         ARRAY_TRAITS::alloc (),
00059                         0);
00060   ARRAY_TRAITS::copy (tmp_ptr, this->x_.in ());
00061 
00062   In_Fixed_Array_Clonable_Argument_T<S_forany,Insert_Policy>* clone_arg
00063     = new In_Fixed_Array_Clonable_Argument_T<S_forany,Insert_Policy> (tmp_ptr);
00064   clone_arg->is_clone_ = true;
00065   return clone_arg;
00066 }
00067 
00068 // ===========================================================
00069 
00070 template<typename S_forany,
00071          class Insert_Policy>
00072 CORBA::Boolean
00073 TAO::Inout_Fixed_Array_Argument_T<S_forany,Insert_Policy>::marshal (
00074     TAO_OutputCDR & cdr
00075   )
00076 {
00077   return cdr << this->x_;
00078 }
00079 
00080 template<typename S_forany,
00081          class Insert_Policy>
00082 CORBA::Boolean
00083 TAO::Inout_Fixed_Array_Argument_T<S_forany,Insert_Policy>::demarshal (
00084     TAO_InputCDR & cdr
00085   )
00086 {
00087   return cdr >> this->x_;
00088 }
00089 
00090 #if TAO_HAS_INTERCEPTORS == 1
00091 
00092 template<typename S_forany,
00093          class Insert_Policy>
00094 void
00095 TAO::Inout_Fixed_Array_Argument_T<S_forany,Insert_Policy>::
00096   interceptor_value (CORBA::Any *any) const
00097 {
00098   Insert_Policy::any_insert (any, this->x_);
00099 }
00100 
00101 #endif /* TAO_HAS_INTERCEPTORS */
00102 
00103 // ==============================================================
00104 
00105 template<typename S_forany,
00106          class Insert_Policy>
00107 CORBA::Boolean
00108 TAO::Out_Fixed_Array_Argument_T<S_forany,Insert_Policy>::demarshal (
00109     TAO_InputCDR & cdr)
00110 {
00111   return cdr >> this->x_;
00112 }
00113 
00114 #if TAO_HAS_INTERCEPTORS == 1
00115 
00116 template<typename S_forany,
00117          class Insert_Policy>
00118 void
00119 TAO::Out_Fixed_Array_Argument_T<S_forany,Insert_Policy>::
00120   interceptor_value (CORBA::Any *any) const
00121 {
00122   Insert_Policy::any_insert (any, this->x_);
00123 }
00124 
00125 #endif /* TAO_HAS_INTERCEPTORS */
00126 
00127 // ============================================================
00128 
00129 template<typename S_var,
00130          typename S_forany,
00131          class Insert_Policy>
00132 CORBA::Boolean
00133 TAO::Ret_Fixed_Array_Argument_T<S_var,S_forany,Insert_Policy>::
00134   demarshal (TAO_InputCDR & cdr)
00135 {
00136   typedef TAO::Array_Traits<S_forany> ARRAY_TRAITS;
00137   typename S_forany::_slice_type * tmp_ptr = 0;
00138   ACE_ALLOCATOR_RETURN (tmp_ptr,
00139                         ARRAY_TRAITS::alloc (),
00140                         false);
00141   this->x_ = tmp_ptr;
00142   S_forany tmp (this->x_.ptr ());
00143   return cdr >> tmp;
00144 }
00145 
00146 #if TAO_HAS_INTERCEPTORS == 1
00147 
00148 template<typename S_var,
00149          typename S_forany,
00150          class Insert_Policy>
00151 void
00152 TAO::Ret_Fixed_Array_Argument_T<S_var,S_forany,Insert_Policy>::
00153 interceptor_value (CORBA::Any *any) const
00154 {
00155   Insert_Policy::any_insert (any, S_forany (this->x_.ptr ()));
00156 }
00157 
00158 #endif /* TAO_HAS_INTERCEPTORS */
00159 
00160 TAO_END_VERSIONED_NAMESPACE_DECL
00161 
00162 #endif /* TAO_FIXED_ARRAY_ARGUMENT_T_CPP */

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