(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.17 and 1.37.6.1

version 1.17, 2002/07/19 21:18:23 version 1.37.6.1, 2013/06/03 22:35:11
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%LICENSE////////////////////////////////////////////////////////////////
 //  
 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,  
 // The Open Group, Tivoli Systems  
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy  // Licensed to The Open Group (TOG) under one or more contributor license
 // of this software and associated documentation files (the "Software"), to  // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
 // deal in the Software without restriction, including without limitation the  // this work for additional information regarding copyright ownership.
 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or  // Each contributor licenses this file to you under the OpenPegasus Open
 // sell copies of the Software, and to permit persons to whom the Software is  // Source License; you may not use this file except in compliance with the
 // furnished to do so, subject to the following conditions:  // License.
 // //
 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN  // Permission is hereby granted, free of charge, to any person obtaining a
 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED  // copy of this software and associated documentation files (the "Software"),
 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT  // to deal in the Software without restriction, including without limitation
 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR  // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT  // and/or sell copies of the Software, and to permit persons to whom the
 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN  // Software is furnished to do so, subject to the following conditions:
 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION  
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  
 // //
 //==============================================================================  // The above copyright notice and this permission notice shall be included
   // in all copies or substantial portions of the Software.
 // //
 // Author: Mike Brasher (mbrasher@bmc.com)  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
   // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
   // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
   // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // //
 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)  //////////////////////////////////////////////////////////////////////////
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 37 
Line 39 
  
 #include <Pegasus/Common/Memory.h> #include <Pegasus/Common/Memory.h>
 #include <Pegasus/Common/ArrayRep.h> #include <Pegasus/Common/ArrayRep.h>
 #include <Pegasus/Common/Exception.h>  #include <Pegasus/Common/InternalException.h>
   #include <Pegasus/Common/Linkage.h>
 #ifdef PEGASUS_HAS_EBCDIC  
 #include <unistd.h>  
 #endif  
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
   PEGASUS_COMMON_LINKAGE void ArrayThrowIndexOutOfBoundsException();
   
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
 template<class PEGASUS_ARRAY_T> template<class PEGASUS_ARRAY_T>
 #endif #endif
 Array<PEGASUS_ARRAY_T>::Array() Array<PEGASUS_ARRAY_T>::Array()
 { {
     _rep = ArrayRep<PEGASUS_ARRAY_T>::create(0);      _rep = &ArrayRepBase::_empty_rep;
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
Line 58 
Line 59 
 #endif #endif
 Array<PEGASUS_ARRAY_T>::Array(const Array<PEGASUS_ARRAY_T>& x) Array<PEGASUS_ARRAY_T>::Array(const Array<PEGASUS_ARRAY_T>& x)
 { {
     _rep = static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(x._rep)->clone();      _rep = x._rep;
       ArrayRep<PEGASUS_ARRAY_T>::ref(Array_rep);
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
Line 66 
Line 68 
 #endif #endif
 Array<PEGASUS_ARRAY_T>::Array(Uint32 size) Array<PEGASUS_ARRAY_T>::Array(Uint32 size)
 { {
     _rep = ArrayRep<PEGASUS_ARRAY_T>::create(size);      _rep = ArrayRep<PEGASUS_ARRAY_T>::alloc(size);
     InitializeRaw(static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data(), size);  
       // ArrayRep<PEGASUS_ARRAY_T>::alloc() throws a bad_alloc exception if
       // storage could not be obtained.
   
       InitializeRaw(Array_data, size);
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
Line 75 
Line 81 
 #endif #endif
 Array<PEGASUS_ARRAY_T>::Array(Uint32 size, const PEGASUS_ARRAY_T& x) Array<PEGASUS_ARRAY_T>::Array(Uint32 size, const PEGASUS_ARRAY_T& x)
 { {
     _rep = ArrayRep<PEGASUS_ARRAY_T>::create(size);      _rep = ArrayRep<PEGASUS_ARRAY_T>::alloc(size);
   
       // ArrayRep<PEGASUS_ARRAY_T>::alloc() throws a bad_alloc exception if
       // storage could not be obtained.
   
       PEGASUS_ARRAY_T* data = Array_data;
  
     PEGASUS_ARRAY_T* data = static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data();      // Note: we could use template specialization (by adding functions to
       // Memory.h) so that this loop becomes a memset() for single byte raw
       // types, but this function is rarely called.
  
     while (size--)     while (size--)
         new(data++) PEGASUS_ARRAY_T(x);         new(data++) PEGASUS_ARRAY_T(x);
Line 88 
Line 101 
 #endif #endif
 Array<PEGASUS_ARRAY_T>::Array(const PEGASUS_ARRAY_T* items, Uint32 size) Array<PEGASUS_ARRAY_T>::Array(const PEGASUS_ARRAY_T* items, Uint32 size)
 { {
     _rep = ArrayRep<PEGASUS_ARRAY_T>::create(size);      _rep = ArrayRep<PEGASUS_ARRAY_T>::alloc(size);
     CopyToRaw(static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data(), items, size);  
       // ArrayRep<PEGASUS_ARRAY_T>::alloc() throws a bad_alloc exception if
       // storage could not be obtained.
   
       CopyToRaw(Array_data, items, size);
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
Line 97 
Line 114 
 #endif #endif
 Array<PEGASUS_ARRAY_T>::~Array() Array<PEGASUS_ARRAY_T>::~Array()
 { {
     ArrayRep<PEGASUS_ARRAY_T>::destroy(static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep));      ArrayRep<PEGASUS_ARRAY_T>::unref(Array_rep);
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
Line 106 
Line 123 
 Array<PEGASUS_ARRAY_T>& Array<PEGASUS_ARRAY_T>::operator=( Array<PEGASUS_ARRAY_T>& Array<PEGASUS_ARRAY_T>::operator=(
     const Array<PEGASUS_ARRAY_T>& x)     const Array<PEGASUS_ARRAY_T>& x)
 { {
     if (static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(x._rep) !=      if (x._rep != Array_rep)
         static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep))  
     {     {
         ArrayRep<PEGASUS_ARRAY_T>::destroy(static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep));          ArrayRep<PEGASUS_ARRAY_T>::unref(Array_rep);
         _rep = static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(x._rep)->clone();          _rep = x._rep;
           ArrayRep<PEGASUS_ARRAY_T>::ref(Array_rep);
     }     }
   
     return *this;     return *this;
 } }
  
Line 120 
Line 138 
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::clear() void Array<PEGASUS_ARRAY_T>::clear()
 { {
     ArrayRep<PEGASUS_ARRAY_T>::destroy(static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep));      if (Array_size)
     _rep = ArrayRep<PEGASUS_ARRAY_T>::create(0);  
 }  
   
 #ifndef PEGASUS_ARRAY_T  
 template<class PEGASUS_ARRAY_T>  
 #endif  
 void Array<PEGASUS_ARRAY_T>::reserve(Uint32 capacity)  
 { {
     if (capacity > static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->capacity)          if (Array_refs.get() == 1)
     {     {
         Uint32 size = this->size();              Destroy(Array_data, Array_size);
         ArrayRep<PEGASUS_ARRAY_T>* rep = ArrayRep<PEGASUS_ARRAY_T>::create(capacity);              Array_size = 0;
         rep->size = size;          }
         CopyToRaw(rep->data(), static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data(), size);          else
         ArrayRep<PEGASUS_ARRAY_T>::destroy(static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep));          {
         _rep = rep;              ArrayRep<PEGASUS_ARRAY_T>::unref(Array_rep);
               _rep = &ArrayRepBase::_empty_rep;
           }
     }     }
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
 template<class PEGASUS_ARRAY_T> template<class PEGASUS_ARRAY_T>
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::grow(Uint32 size, const PEGASUS_ARRAY_T& x)  void Array<PEGASUS_ARRAY_T>::reserveCapacity(Uint32 capacity)
 { {
     Uint32 oldSize = static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size;      if (capacity > Array_capacity || Array_refs.get() != 1)
     reserve(oldSize + size);      {
           ArrayRep<PEGASUS_ARRAY_T>* rep =
     PEGASUS_ARRAY_T* p = static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data() + oldSize;              ArrayRep<PEGASUS_ARRAY_T>::alloc(capacity);
     Uint32 n = size;  
  
     while (n--)          // ArrayRep<PEGASUS_ARRAY_T>::alloc() throws a bad_alloc exception if
         new(p++) PEGASUS_ARRAY_T(x);          // storage could not be obtained.
  
     static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size += size;          rep->size = Array_size;
 }  
  
 #ifndef PEGASUS_ARRAY_T          if (Array_refs.get() == 1)
 template<class PEGASUS_ARRAY_T>  
 #endif  
 void Array<PEGASUS_ARRAY_T>::swap(Array<PEGASUS_ARRAY_T>& x)  
 { {
     ArrayRep<PEGASUS_ARRAY_T>* tmp = static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep);              memcpy(
     _rep = static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(x._rep);                  (void*)rep->data(),
     x._rep = tmp;                  (void*)Array_data,
                   Array_size*sizeof(PEGASUS_ARRAY_T));
               Array_size = 0;
 } }
           else
               CopyToRaw(rep->data(), Array_data, Array_size);
  
 #ifndef PEGASUS_ARRAY_T          ArrayRep<PEGASUS_ARRAY_T>::unref(Array_rep);
 template<class PEGASUS_ARRAY_T>          _rep = rep;
 #endif  
 Uint32 Array<PEGASUS_ARRAY_T>::size() const  
 {  
     return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size;  
 } }
   
 #ifndef PEGASUS_ARRAY_T  
 template<class PEGASUS_ARRAY_T>  
 #endif  
 Uint32 Array<PEGASUS_ARRAY_T>::getCapacity() const  
 {  
     return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->capacity;  
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
 template<class PEGASUS_ARRAY_T> template<class PEGASUS_ARRAY_T>
 #endif #endif
 const PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::getData() const  void Array<PEGASUS_ARRAY_T>::grow(Uint32 size, const PEGASUS_ARRAY_T& x)
 { {
     return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data();      reserveCapacity(Array_size + size);
 }      PEGASUS_ARRAY_T* p = Array_data + Array_size;
       Uint32 n = size;
  
 #ifndef PEGASUS_ARRAY_T      while (n--)
 template<class PEGASUS_ARRAY_T>          new(p++) PEGASUS_ARRAY_T(x);
 #endif  
 PEGASUS_ARRAY_T& Array<PEGASUS_ARRAY_T>::operator[](Uint32 pos)  
 {  
     if (pos >= size())  
         throw OutOfBounds();  
  
     return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data()[pos];      Array_size += size;
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
 template<class PEGASUS_ARRAY_T> template<class PEGASUS_ARRAY_T>
 #endif #endif
 const PEGASUS_ARRAY_T& Array<PEGASUS_ARRAY_T>::operator[](Uint32 pos) const  void Array<PEGASUS_ARRAY_T>::swap(Array<PEGASUS_ARRAY_T>& x)
 { {
     if (pos >= size())      ArrayRep<PEGASUS_ARRAY_T>* tmp = Array_rep;
         throw OutOfBounds();      _rep = x._rep;
       x._rep = tmp;
     return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data()[pos];  
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
Line 218 
Line 214 
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::append(const PEGASUS_ARRAY_T& x) void Array<PEGASUS_ARRAY_T>::append(const PEGASUS_ARRAY_T& x)
 { {
     reserve(size() + 1);      Uint32 n = Array_size + 1;
     new (_data() + size()) PEGASUS_ARRAY_T(x);  
     static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size++;      if (n > Array_capacity || Array_refs.get() != 1)
           reserveCapacity(n);
   
       new (Array_data + Array_size) PEGASUS_ARRAY_T(x);
       Array_size++;
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
Line 228 
Line 228 
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::append(const PEGASUS_ARRAY_T* x, Uint32 size) void Array<PEGASUS_ARRAY_T>::append(const PEGASUS_ARRAY_T* x, Uint32 size)
 { {
     reserve(this->size() + size);      Uint32 n = Array_size + size;
     CopyToRaw(_data() + this->size(), x, size);      reserveCapacity(n);
     static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size += size;      CopyToRaw(Array_data + Array_size, x, size);
       Array_size = n;
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
Line 254 
Line 255 
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::prepend(const PEGASUS_ARRAY_T* x, Uint32 size) void Array<PEGASUS_ARRAY_T>::prepend(const PEGASUS_ARRAY_T* x, Uint32 size)
 { {
     reserve(this->size() + size);      reserveCapacity(Array_size + size);
     memmove(_data() + size, _data(), sizeof(PEGASUS_ARRAY_T) * this->size());      memmove(
     CopyToRaw(_data(), x, size);          (void*)(Array_data + size),
     static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size += size;          (void*)Array_data,
           sizeof(PEGASUS_ARRAY_T) * Array_size);
       CopyToRaw(Array_data, x, size);
       Array_size += size;
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
 template<class PEGASUS_ARRAY_T> template<class PEGASUS_ARRAY_T>
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::insert(Uint32 pos, const PEGASUS_ARRAY_T& x)  void Array<PEGASUS_ARRAY_T>::insert(Uint32 index, const PEGASUS_ARRAY_T& x)
 { {
     insert(pos, &x, 1);      insert(index, &x, 1);
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
 template<class PEGASUS_ARRAY_T> template<class PEGASUS_ARRAY_T>
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::insert(Uint32 pos, const PEGASUS_ARRAY_T* x, Uint32 size)  void Array<PEGASUS_ARRAY_T>::insert(
       Uint32 index, const PEGASUS_ARRAY_T* x, Uint32 size)
   {
       if (index > Array_size)
 { {
     if (pos > this->size())          throw IndexOutOfBoundsException();
         throw OutOfBounds();      }
  
     reserve(this->size() + size);      reserveCapacity(Array_size + size);
  
     Uint32 n = this->size() - pos;      Uint32 n = Array_size - index;
  
     if (n)     if (n)
       {
         memmove(         memmove(
             _data() + pos + size, _data() + pos, sizeof(PEGASUS_ARRAY_T) * n);              Array_data + index + size,
               Array_data + index,
               sizeof(PEGASUS_ARRAY_T) * n);
       }
  
     CopyToRaw(_data() + pos, x, size);      CopyToRaw(Array_data + index, x, size);
     static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size += size;      Array_size += size;
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
 template<class PEGASUS_ARRAY_T> template<class PEGASUS_ARRAY_T>
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::remove(Uint32 pos)  void Array<PEGASUS_ARRAY_T>::remove(Uint32 index)
 { {
     remove(pos, 1);      remove(index, 1);
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
 template<class PEGASUS_ARRAY_T> template<class PEGASUS_ARRAY_T>
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::remove(Uint32 pos, Uint32 size)  void Array<PEGASUS_ARRAY_T>::remove(Uint32 index, Uint32 size)
   {
       if (size == 0)
 { {
     if (pos + size - 1 > this->size())          return;
         throw OutOfBounds();      }
  
     Destroy(_data() + pos, size);      if (Array_refs.get() != 1)
           _rep = ArrayRep<PEGASUS_ARRAY_T>::copy_on_write(Array_rep);
  
     Uint32 rem = this->size() - (pos + size);      // Case 1: attempting to remove last element (this is an optimization
       // for when the array is used as a stack; see Stack class).
  
     if (rem)      if (index + 1 == Array_size)
         memmove(      {
             _data() + pos, _data() + pos + size, sizeof(PEGASUS_ARRAY_T) * rem);          Destroy(Array_data + index, 1);
           Array_size--;
           return;
       }
  
     static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size -= size;      // Case 2: not attempting to remove last element:
   
       if (index + size - 1 > Array_size)
       {
           throw IndexOutOfBoundsException();
 } }
  
 #ifdef PEGASUS_HAS_EBCDIC      Destroy(Array_data + index, size);
       Uint32 rem = Array_size - (index + size);
  
 #ifndef PEGASUS_ARRAY_T      if (rem)
 template<class PEGASUS_ARRAY_T>  
 #endif  
 void Array<PEGASUS_ARRAY_T>::etoa()  
 { {
 #if PEGASUS_ARRAY_T == Sint8          memmove(
     __etoa_l((char *)_data(),static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size);              Array_data + index,
 #endif              Array_data + index + size,
               sizeof(PEGASUS_ARRAY_T) * rem);
       }
   
       Array_size -= size;
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
 template<class PEGASUS_ARRAY_T> template<class PEGASUS_ARRAY_T>
 #endif #endif
 void Array<PEGASUS_ARRAY_T>::atoe()  Uint32 Array<PEGASUS_ARRAY_T>::size() const
 { {
 #if PEGASUS_ARRAY_T == Sint8      return Array_size;
     __atoe_l((char *)_data(),static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->size);  
 #endif  
 } }
  
 #endif  
   
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
 template<class PEGASUS_ARRAY_T> template<class PEGASUS_ARRAY_T>
 #endif #endif
 PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::begin()  PEGASUS_ARRAY_T& Array<PEGASUS_ARRAY_T>::operator[](
       Uint32 index)
 { {
     return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data();      if (index >= Array_size)
           ArrayThrowIndexOutOfBoundsException();
   
       if (Array_refs.get() != 1)
           _rep = ArrayRep<PEGASUS_ARRAY_T>::copy_on_write(Array_rep);
   
       return Array_data[index];
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
 template<class PEGASUS_ARRAY_T> template<class PEGASUS_ARRAY_T>
 #endif #endif
 PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::end()  const PEGASUS_ARRAY_T& Array<PEGASUS_ARRAY_T>::operator[](
       Uint32 index) const
 { {
     return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data() + size();      if (index >= Array_size)
           ArrayThrowIndexOutOfBoundsException();
   
       return Array_data[index];
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
 template<class PEGASUS_ARRAY_T> template<class PEGASUS_ARRAY_T>
 #endif #endif
 const PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::begin() const  Uint32 Array<PEGASUS_ARRAY_T>::getCapacity() const
 { {
     return getData();      return Array_capacity;
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
 template<class PEGASUS_ARRAY_T> template<class PEGASUS_ARRAY_T>
 #endif #endif
 const PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::end() const  const PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::getData() const
 { {
     return getData() + size();      return Array_data;
 } }
  
 #ifndef PEGASUS_ARRAY_T #ifndef PEGASUS_ARRAY_T
Line 376 
Line 407 
 #endif #endif
 PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::_data() const PEGASUS_ARRAY_T* Array<PEGASUS_ARRAY_T>::_data() const
 { {
     return static_cast<ArrayRep<PEGASUS_ARRAY_T>*>(_rep)->data();      return Array_data;
 } }
  
 #endif //!defined(Pegasus_ArrayImpl_h) || !defined(PEGASUS_ARRAY_T) #endif //!defined(Pegasus_ArrayImpl_h) || !defined(PEGASUS_ARRAY_T)


Legend:
Removed from v.1.17  
changed lines
  Added in v.1.37.6.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2