485 if (uIdx
487 T_ITEM * pSecondNextItem = this->
m_pItems + (uIdx + 2);
488 if (
Lesser(in_NewKey, U_KEY::Get(*pSecondNextItem)))
490 return Swap(pNextItem, pItem);
494 bNeedReordering =
true;
499 return Swap(pNextItem, pItem);
509 unsigned int uIdxToInsert;
513 uIdxToInsert = (
unsigned int)(pTargetItem - this->
m_pItems);
514 if (uIdxToInsert > uIdx)
521 uIdxToInsert = uLastIdx;
524 T_ITEM * pStartItem = this->
m_pItems + uIdx;
525 T_ITEM * pEndItem = this->
m_pItems + uIdxToInsert;
526 if (uIdxToInsert
529 while (pStartItem != pEndItem)
532 pStartItem[1] = pStartItem[0];
538 while (pStartItem != pEndItem)
540 pStartItem[0] = pStartItem[1];
544 pEndItem[0] = in_item;
554 if (NumItemsToReInsert != 0)
558 T_ITEM * pReinsertionItem = this->
m_pItems;
560 for (
AkInt32 idx = 0; idx
562 T_ITEM ItemtoReinsert = pReinsertionItem[idx];
564 T_KEY keyToReinsert = U_KEY::Get(ItemtoReinsert);
566 T_ITEM* pInsertionEmplacement =
AddNoSetKey(keyToReinsert);
569 *pInsertionEmplacement = ItemtoReinsert;
581 while ( uNumToSearch > 0 )
583 iPivot = iBase + ( uNumToSearch >> 1 );
584 T_KEY pivotKey = U_KEY::Get( this->
m_pItems[ iPivot ] );
585 if (
Equal( pivotKey, in_key ) )
591 if (
Lesser( pivotKey, in_key ) )
612 AKASSERT(in_to.pItem >= in_from.pItem);
617 while (uNumToSearch > 0)
619 uPivot = uBase + (
AkUInt32)(uNumToSearch >> 1);
620 T_KEY pivotKey = U_KEY::Get(this->
m_pItems[uPivot]);
621 if (
Lesser(pivotKey, in_key))
634 T_ITEM ItemTemp = *in_ItemA;
635 *in_ItemA = *in_ItemB;
636 *in_ItemB = ItemTemp;
641 #endif //_KEYARRAY_H_
T_ITEM * Exists(T_KEY in_Key) const
T_ITEM * Set(T_KEY in_Key, const T_ITEM &in_Item)
AkArray, const MapStruct &, U_POOL, TGrowBy, TMovePolicy >::Iterator FindEx(T_KEY in_Item) const
T_ITEM * Set(T_KEY in_key, bool &out_bExists)
T_ITEM * Set(T_KEY in_Key)
Key policy for AkSortedKeyArray.
T_ITEM * LowerBounds(T_KEY in_key, Iterator in_from, Iterator in_to) const
AkForceInline bool Equal(const T_KEY &a, const T_KEY &b) const
bool SortedUpdate(AkUInt32 in_numUpdates, const T_UPDATE *in_pUpdates, FN_EXISTS in_fnExists, FN_NEW in_fnNew, FN_OLD in_fnOld)
T_ITEM * Exists(T_KEY in_key) const
T_ITEM * LowerBounds(T_KEY in_key) const
Specific implementation of array.
int32_t AkInt32
Signed 32-bit integer.
T_ITEM * BinarySearch(T_KEY in_key, bool &out_bFound) const
AkUInt32 m_uLength
number of items in the array.
static AkForceInline bool Equal(THIS_CLASS *, const T_KEY &a, const T_KEY &b)
T_ITEM * AddNoSetKey(T_KEY in_key, bool &out_bFound)
AkForceInline void Swap(T_ITEM *in_ItemA, T_ITEM *in_ItemB)
#define AKASSERT(Condition)
static const T_KEY & Get(const T_UPDATE &in)
AkForceInline bool Lesser(const T_KEY &a, const T_KEY &b) const
T_ITEM * SetFirst(T_KEY in_Key, const T_ITEM &in_Item)
Iterator End() const
Returns the iterator to the end of the array.
Iterator Insert(Iterator &in_rIter)
Trivial key policy for AkSortedKeyArray, when T_KEY is T_ITEM.
T_ITEM * Add(T_KEY in_key)
static AkForceInline bool Lesser(THIS_CLASS *, const T_KEY &a, const T_KEY &b)
Iterator Erase(Iterator &in_rIter)
Erase the specified iterator from the array.
AkUInt32 GetIndex(T_ITEM *in_pItem) const
Iterator Begin() const
Returns the iterator to the first item of the array, will be End() if the array is empty.
int64_t AkInt64
Signed 64-bit integer.
AkForceInline AkUInt32 Length() const
Returns the numbers of items in the array.
static AkForceInline T_KEY & Get(T_ITEM &in_item)
Default policy.
AkForceInline MapStruct * AddLast()
static AkForceInline T_KEY & Get(T_ITEM &in_item)
Default policy.
uint32_t AkUInt32
Unsigned 32-bit integer.
T_ITEM * AddNoSetKey(T_KEY in_key)
void UnsetSwap(T_KEY in_Key)
typename base::Iterator Iterator
static AkForceInline T_KEY & Get(T_KEY &in_item)
Default policy.
void Reorder(T_KEY in_OldKey, T_KEY in_NewKey, const T_ITEM &in_item)
Iterator EraseSwap(Iterator &in_rIter)
T_ITEM * Set(T_KEY in_key)
T_ITEM * m_pItems
pointer to the beginning of the array.