(file) Return to ArrayImpl.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/ArrayImpl.h between version 1.10 and 1.12

version 1.10, 2002/05/17 02:35:51 version 1.12, 2002/05/17 22:33:30
Line 98 
Line 98 
 #else #else
 PEGASUS_TEMPLATE_SPECIALIZATION PEGASUS_TEMPLATE_SPECIALIZATION
 #endif #endif
 Array<PEGASUS_ARRAY_T>::Array(ArrayRep<PEGASUS_ARRAY_T>* rep)  
 {  
     _rep = rep->clone();  
 }  
   
 #ifndef PEGASUS_ARRAY_T  
 template<class PEGASUS_ARRAY_T>  
 #else  
 PEGASUS_TEMPLATE_SPECIALIZATION  
 #endif  
 Array<PEGASUS_ARRAY_T>::~Array() Array<PEGASUS_ARRAY_T>::~Array()
 { {
     Rep::destroy(_rep);     Rep::destroy(_rep);
Line 268 
Line 258 
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::prepend(const PEGASUS_ARRAY_T& x) void Array<PEGASUS_ARRAY_T>::prepend(const PEGASUS_ARRAY_T& x)
 { {
     reserve(size() + 1);      prepend(&x, 1);
     memmove(_data() + 1, _data(), sizeof(PEGASUS_ARRAY_T) * size());  
     new(_data()) PEGASUS_ARRAY_T(x);  
     _rep->size++;  
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
Line 298 
Line 285 
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::insert(Uint32 pos, const PEGASUS_ARRAY_T& x) void Array<PEGASUS_ARRAY_T>::insert(Uint32 pos, const PEGASUS_ARRAY_T& x)
 { {
     if (pos > size())      insert(pos, &x, 1);
         ThrowOutOfBounds();  
   
     reserve(size() + 1);  
   
     Uint32 n = size() - pos;  
   
     if (n)  
         memmove(_data() + pos + 1, _data() + pos, sizeof(PEGASUS_ARRAY_T) * n);  
   
     new(_data() + pos) PEGASUS_ARRAY_T(x);  
     _rep->size++;  
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
Line 319 
Line 295 
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::insert(Uint32 pos, const PEGASUS_ARRAY_T* x, Uint32 size) void Array<PEGASUS_ARRAY_T>::insert(Uint32 pos, const PEGASUS_ARRAY_T* x, Uint32 size)
 { {
     if (pos + size > this->size())      if (pos > this->size())
         ThrowOutOfBounds();         ThrowOutOfBounds();
  
     reserve(this->size() + size);     reserve(this->size() + size);
Line 345 
Line 321 
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::remove(Uint32 pos) void Array<PEGASUS_ARRAY_T>::remove(Uint32 pos)
 { {
     if (pos >= this->size())      remove(pos, 1);
         ThrowOutOfBounds();  
   
 #if defined(PEGASUS_PLATFORM_HPUX_PARISC_ACC) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU)  
     Destroy<PEGASUS_ARRAY_T>(_data() + pos);  
 #else  
     Destroy(_data() + pos);  
 #endif  
   
     Uint32 rem = this->size() - pos - 1;  
   
     if (rem)  
         memmove(_data() + pos, _data() + pos + 1, sizeof(PEGASUS_ARRAY_T) * rem);  
   
     _rep->size--;  
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
Line 369 
Line 331 
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::remove(Uint32 pos, Uint32 size) void Array<PEGASUS_ARRAY_T>::remove(Uint32 pos, Uint32 size)
 { {
     if (pos + size > this->size())      if (pos + size - 1 > this->size())
         ThrowOutOfBounds();         ThrowOutOfBounds();
  
 #if defined(PEGASUS_PLATFORM_HPUX_PARISC_ACC) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) #if defined(PEGASUS_PLATFORM_HPUX_PARISC_ACC) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU)


Legend:
Removed from v.1.10  
changed lines
  Added in v.1.12

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2