Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

CTBgrab.icc

Go to the documentation of this file.
00001 
00006 /*----------------------------------------------------------------------------*/
00007 /* C Tool Box: Designed and implemented by:                                   */
00008 /*    Walter F.J. Mueller   Gesellschaft fuer Schwerionenforschung (GSI)      */
00009 /*                          Planckstrasse 1, D-64291 Darmstadt, Germany       */
00010 /*                  Email:  W.F.J.Mueller@gsi.de                              */
00011 /*                  WWW:    http://www-kp3.gsi.de/www/kp3/people/mueller.html */
00012 /*------------------------------------------+---------------------------------*/
00013 
00014 #include <new.h>
00015 
00072 //------------------------------------------+-----------------------------------
00074 
00075 template <class T>
00076 inline void CTBgrab<T>::Construct(T* p_dst, T& src) const
00077 {
00078   new(p_dst) T(src);
00079   return;
00080 }
00081 
00082 //------------------------------------------+-----------------------------------
00084 
00085 template <class T>
00086 inline void CTBgrab<T>::Destruct(T& dst, T* p_src) const
00087 {
00088   dst = *p_src;
00089   p_src->~T();
00090   return;
00091 }
00092 
00093 //------------------------------------------+-----------------------------------
00095 
00100 template <class T>
00101 inline void CTBgrab<T>::Move(T* p_dst, T* p_src) const
00102 {
00103   new(p_dst) T(*p_src);
00104   p_src->~T();
00105   return;
00106 }
00107 
00108 //------------------------------------------+-----------------------------------
00110 
00111 template <class T>
00112 inline void CTBgrab<T>::Swap(T& v1, T& v2) const
00113 {
00114   T tmp(v1);
00115   v1 = v2;
00116   v2 = tmp;
00117   return;
00118 }
00119 
00120 //------------------------------------------+-----------------------------------
00122 
00123 template <class T>
00124 inline void CTBgrab<T>::operator()(T& dst, T& src) const
00125 {
00126   dst = src;
00127   return;
00128 }
00129 
00130 //##############################################################################
00131 
00142 //------------------------------------------+-----------------------------------
00144 
00145 template <class T>
00146 inline void CTBgrabable<T>::Construct(T* p_dst, T& src) const
00147 {
00148   new(p_dst) T(src,true);
00149   return;
00150 }
00151 
00152 //------------------------------------------+-----------------------------------
00154 
00155 template <class T>
00156 inline void CTBgrabable<T>::Destruct(T& dst, T* p_src) const
00157 {
00158   dst.Grab(*p_src);
00159   p_src->~T();
00160   return;
00161 }
00162 
00163 //------------------------------------------+-----------------------------------
00165 
00170 template <class T>
00171 inline void CTBgrabable<T>::Move(T* p_dst, T* p_src) const
00172 {
00173   new(p_dst) T(*p_src,true);
00174   p_src->~T();
00175   return;
00176 }
00177 
00178 //------------------------------------------+-----------------------------------
00180 
00181 template <class T>
00182 inline void CTBgrabable<T>::Swap(T& v1, T& v2) const
00183 {
00184   T tmp(v1,true);
00185   v1.Grab(v2);
00186   v2.Grab(tmp);
00187   return;
00188 }
00189 
00190 //------------------------------------------+-----------------------------------
00192 
00193 template <class T>
00194 inline void CTBgrabable<T>::operator()(T& dst, T& src) const
00195 {
00196   dst.Grab(src);
00197   return;
00198 }
00199 

Generated at Fri Oct 24 18:11:28 2003 for CTBbase by doxygen1.2.9-20010812 written by Dimitri van Heesch, © 1997-2001