Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Array_VarOut_T.cpp
blob5abf7c56b6ec7616039c9a22ae37778a947cc106
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__ */
10 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
12 template<typename T, typename T_slice, typename TAG>
13 TAO_FixedArray_Var_T<T,T_slice,TAG> &
14 TAO_FixedArray_Var_T<T,T_slice,TAG>::operator= (T_slice * p)
16 // Is what we own the same that is being assigned to us?
17 if (this->ptr_ != p)
19 // Delete our stuff and assume ownership of p.
20 TAO::Array_Traits<FORANY>::free (this->ptr_);
21 this->ptr_ = p;
24 return *this;
27 template<typename T, typename T_slice, typename TAG>
28 TAO_FixedArray_Var_T<T,T_slice,TAG> &
29 TAO_FixedArray_Var_T<T,T_slice,TAG>::operator= (
30 const TAO_FixedArray_Var_T<T,T_slice,TAG> & p)
32 if (this != &p)
34 TAO::Array_Traits<FORANY>::free (this->ptr_);
36 // Deep copy.
37 this->ptr_ = TAO::Array_Traits<FORANY>::dup (p.in ());
40 return *this;
43 // *************************************************************
45 template<typename T, typename T_slice, typename TAG>
46 TAO_VarArray_Var_T<T,T_slice,TAG> &
47 TAO_VarArray_Var_T<T,T_slice,TAG>::operator= (T_slice * p)
49 // Is what we own the same that is being assigned to us?
50 if (this->ptr_ != p)
52 // Delete our stuff and assume ownership of p.
53 TAO::Array_Traits<FORANY>::free (this->ptr_);
54 this->ptr_ = p;
57 return *this;
60 template<typename T, typename T_slice, typename TAG>
61 TAO_VarArray_Var_T<T,T_slice,TAG> &
62 TAO_VarArray_Var_T<T,T_slice,TAG>::operator= (
63 const TAO_VarArray_Var_T<T,T_slice,TAG> & p)
65 if (this != &p)
67 TAO::Array_Traits<FORANY>::free (this->ptr_);
69 // Deep copy.
70 this->ptr_ = TAO::Array_Traits<FORANY>::dup (p.in ());
73 return *this;
76 // *************************************************************
78 template<typename T, typename T_slice, typename TAG>
79 void
80 TAO_Array_Forany_T<T,T_slice,TAG>::_tao_any_destructor (
81 void * _tao_void_pointer)
83 T_slice * tmp = static_cast<T_slice *> (_tao_void_pointer);
84 TAO::Array_Traits<FORANY>::free (tmp);
87 TAO_END_VERSIONED_NAMESPACE_DECL
89 #endif /* TAO_ARRAY_VAROUT_T_CPP */