00001 // $Id: Seq_Var_T.cpp 74154 2006-08-21 18:40:48Z johnnyw $ 00002 00003 #ifndef TAO_SEQ_VAR_T_CPP 00004 #define TAO_SEQ_VAR_T_CPP 00005 00006 #include "tao/Seq_Var_T.h" 00007 00008 #if !defined (__ACE_INLINE__) 00009 #include "tao/Seq_Var_T.inl" 00010 #endif /* __ACE_INLINE__ */ 00011 00012 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00013 00014 template<typename T> 00015 TAO_Seq_Var_Base_T<T>::TAO_Seq_Var_Base_T ( 00016 const TAO_Seq_Var_Base_T<T> & p) 00017 : ptr_ (p.ptr_ ? new T (*p.ptr_) : 0) 00018 { 00019 } 00020 00021 // **************************************************************************** 00022 00023 template<typename T> 00024 TAO_FixedSeq_Var_T<T> & 00025 TAO_FixedSeq_Var_T<T>::operator= ( 00026 const TAO_FixedSeq_Var_T<T> & p) 00027 { 00028 // Strongly exception safe assignment using copy and non-throwing 00029 // swap technique. 00030 TAO_FixedSeq_Var_T<T> tmp (p); 00031 00032 T * old_ptr = this->ptr_; 00033 this->ptr_ = tmp.ptr_; 00034 tmp.ptr_ = old_ptr; 00035 00036 return *this; 00037 } 00038 00039 // Fixed-size types only. 00040 template<typename T> 00041 TAO_FixedSeq_Var_T<T> & 00042 TAO_FixedSeq_Var_T<T>::operator= (const T & p) 00043 { 00044 // Strongly exception safe assignment using copy and non-throwing 00045 // swap technique. 00046 TAO_FixedSeq_Var_T<T> tmp (p); 00047 00048 T * old_ptr = this->ptr_; 00049 this->ptr_ = tmp.ptr_; 00050 tmp.ptr_ = old_ptr; 00051 00052 return *this; 00053 } 00054 00055 // **************************************************************************** 00056 00057 template<typename T> 00058 TAO_VarSeq_Var_T<T> & 00059 TAO_VarSeq_Var_T<T>::operator= (const TAO_VarSeq_Var_T<T> & p) 00060 { 00061 // Strongly exception safe assignment using copy and non-throwing 00062 // swap technique. 00063 TAO_VarSeq_Var_T<T> tmp (p); 00064 00065 T * old_ptr = this->ptr_; 00066 this->ptr_ = tmp.ptr_; 00067 tmp.ptr_ = old_ptr; 00068 00069 return *this; 00070 } 00071 00072 TAO_END_VERSIONED_NAMESPACE_DECL 00073 00074 #endif /* TAO_SEQ_VAR_T_CPP */