63 template<
int MinCapacity=0,
int Granularity=4,
bool NeverShrink=false>
86 template<
class T,
class Allocator,
class SizePolicy>
108 return Policy.GetCapacity();
125 if (newCapacity <
Policy.GetMinCapacity())
126 newCapacity =
Policy.GetMinCapacity();
129 if (newCapacity == 0)
141 newCapacity = (newCapacity + gran - 1) / gran * gran;
144 if (Allocator::IsMovable())
152 s = (
Size < newCapacity) ?
Size : newCapacity;
153 for (i = 0; i < s; ++i)
158 for (i = s; i <
Size; ++i)
171 Policy.SetCapacity(newCapacity);
183 if (newSize < oldSize)
186 if (newSize < (
Policy.GetCapacity() >> 1))
191 else if(newSize >=
Policy.GetCapacity())
193 Reserve(newSize + (newSize >> 2));
213 template<
class T,
class Allocator,
class SizePolicy>
236 if(newSize > oldSize)
272 template<
class T,
class Allocator,
class SizePolicy>
295 if(newSize > oldSize)
342 template<
class ArrayData>
355 #if defined(OVR_DEFINE_NEW)
356 #define new OVR_DEFINE_NEW
370 :
Data(defval, size) {}
492 AllocatorType::CopyArrayForward(
515 AllocatorType::CopyArrayForward(
539 if (index < lastElemIndex)
557 AllocatorType::CopyArrayBackward(
573 AllocatorType::CopyArrayBackward(
578 for (
UPInt i = 0; i < num; ++i)
664 Iterator
Begin() {
return Iterator(
this); }
731 ConstIterator
Begin()
const {
return ConstIterator(
this); }
746 template<
class T,
class SizePolicy=ArrayDefaultPolicy>
768 template<
class T,
class SizePolicy=ArrayDefaultPolicy>
790 template<
class T,
class SizePolicy=ArrayDefaultPolicy>
814 template<
class T,
class SizePolicy=ArrayDefaultPolicy>
void SetCapacity(UPInt capacity)
UPInt GetCapacity() const
const SelfType & operator=(const SelfType &a)
ArrayDataCC< T, Allocator, SizePolicy > SelfType
const ValueType & At(UPInt index) const
ArrayData::ValueType ValueType
void Reserve(UPInt newCapacity)
ArrayBase(const ValueType &defval, UPInt size)
ArrayBase< ArrayData > SelfType
ArrayPOD(const SizePolicyType &p)
void PushBack(const ValueType &val)
ArrayCC(const SelfType &a)
SizePolicy SizePolicyType
void ResizeNoConstruct(UPInt newSize)
ConstIterator Last() const
void PushBack(const ValueType &val)
bool NeverShrinking() const
void PushBack(const ValueType &val)
void InsertAt(UPInt index, const ValueType &val=ValueType())
void Append(const ValueType other[], UPInt count)
OVR_FORCE_INLINE T * ConstructAlt(void *p, const S &source)
const SelfType & operator=(const SelfType &a)
void RemoveMultipleAt(UPInt index, UPInt num)
ArrayBase(const SelfType &a)
Array(const SizePolicyType &p)
Array< T, SizePolicy > SelfType
const SelfType & operator=(const SelfType &a)
const SelfType & operator=(const SelfType &a)
ArrayDefaultPolicy(const ArrayDefaultPolicy &)
ValueType & operator*() const
UPInt GetCapacity() const
ArrayDataBase< T, Allocator, SizePolicy > BaseType
UPInt GetNumBytes() const
ContainerAllocator_CPP< T > AllocatorType
bool operator==(const Iterator &it) const
void PushBackAlt(const S &val)
Iterator operator-(int delta) const
OVR_FORCE_INLINE void ConstructArray(void *p, UPInt count)
SizePolicy SizePolicyType
ArrayData::AllocatorType AllocatorType
void Append(const ValueType other[], UPInt count)
ArrayData< T, Allocator, SizePolicy > SelfType
ArrayConstPolicy(const SelfType &)
ArrayData::SizePolicyType SizePolicyType
void Resize(UPInt newSize)
bool NeverShrinking() const
ArrayPOD< T, SizePolicy > SelfType
OVR_FORCE_INLINE T * Construct(void *p)
ConstIterator(const SelfType *parr, SPInt idx=0)
void RemoveAtUnordered(UPInt index)
ArrayDataBase< T, Allocator, SizePolicy > SelfType
ArrayPOD(const SelfType &a)
SizePolicyType * GetSizePolicy() const
ConstIterator operator-(int delta) const
void PushBackAlt(const S &val)
SizePolicy SizePolicyType
bool operator==(const ConstIterator &it) const
void PopBack(UPInt count=1)
bool NeverShrinking() const
const SelfType & operator=(const SelfType &a)
const ValueType * GetDataPtr() const
const ValueType * GetPtr() const
ArrayBase< ArrayDataCC< T, ContainerAllocator< T >, SizePolicy > > BaseType
SizePolicy SizePolicyType
SizePolicy SizePolicyType
const ValueType & Back() const
ConstIterator operator+(int delta) const
ArrayDataCC(const ValueType &defval)
ArrayCPP(const SizePolicyType &p)
UPInt GetMinCapacity() const
void Resize(UPInt newSize)
ConstIterator End() const
ArrayCPP< T, SizePolicy > SelfType
ArrayCC(const ValueType &defval, UPInt size)
bool operator!=(const ConstIterator &it) const
const ValueType * operator->() const
ValueType ValueAt(UPInt index) const
ArrayBase(const ValueType &defval)
virtual void * Realloc(void *p, UPInt newSize)=0
#define OVR_MEMORY_REDEFINE_NEW(class_name)
Iterator(SelfType *parr, SPInt idx=0)
ArrayCC< T, SizePolicy > SelfType
ArrayDataCC(const ValueType &defval, UPInt size)
ArrayCC(const ValueType &defval)
ConstIterator & operator--()
SizePolicy SizePolicyType
ContainerAllocator< T > AllocatorType
ValueType * operator->() const
ArrayData(const SelfType &a)
bool operator!=(const Iterator &it) const
UPInt GetCapacity() const
ValueType & operator[](UPInt index)
void Append(const SelfType &other)
void RemoveAt(UPInt index)
SizePolicy SizePolicyType
Iterator operator+(int delta) const
SPInt operator-(const ConstIterator &right) const
ConstIterator operator--(int)
UPInt GetGranularity() const
const ValueType & Front() const
void Append(const ValueType other[], UPInt count)
ValueType & At(UPInt index)
UPInt GetCapacity() const
UPInt GetGranularity() const
ArrayDataBase< T, Allocator, SizePolicy > BaseType
virtual void * Alloc(UPInt size)=0
ConstIterator Begin() const
ArrayConstPolicy< MinCapacity, Granularity, NeverShrink > SelfType
ValueType * GetPtr() const
ArrayBase< ArrayData< T, ContainerAllocator< T >, SizePolicy > > BaseType
UPInt GetMinCapacity() const
OVR_FORCE_INLINE void Destruct(T *pobj)
int char * index(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1))
void Resize(UPInt newSize)
ArrayBase< ArrayData< T, ContainerAllocator_POD< T >, SizePolicy > > BaseType
void PushBackAlt(const S &val)
SPInt operator-(const Iterator &right) const
ValueType & PushDefault()
ConstIterator & operator++()
ConstIterator operator++(int)
const ValueType & operator*() const
OVR_FORCE_INLINE void DestructArray(T *pobj, UPInt count)
virtual void Free(void *p)=0
void Reserve(UPInt newCapacity)
ArrayCPP(const SelfType &a)
void InsertMultipleAt(UPInt index, UPInt num, const ValueType &val=ValueType())
ArrayBase< ArrayData< T, ContainerAllocator_CPP< T >, SizePolicy > > BaseType
void SetCapacity(UPInt capacity)
ArrayDataBase(const SizePolicy &p)
ArrayCC(const ValueType &defval, const SizePolicyType &p)
void SetSizePolicy(const SizePolicyType &p)
ContainerAllocator< T > AllocatorType
ContainerAllocator_POD< T > AllocatorType
ArrayDataCC(const SelfType &a)