1 #ifndef TAO_VAR_ARRAY_ARGUMENT_T_CPP
2 #define TAO_VAR_ARRAY_ARGUMENT_T_CPP
4 #include "tao/Var_Array_Argument_T.h"
5 #include "tao/Array_Traits_T.h"
7 #if !defined (__ACE_INLINE__)
8 #include "tao/Var_Array_Argument_T.inl"
9 #endif /* __ACE_INLINE__ */
11 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
13 template<typename S_forany
,
14 template <typename
> class Insert_Policy
>
16 TAO::In_Var_Array_Argument_T
<S_forany
,Insert_Policy
>::marshal (
20 return cdr
<< this->x_
;
23 #if TAO_HAS_INTERCEPTORS == 1
25 template<typename S_forany
,
26 template <typename
> class Insert_Policy
>
28 TAO::In_Var_Array_Argument_T
<S_forany
,Insert_Policy
>::interceptor_value (
29 CORBA::Any
*any
) const
31 Insert_Policy
<S_forany
>::any_insert (any
, this->x_
);
34 #endif /* TAO_HAS_INTERCEPTORS */
36 template<typename S_forany
,
37 template <typename
> class Insert_Policy
>
38 TAO::In_Var_Array_Clonable_Argument_T
<S_forany
,Insert_Policy
>::~In_Var_Array_Clonable_Argument_T ()
42 typedef TAO::details::array_traits
<S_forany
> ARRAY_TRAITS
;
43 typename
ARRAY_TRAITS::slice_type
* tmp
=
44 const_cast<typename
ARRAY_TRAITS::slice_type
*> (this->x_
.in ());
45 ARRAY_TRAITS::free (tmp
);
49 template<typename S_forany
,
50 template <typename
> class Insert_Policy
>
52 TAO::In_Var_Array_Clonable_Argument_T
<S_forany
,Insert_Policy
>::clone ()
54 typedef TAO::details::array_traits
<S_forany
> ARRAY_TRAITS
;
55 typename
ARRAY_TRAITS::slice_type
* tmp_ptr
= 0;
56 ACE_ALLOCATOR_RETURN (tmp_ptr
,
57 ARRAY_TRAITS::alloc (),
59 ARRAY_TRAITS::copy(tmp_ptr
, this->x_
.in ());
61 In_Var_Array_Clonable_Argument_T
<S_forany
,Insert_Policy
>* clone_arg
62 = new In_Var_Array_Clonable_Argument_T
<S_forany
,Insert_Policy
> (tmp_ptr
);
63 clone_arg
->is_clone_
= true;
67 // ===========================================================
69 template<typename S_forany
,
70 template <typename
> class Insert_Policy
>
72 TAO::Inout_Var_Array_Argument_T
<S_forany
,Insert_Policy
>::marshal (
76 return cdr
<< this->x_
;
79 template<typename S_forany
,
80 template <typename
> class Insert_Policy
>
82 TAO::Inout_Var_Array_Argument_T
<S_forany
,Insert_Policy
>::demarshal (
86 return cdr
>> this->x_
;
89 #if TAO_HAS_INTERCEPTORS == 1
91 template<typename S_forany
,
92 template <typename
> class Insert_Policy
>
94 TAO::Inout_Var_Array_Argument_T
<S_forany
,Insert_Policy
>::interceptor_value (
95 CORBA::Any
*any
) const
97 Insert_Policy
<S_forany
>::any_insert (any
, this->x_
);
100 #endif /* TAO_HAS_INTERCEPTORS */
102 // ==============================================================
104 template<typename S_out
,
106 template <typename
> class Insert_Policy
>
108 TAO::Out_Var_Array_Argument_T
<S_out
,S_forany
,Insert_Policy
>::demarshal (
112 typedef TAO::Array_Traits
<S_forany
> ARRAY_TRAITS
;
113 ACE_ALLOCATOR_RETURN (this->x_
,
114 ARRAY_TRAITS::alloc (),
116 S_forany
tmp (this->x_
);
120 #if TAO_HAS_INTERCEPTORS == 1
122 template<typename S_out
,
124 template <typename
> class Insert_Policy
>
126 TAO::Out_Var_Array_Argument_T
<S_out
,S_forany
,Insert_Policy
>::
127 interceptor_value (CORBA::Any
*any
) const
129 S_forany
tmp (this->x_
);
130 Insert_Policy
<S_forany
>::any_insert (any
, tmp
);
133 #endif /* TAO_HAS_INTERCEPTORS */
135 // ============================================================
137 template<typename S_var
,
139 template <typename
> class Insert_Policy
>
141 TAO::Ret_Var_Array_Argument_T
<S_var
,S_forany
,Insert_Policy
>::demarshal (
145 typedef TAO::Array_Traits
<S_forany
> ARRAY_TRAITS
;
146 typename
S_forany::_slice_type
* tmp_ptr
= 0;
147 ACE_ALLOCATOR_RETURN (tmp_ptr
,
148 ARRAY_TRAITS::alloc (),
151 S_forany
tmp (this->x_
.ptr ());
155 #if TAO_HAS_INTERCEPTORS == 1
157 template<typename S_var
,
159 template <typename
> class Insert_Policy
>
161 TAO::Ret_Var_Array_Argument_T
<S_var
,S_forany
,Insert_Policy
>::
162 interceptor_value (CORBA::Any
*any
) const
164 Insert_Policy
<S_forany
>::any_insert (any
, S_forany (this->x_
.ptr ()));
167 #endif /* TAO_HAS_INTERCEPTORS */
169 TAO_END_VERSIONED_NAMESPACE_DECL
171 #endif /* TAO_VAR_ARRAY_ARGUMENT_T_CPP */