Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / tao / Array_VarOut_T.cpp
blobc898e7a09fd6e12f27829acb8395ab72f8242a6b
1 #ifndef TAO_ARRAY_VAROUT_T_CPP
2 #define TAO_ARRAY_VAROUT_T_CPP
4 #include "tao/Array_VarOut_T.h"
6 #if !defined (__ACE_INLINE__)
7 #include "tao/Array_VarOut_T.inl"
8 #endif /* __ACE_INLINE__ */
11 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
13 template<typename T, typename T_slice, typename TAG>
14 TAO_FixedArray_Var_T<T,T_slice,TAG> &
15 TAO_FixedArray_Var_T<T,T_slice,TAG>::operator= (T_slice * p)
17 // Is what we own the same that is being assigned to us?
18 if (this->ptr_ != p)
20 // Delete our stuff and assume ownership of p.
21 TAO::Array_Traits<FORANY>::free (this->ptr_);
22 this->ptr_ = p;
25 return *this;
28 template<typename T, typename T_slice, typename TAG>
29 TAO_FixedArray_Var_T<T,T_slice,TAG> &
30 TAO_FixedArray_Var_T<T,T_slice,TAG>::operator= (
31 const TAO_FixedArray_Var_T<T,T_slice,TAG> & p
34 if (this != &p)
36 TAO::Array_Traits<FORANY>::free (this->ptr_);
38 // Deep copy.
39 this->ptr_ = TAO::Array_Traits<FORANY>::dup (p.in ());
42 return *this;
45 // *************************************************************
47 template<typename T, typename T_slice, typename TAG>
48 TAO_VarArray_Var_T<T,T_slice,TAG> &
49 TAO_VarArray_Var_T<T,T_slice,TAG>::operator= (T_slice * p)
51 // Is what we own the same that is being assigned to us?
52 if (this->ptr_ != p)
54 // Delete our stuff and assume ownership of p.
55 TAO::Array_Traits<FORANY>::free (this->ptr_);
56 this->ptr_ = p;
59 return *this;
62 template<typename T, typename T_slice, typename TAG>
63 TAO_VarArray_Var_T<T,T_slice,TAG> &
64 TAO_VarArray_Var_T<T,T_slice,TAG>::operator= (
65 const TAO_VarArray_Var_T<T,T_slice,TAG> & p
68 if (this != &p)
70 TAO::Array_Traits<FORANY>::free (this->ptr_);
72 // Deep copy.
73 this->ptr_ = TAO::Array_Traits<FORANY>::dup (p.in ());
76 return *this;
79 // *************************************************************
81 template<typename T, typename T_slice, typename TAG>
82 void
83 TAO_Array_Forany_T<T,T_slice,TAG>::_tao_any_destructor (
84 void * _tao_void_pointer
87 T_slice * tmp = static_cast<T_slice *> (_tao_void_pointer);
88 TAO::Array_Traits<FORANY>::free (tmp);
91 TAO_END_VERSIONED_NAMESPACE_DECL
93 #endif /* TAO_ARRAY_VAROUT_T_CPP */