33 return array == a_it.array && curIndex == a_it.curIndex;
38 return array != a_it.array || curIndex != a_it.curIndex;
77 return iterator(array, curIndex + a_delta);
82 return iterator(array, curIndex - a_delta);
87 assert(array == a_right.array);
88 return curIndex - a_right.curIndex;
94 return (*array)[curIndex];
100 return &(*array)[curIndex];
106 return &(*array)[curIndex];
111 return !array || curIndex < 0 || curIndex >=
static_cast<std::int32_t
>(array->
GetSize());
146 return array == a_it.array && curIndex == a_it.curIndex;
151 return array != a_it.array || curIndex != a_it.curIndex;
157 if (curIndex <
static_cast<std::int32_t
>(array->
GetSize())) {
199 assert(array == a_right.array);
200 return curIndex - a_right.curIndex;
206 return (*array)[curIndex];
212 return &(*array)[curIndex];
218 return &(*array)[curIndex];
223 return !array || curIndex < 0 || curIndex >=
static_cast<std::int32_t
>(array->
GetSize());
263 data(a_defaultVal, a_size)
273 data.policy = a_policy;
278 return data.policy.NeverShrinking();
288 return data.GetCapacity();
298 data.ClearAndRelease();
308 data.Resize(a_newSize);
313 if (a_newCapacity >
data.GetCapacity()) {
314 data.Reserve(a_newCapacity);
320 assert(a_index <
data.size);
321 return data.data[a_index];
326 assert(a_index <
data.size);
327 return data.data[a_index];
332 assert(a_index <
data.size);
333 return data.data[a_index];
338 assert(a_index <
data.size);
339 return data.data[a_index];
344 assert(a_index <
data.size);
345 return data.data[a_index];
350 data.PushBack(a_val);
356 data.PushBackAlt(a_val);
361 assert(
data.size > 0);
389 *(
data.data + i) = a_array[i];
396 assert(a_index + a_num <=
data.size);
398 if (
data.size == a_num) {
401 AllocatorType::DestructArray(
data.data + a_index, a_num);
402 AllocatorType::CopyArrayForward(
404 data.data + a_index + a_num,
405 data.size + a_num - a_index);
412 assert(a_index <
data.size);
414 if (
data.size == 1) {
417 AllocatorType::Destruct(
data.data + a_index);
418 AllocatorType::CopyArrayForward(
420 data.data + a_index + 1,
421 data.size - 1 - a_index);
428 assert(a_index <=
data.size);
431 if (a_index <
data.size - 1) {
432 AllocatorType::CopyArrayBackward(
433 data.data + a_index + 1,
435 data.size - 1 - a_index);
437 AllocatorType::Construct(
data.data + a_index, a_val);
442 assert(a_index <=
data.size);
445 if (a_index <
data.size - a_num) {
446 AllocatorType::CopyArrayBackward(
447 data.data + a_index + a_num,
449 data.size - a_num - a_index);
452 for (
UPInt i = 0; i < a_num; ++i) {
453 AllocatorType::Construct(
data.data + a_index + i, a_val);
464 data.Append(a_other, a_count);
Definition: GArrayBase.h:11
const ValueType & At(UPInt a_index) const
Definition: GArrayBase.h:324
void Clear()
Definition: GArrayBase.h:301
iterator begin()
Definition: GArrayBase.h:467
const ValueType & Front() const
Definition: GArrayBase.h:370
const_iterator end() const
Definition: GArrayBase.h:487
GArrayBase(GMemoryHeap *a_heap)
Definition: GArrayBase.h:250
T data
Definition: GArrayBase.h:498
ValueType & operator[](UPInt a_index)
Definition: GArrayBase.h:336
void RemoveAt(UPInt a_index)
Definition: GArrayBase.h:410
GArrayBase(GMemoryHeap *a_heap, std::int32_t a_size)
Definition: GArrayBase.h:254
GFC_MEMORY_REDEFINE_NEW(GArrayBase, AllocatorType::StatId)
ValueType & At(UPInt a_index)
Definition: GArrayBase.h:318
void PushBackAlt(const S &a_val)
Definition: GArrayBase.h:354
void InsertAt(UPInt a_index, const ValueType &a_val=ValueType())
Definition: GArrayBase.h:426
GArrayBase(std::int32_t a_size)
Definition: GArrayBase.h:242
void ClearAndRelease()
Definition: GArrayBase.h:296
ValueType & Front()
Definition: GArrayBase.h:365
void Resize(UPInt a_newSize)
Definition: GArrayBase.h:306
void InsertMultipleAt(UPInt a_index, UPInt a_num, const ValueType &a_val=ValueType())
Definition: GArrayBase.h:440
iterator Last()
Definition: GArrayBase.h:477
const ValueType & operator[](UPInt a_index) const
Definition: GArrayBase.h:342
bool NeverShrinking() const
Definition: GArrayBase.h:276
const_iterator Last() const
Definition: GArrayBase.h:492
UPInt GetSize() const
Definition: GArrayBase.h:281
const_iterator begin() const
Definition: GArrayBase.h:482
typename T::AllocatorType AllocatorType
Definition: GArrayBase.h:14
void RemoveMultipleAt(UPInt a_index, UPInt a_num)
Definition: GArrayBase.h:394
GArrayBase(const ValueType &a_defaultVal, std::int32_t a_size)
Definition: GArrayBase.h:262
GArrayBase()
Definition: GArrayBase.h:238
GArrayBase(const ValueType &a_defaultVal)
Definition: GArrayBase.h:258
SizePolicyType * GetSizePolicy() const
Definition: GArrayBase.h:266
typename T::SizePolicyType SizePolicyType
Definition: GArrayBase.h:15
ValueType & Back()
Definition: GArrayBase.h:375
void PushBack(const ValueType &a_val)
Definition: GArrayBase.h:348
void SetSizePolicy(const SizePolicyType &a_policy)
Definition: GArrayBase.h:271
void Reserve(UPInt a_newCapacity)
Definition: GArrayBase.h:311
UPInt GetCapacity() const
Definition: GArrayBase.h:286
typename T::ValueType ValueType
Definition: GArrayBase.h:13
const SelfType & operator=(const SelfType &a_array)
Definition: GArrayBase.h:385
ValueType ValueAt(UPInt a_index) const
Definition: GArrayBase.h:330
void Append(const SelfType &a_other)
Definition: GArrayBase.h:457
UPInt GetNumBytes() const
Definition: GArrayBase.h:291
iterator end()
Definition: GArrayBase.h:472
void Append(const ValueType a_other[], UPInt a_count)
Definition: GArrayBase.h:462
const ValueType & Back() const
Definition: GArrayBase.h:380
void PopBack()
Definition: GArrayBase.h:359
GArrayBase(const SelfType &a_array)
Definition: GArrayBase.h:246
Definition: GMemoryHeap.h:16
Definition: AbsorbEffect.h:6
std::size_t UPInt
Definition: SFTypes.h:5
std::ptrdiff_t SPInt
Definition: SFTypes.h:8
Definition: GArrayBase.h:132
bool IsFinished() const
Definition: GArrayBase.h:221
const ValueType & operator*() const
Definition: GArrayBase.h:203
const ValueType * GetPtr() const
Definition: GArrayBase.h:215
const_iterator()
Definition: GArrayBase.h:134
bool operator!=(const const_iterator &a_it) const
Definition: GArrayBase.h:149
const_iterator operator--(std::int32_t)
Definition: GArrayBase.h:180
const ValueType * operator->() const
Definition: GArrayBase.h:209
SPInt operator-(const const_iterator &a_right) const
Definition: GArrayBase.h:197
const_iterator operator++(std::int32_t)
Definition: GArrayBase.h:164
const_iterator(const SelfType *a_arr, SPInt a_idx=0)
Definition: GArrayBase.h:139
const_iterator & operator++()
Definition: GArrayBase.h:154
const_iterator operator+(std::int32_t a_delta) const
Definition: GArrayBase.h:187
const_iterator & operator--()
Definition: GArrayBase.h:171
const_iterator operator-(std::int32_t a_delta) const
Definition: GArrayBase.h:192
SPInt GetIndex() const
Definition: GArrayBase.h:226
bool operator==(const const_iterator &a_it) const
Definition: GArrayBase.h:144
Definition: GArrayBase.h:19
ValueType & operator*() const
Definition: GArrayBase.h:91
bool IsFinished() const
Definition: GArrayBase.h:109
void Remove()
Definition: GArrayBase.h:114
bool operator!=(const iterator &a_it) const
Definition: GArrayBase.h:36
bool operator==(const iterator &a_it) const
Definition: GArrayBase.h:31
iterator(SelfType *a_arr, SPInt a_idx=0)
Definition: GArrayBase.h:26
iterator operator++(std::int32_t)
Definition: GArrayBase.h:51
iterator & operator--()
Definition: GArrayBase.h:58
SPInt GetIndex() const
Definition: GArrayBase.h:121
ValueType * operator->() const
Definition: GArrayBase.h:97
SPInt operator-(const iterator &a_right) const
Definition: GArrayBase.h:85
ValueType * GetPtr() const
Definition: GArrayBase.h:103
iterator operator--(std::int32_t)
Definition: GArrayBase.h:68
iterator()
Definition: GArrayBase.h:21
iterator operator+(std::int32_t a_delta) const
Definition: GArrayBase.h:75
iterator & operator++()
Definition: GArrayBase.h:41
iterator operator-(std::int32_t a_delta) const
Definition: GArrayBase.h:80