diff options
author | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-08-14 12:50:21 +0000 |
---|---|---|
committer | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-08-14 12:50:21 +0000 |
commit | 5db10f1e77c6c38e34f1368fc205ee422ff7021d (patch) | |
tree | 9d76b7710d5f6320f4e3a3d958c0807374059250 /TAO/tao/Var_Array_Argument_T.cpp | |
parent | a31c4c0cd6e038e4edc95d73492a2adcc41bef58 (diff) | |
download | ATCD-5db10f1e77c6c38e34f1368fc205ee422ff7021d.tar.gz |
ChangeLogTag: Mon Aug 14 12:49:11 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/tao/Var_Array_Argument_T.cpp')
-rw-r--r-- | TAO/tao/Var_Array_Argument_T.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/TAO/tao/Var_Array_Argument_T.cpp b/TAO/tao/Var_Array_Argument_T.cpp index eccb201ae85..89dbefa6187 100644 --- a/TAO/tao/Var_Array_Argument_T.cpp +++ b/TAO/tao/Var_Array_Argument_T.cpp @@ -34,6 +34,37 @@ TAO::In_Var_Array_Argument_T<S_forany,Insert_Policy>::interceptor_value ( #endif /* TAO_HAS_INTERCEPTORS */ +template<typename S_forany, + class Insert_Policy> +TAO::In_Var_Array_Clonable_Argument_T<S_forany,Insert_Policy>::~In_Var_Array_Clonable_Argument_T (void) +{ + if (this->is_clone_) + { + typedef TAO::details::array_traits<S_forany> ARRAY_TRAITS; + typename ARRAY_TRAITS::slice_type * tmp = + const_cast<typename ARRAY_TRAITS::slice_type*> (this->x_.in ()); + ARRAY_TRAITS::free (tmp); + } +} + +template<typename S_forany, + class Insert_Policy> +TAO::Argument* +TAO::In_Var_Array_Clonable_Argument_T<S_forany,Insert_Policy>::clone (void) +{ + typedef TAO::details::array_traits<S_forany> ARRAY_TRAITS; + typename ARRAY_TRAITS::slice_type * tmp_ptr = 0; + ACE_ALLOCATOR_RETURN (tmp_ptr, + ARRAY_TRAITS::alloc (), + 0); + ARRAY_TRAITS::copy(tmp_ptr, this->x_.in ()); + + In_Var_Array_Clonable_Argument_T<S_forany,Insert_Policy>* clone_arg + = new In_Var_Array_Clonable_Argument_T<S_forany,Insert_Policy> (tmp_ptr); + clone_arg->is_clone_ = true; + return clone_arg; +} + // =========================================================== template<typename S_forany, |