Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGMFieldVector.inl

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 OSG_BEGIN_NAMESPACE
00040 
00041 #if defined(OSG_LINUX_ICC) && !defined(OSG_ICC_GNU_COMPAT)
00042 #    define MYFIRST _Myfirst
00043 #    define MYLAST  _Mylast
00044 #    define MYEND   _Myend
00045 #elif defined(OSG_SGI_CC) 
00046 #    define MYFIRST _M_start
00047 #    define MYLAST  _M_finish
00048 #    define MYEND   _M_end_of_storage
00049 #elif defined(OSG_LINUX_GCC)
00050 #    if __GNUC__ == 3 && __GNUC_MINOR__ >= 4
00051 #        define MYFIRST _M_impl._M_start
00052 #        define MYLAST  _M_impl._M_finish
00053 #        define MYEND   _M_impl._M_end_of_storage
00054 #    else
00055 #        define MYFIRST _M_start
00056 #        define MYLAST  _M_finish
00057 #        define MYEND   _M_end_of_storage
00058 #    endif
00059 #else
00060 #    define MYFIRST _Myfirst
00061 #    define MYLAST  _Mylast
00062 #    define MYEND   _Myend
00063 #endif
00064 
00065 #if defined(__sgi) || defined(__linux) || defined(darwin) || \
00066     defined(__sun) || defined(__hpux)
00067 
00068 
00069 template <class Tp, class Alloc> inline
00070 MFieldVector<Tp, Alloc>::MFieldVector(const allocator_type& __a) :
00071     Inherited(__a) 
00072 {
00073 }
00074 
00075 template <class Tp, class Alloc> inline
00076 MFieldVector<Tp, Alloc>::MFieldVector(      size_type       __n, 
00077                                       const Tp             &__value,
00078                                       const allocator_type &__a    ) :
00079     Inherited(__n, __value, __a)
00080 {
00081 }
00082     
00083 template <class Tp, class Alloc> inline
00084 MFieldVector<Tp, Alloc>::MFieldVector(size_type __n) :
00085     Inherited(__n)
00086 {
00087 }
00088     
00089 template <class Tp, class Alloc> inline
00090 MFieldVector<Tp, Alloc>::MFieldVector(const std::vector<Tp, Alloc>& __x) :
00091     Inherited(__x)
00092 {
00093 }
00094 
00095 template <class Tp, class Alloc> inline
00096 MFieldVector<Tp, Alloc>::MFieldVector(const MFieldVector<Tp, Alloc>& __x) :
00097     Inherited(__x)
00098 {
00099 }
00100 
00101 #ifdef __STL_MEMBER_TEMPLATES
00102   // Check whether it's an integral type.  If so, it's not an iterator.
00103 template <class Tp, class Alloc> 
00104 template <class InputIterator> inline
00105 MFieldVector<Tp, Alloc>::MFieldVector(      InputIterator   __first, 
00106                                             InputIterator   __last,
00107                                       const allocator_type &__a    ) :
00108     Inherited(__first, __last, __a) 
00109 {
00110 }
00111 
00112 #else
00113 
00114 template <class Tp, class Alloc> inline
00115 MFieldVector<Tp, Alloc>::MFieldVector(const Tp             *__first, 
00116                                       const Tp             *__last,
00117                                       const allocator_type &__a    ) :
00118     Inherited(__first, __last, __a) 
00119 {
00120 }
00121 
00122 #endif /* __STL_MEMBER_TEMPLATES */
00123 
00124 template <class Tp, class Alloc> inline
00125 MFieldVector<Tp, Alloc>::~MFieldVector() 
00126 {
00127 }
00128 
00129 template <class Tp, class Alloc> inline
00130 void MFieldVector<Tp, Alloc>::shareValues(Self &other, bool bDeleteOld)
00131 {
00132     if(bDeleteOld == true)
00133     {
00134         std::_Destroy(this->MYFIRST, this->MYLAST);
00135 
00136         this->_M_deallocate(this->MYFIRST,
00137                             this->MYEND - this->MYFIRST); 
00138     }
00139 
00140     this->MYFIRST = other.MYFIRST; 
00141     this->MYLAST  = other.MYLAST;
00142     this->MYEND   = other.MYEND;
00143 }
00144 
00145 template <class Tp, class Alloc> inline
00146 void MFieldVector<Tp, Alloc>::resolveShare(void)
00147 {
00148     this->MYFIRST = NULL;
00149     this->MYLAST  = NULL;
00150     this->MYEND   = NULL;
00151 }
00152 
00153 #elif defined(WIN32)
00154 
00155 template<class Ty, class A> inline
00156 MFieldVector<Ty, A>::MFieldVector(const A &_Al) : 
00157     Inherited(_Al) 
00158 {
00159 }
00160 
00161 template<class Ty, class A> inline
00162 MFieldVector<Ty, A>::MFieldVector(      size_type  _N, 
00163                                   const Ty        &_V,
00164                                   const A         &_Al) : 
00165     Inherited(_N, _V, _Al)
00166 {
00167 }
00168 
00169 template<class Ty, class A> inline
00170 MFieldVector<Ty, A>::MFieldVector(const MFieldVector<Ty, A> &_X) :
00171     Inherited(_X)
00172 {
00173 }
00174 
00175 
00176 template<class Ty, class A> inline
00177 MFieldVector<Ty, A>::MFieldVector(      It  _F, 
00178                                         It  _L, 
00179                                   const A  &_Al) :
00180     Inherited(_F, _L, _Al)
00181 {
00182 }
00183 
00184 template<class Ty, class A> inline
00185 MFieldVector<Ty, A>::~MFieldVector()
00186 {
00187 }
00188 
00189 template<class Ty, class A> inline
00190 void MFieldVector<Ty, A>::shareValues(Self &other, bool bDeleteOld)
00191 {
00192     if(bDeleteOld == true)
00193     {
00194         delete this->MYFIRST;
00195     }
00196 
00197     this->MYFIRST = other.MYFIRST; 
00198     this->MYLAST  = other.MYLAST;
00199     this->MYEND   = other.MYEND;
00200 }
00201 
00202 template <class Tp, class A> inline
00203 void MFieldVector<Tp, A>::resolveShare(void)
00204 {
00205     this->MYFIRST = NULL;
00206     this->MYLAST  = NULL;
00207     this->MYEND   = NULL;
00208 }
00209 
00210 #if defined(OSG_WIN32_CL) && defined(OSG_FIXED_MFIELDSYNC)
00211 template<> inline
00212 void MFieldVector<bool, std::allocator<bool> >::shareValues(
00213     Self &other, 
00214     bool  bDeleteOld)
00215 {
00216     fprintf(stderr, "MFieldVector<_Bool, _Alloc>::shareValues not impl\n");
00217 }
00218 
00219 template <> inline
00220 void MFieldVector<bool, std::allocator<bool> >::resolveShare(void)
00221 {
00222     fprintf(stderr, "MFieldVector<_Bool, _Alloc>::resolveShare not impl\n");
00223 }
00224 #endif
00225 
00226 #endif
00227 
00228 OSG_END_NAMESPACE
00229 
00230 #define OSGMFIELDVECTOR_INLINE_CVSID "@(#)$Id: $"
00231 

Generated on Thu Aug 25 04:07:47 2005 for OpenSG by  doxygen 1.4.3