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