Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Fixed_Array_Argument_T.cpp
blobcf0775a23759d1fd3dd7a531b951df3879cdb67b
1 #ifndef TAO_FIXED_ARRAY_ARGUMENT_T_CPP
2 #define TAO_FIXED_ARRAY_ARGUMENT_T_CPP
4 #include "tao/Fixed_Array_Argument_T.h"
6 #if !defined (__ACE_INLINE__)
7 #include "tao/Fixed_Array_Argument_T.inl"
8 #endif /* __ACE_INLINE__ */
10 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
12 template<typename S_forany,
13 template <typename> class Insert_Policy>
14 CORBA::Boolean
15 TAO::In_Fixed_Array_Argument_T<S_forany,Insert_Policy>::marshal (
16 TAO_OutputCDR & cdr)
18 return cdr << this->x_;
21 #if TAO_HAS_INTERCEPTORS == 1
23 template<typename S_forany,
24 template <typename> class Insert_Policy>
25 void
26 TAO::In_Fixed_Array_Argument_T<S_forany,Insert_Policy>::
27 interceptor_value (CORBA::Any *any) const
29 Insert_Policy<S_forany>::any_insert (any, this->x_);
32 #endif /* TAO_HAS_INTERCEPTORS */
34 template<typename S_forany,
35 template <typename> class Insert_Policy>
36 TAO::In_Fixed_Array_Clonable_Argument_T<S_forany,Insert_Policy>::~In_Fixed_Array_Clonable_Argument_T ()
38 if (this->is_clone_)
40 typedef TAO::details::array_traits<S_forany> ARRAY_TRAITS;
41 typename ARRAY_TRAITS::slice_type * tmp =
42 const_cast<typename ARRAY_TRAITS::slice_type *>(this->x_.in ());
43 ARRAY_TRAITS::free (tmp);
47 template<typename S_forany,
48 template <typename> class Insert_Policy>
49 TAO::Argument*
50 TAO::In_Fixed_Array_Clonable_Argument_T<S_forany,Insert_Policy>::clone ()
52 typedef TAO::details::array_traits<S_forany> ARRAY_TRAITS;
53 typename ARRAY_TRAITS::slice_type * tmp_ptr = 0;
54 ACE_ALLOCATOR_RETURN (tmp_ptr,
55 ARRAY_TRAITS::alloc (),
56 0);
57 ARRAY_TRAITS::copy (tmp_ptr, this->x_.in ());
59 In_Fixed_Array_Clonable_Argument_T<S_forany,Insert_Policy>* clone_arg
60 = new In_Fixed_Array_Clonable_Argument_T<S_forany,Insert_Policy> (tmp_ptr);
61 clone_arg->is_clone_ = true;
62 return clone_arg;
65 // ===========================================================
67 template<typename S_forany,
68 template <typename> class Insert_Policy>
69 CORBA::Boolean
70 TAO::Inout_Fixed_Array_Argument_T<S_forany,Insert_Policy>::marshal (
71 TAO_OutputCDR & cdr)
73 return cdr << this->x_;
76 template<typename S_forany,
77 template <typename> class Insert_Policy>
78 CORBA::Boolean
79 TAO::Inout_Fixed_Array_Argument_T<S_forany,Insert_Policy>::demarshal (
80 TAO_InputCDR & cdr)
82 return cdr >> this->x_;
85 #if TAO_HAS_INTERCEPTORS == 1
87 template<typename S_forany,
88 template <typename> class Insert_Policy>
89 void
90 TAO::Inout_Fixed_Array_Argument_T<S_forany,Insert_Policy>::
91 interceptor_value (CORBA::Any *any) const
93 Insert_Policy<S_forany>::any_insert (any, this->x_);
96 #endif /* TAO_HAS_INTERCEPTORS */
98 // ==============================================================
100 template<typename S_forany,
101 template <typename> class Insert_Policy>
102 CORBA::Boolean
103 TAO::Out_Fixed_Array_Argument_T<S_forany,Insert_Policy>::demarshal (
104 TAO_InputCDR & cdr)
106 return cdr >> this->x_;
109 #if TAO_HAS_INTERCEPTORS == 1
111 template<typename S_forany,
112 template <typename> class Insert_Policy>
113 void
114 TAO::Out_Fixed_Array_Argument_T<S_forany,Insert_Policy>::
115 interceptor_value (CORBA::Any *any) const
117 Insert_Policy<S_forany>::any_insert (any, this->x_);
120 #endif /* TAO_HAS_INTERCEPTORS */
122 // ============================================================
124 template<typename S_var,
125 typename S_forany,
126 template <typename> class Insert_Policy>
127 CORBA::Boolean
128 TAO::Ret_Fixed_Array_Argument_T<S_var,S_forany,Insert_Policy>::
129 demarshal (TAO_InputCDR & cdr)
131 typedef TAO::Array_Traits<S_forany> ARRAY_TRAITS;
132 typename S_forany::_slice_type * tmp_ptr = 0;
133 ACE_ALLOCATOR_RETURN (tmp_ptr,
134 ARRAY_TRAITS::alloc (),
135 false);
136 this->x_ = tmp_ptr;
137 S_forany tmp (this->x_.ptr ());
138 return cdr >> tmp;
141 #if TAO_HAS_INTERCEPTORS == 1
143 template<typename S_var,
144 typename S_forany,
145 template <typename> class Insert_Policy>
146 void
147 TAO::Ret_Fixed_Array_Argument_T<S_var,S_forany,Insert_Policy>::
148 interceptor_value (CORBA::Any *any) const
150 Insert_Policy<S_forany>::any_insert (any, S_forany (this->x_.ptr ()));
153 #endif /* TAO_HAS_INTERCEPTORS */
155 TAO_END_VERSIONED_NAMESPACE_DECL
157 #endif /* TAO_FIXED_ARRAY_ARGUMENT_T_CPP */