00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
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) || __GNUC__ >= 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
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
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 #if defined(OSG_LINUX_ICC) && !defined(OSG_ICC_GNU_COMPAT)
00135 this->_Destroy(this->MYFIRST, this->MYLAST);
00136
00137 this->_Alval.deallocate(this->MYFIRST,
00138 this->MYEND - this->MYFIRST);
00139 #else
00140 std::_Destroy(this->MYFIRST, this->MYLAST);
00141
00142 this->_M_deallocate(this->MYFIRST,
00143 this->MYEND - this->MYFIRST);
00144 #endif
00145 }
00146
00147 this->MYFIRST = other.MYFIRST;
00148 this->MYLAST = other.MYLAST;
00149 this->MYEND = other.MYEND;
00150 }
00151
00152 template <class Tp, class Alloc> inline
00153 void MFieldVector<Tp, Alloc>::resolveShare(void)
00154 {
00155 this->MYFIRST = NULL;
00156 this->MYLAST = NULL;
00157 this->MYEND = NULL;
00158 }
00159
00160 #elif defined(WIN32)
00161
00162 template<class Ty, class A> inline
00163 MFieldVector<Ty, A>::MFieldVector(const A &_Al) :
00164 Inherited(_Al)
00165 {
00166 }
00167
00168 template<class Ty, class A> inline
00169 MFieldVector<Ty, A>::MFieldVector( size_type _N,
00170 const Ty &_V,
00171 const A &_Al) :
00172 Inherited(_N, _V, _Al)
00173 {
00174 }
00175
00176 template<class Ty, class A> inline
00177 MFieldVector<Ty, A>::MFieldVector(const MFieldVector<Ty, A> &_X) :
00178 Inherited(_X)
00179 {
00180 }
00181
00182
00183 template<class Ty, class A> inline
00184 MFieldVector<Ty, A>::MFieldVector( It _F,
00185 It _L,
00186 const A &_Al) :
00187 Inherited(_F, _L, _Al)
00188 {
00189 }
00190
00191 template<class Ty, class A> inline
00192 MFieldVector<Ty, A>::~MFieldVector()
00193 {
00194 }
00195
00196 template<class Ty, class A> inline
00197 void MFieldVector<Ty, A>::shareValues(Self &other, bool bDeleteOld)
00198 {
00199 if(bDeleteOld == true)
00200 {
00201 delete this->MYFIRST;
00202 }
00203
00204 this->MYFIRST = other.MYFIRST;
00205 this->MYLAST = other.MYLAST;
00206 this->MYEND = other.MYEND;
00207 }
00208
00209 template <class Tp, class A> inline
00210 void MFieldVector<Tp, A>::resolveShare(void)
00211 {
00212 this->MYFIRST = NULL;
00213 this->MYLAST = NULL;
00214 this->MYEND = NULL;
00215 }
00216
00217 #if defined(OSG_WIN32_CL) && defined(OSG_FIXED_MFIELDSYNC)
00218 template<> inline
00219 void MFieldVector<bool, std::allocator<bool> >::shareValues(
00220 Self &other,
00221 bool bDeleteOld)
00222 {
00223 fprintf(stderr, "MFieldVector<_Bool, _Alloc>::shareValues not impl\n");
00224 }
00225
00226 template <> inline
00227 void MFieldVector<bool, std::allocator<bool> >::resolveShare(void)
00228 {
00229 fprintf(stderr, "MFieldVector<_Bool, _Alloc>::resolveShare not impl\n");
00230 }
00231 #endif
00232
00233 #endif
00234
00235 OSG_END_NAMESPACE
00236
00237 #define OSGMFIELDVECTOR_INLINE_CVSID "@(#)$Id: $"
00238