VarOut_T.cpp

Go to the documentation of this file.
00001 // VarOut_T.cpp,v 1.7 2005/11/24 11:05:46 ossama Exp
00002 
00003 #ifndef TAO_VAROUT_T_CPP
00004 #define TAO_VAROUT_T_CPP
00005 
00006 #include "tao/VarOut_T.h"
00007 
00008 #if !defined (__ACE_INLINE__)
00009 #include "tao/VarOut_T.inl"
00010 #endif /* __ACE_INLINE__ */
00011 
00012 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00013 
00014 template<typename T>
00015 TAO_Var_Base_T<T>::TAO_Var_Base_T (const TAO_Var_Base_T<T> & p)
00016   : ptr_ (p.ptr_ ? new T (*p.ptr_) : 0)
00017 {
00018 }
00019 
00020 // *************************************************************
00021 
00022 template<typename T>
00023 TAO_Fixed_Var_T<T> &
00024 TAO_Fixed_Var_T<T>::operator= (const TAO_Fixed_Var_T<T> & p)
00025 {
00026   // Strongly exception safe assignment using copy and non-throwing
00027   // swap technique.
00028   TAO_Fixed_Var_T<T> tmp (p);
00029 
00030   T * old_ptr = this->ptr_;
00031   this->ptr_ = tmp.ptr_;
00032   tmp.ptr_ = old_ptr;
00033 
00034   return *this;
00035 }
00036 
00037 // Fixed-size types only.
00038 template<typename T>
00039 TAO_Fixed_Var_T<T> &
00040 TAO_Fixed_Var_T<T>::operator= (const T & p)
00041 {
00042   // Strongly exception safe assignment using copy and non-throwing
00043   // swap technique.
00044   TAO_Fixed_Var_T<T> tmp (p);
00045 
00046   T * old_ptr = this->ptr_;
00047   this->ptr_ = tmp.ptr_;
00048   tmp.ptr_ = old_ptr;
00049 
00050   return *this;
00051 }
00052 
00053 // *************************************************************
00054 
00055 template<typename T>
00056 TAO_Var_Var_T<T> &
00057 TAO_Var_Var_T<T>::operator= (const TAO_Var_Var_T<T> & p)
00058 {
00059   // Strongly exception safe assignment using copy and non-throwing
00060   // swap technique.
00061   TAO_Var_Var_T<T> tmp (p);
00062 
00063   T * old_ptr = this->ptr_;
00064   this->ptr_ = tmp.ptr_;
00065   tmp.ptr_ = old_ptr;
00066 
00067   return *this;
00068 }
00069 
00070 TAO_END_VERSIONED_NAMESPACE_DECL
00071 
00072 #endif /* TAO_VAROUT_T_CPP */

Generated on Thu Nov 9 11:54:28 2006 for TAO by doxygen 1.3.6