BlockArray< T, BLOCK_SIZE_EXPONENT, MEMFLAGS, ALLOCATOR >::ArrayOfBlocks Class Reference

Public Member Functions

 ArrayOfBlocks ()
 
 ArrayOfBlocks (const ForwardAllocator &a)
 
 ArrayOfBlocks (ForwardAllocator &&a)
 
 ArrayOfBlocks (ArrayOfBlocks &&src)
 
void Reset ()
 
void Flush ()
 
Int GetCount () const
 
Bool IsEmpty () const
 
Bool IsPopulated () const
 
Bool IsContinuous () const
 
void MarkAsNoncontinuous ()
 
ArrayBlockoperator[] (Int index)
 
const ArrayBlockoperator[] (Int index) const
 
Super::Iterator Begin ()
 
Super::ConstIterator Begin () const
 
ArrayBlockGetLast ()
 
Super Disconnect ()
 
const ArrayBlockGetLast () const
 
ArrayBlockAppend ()
 
ArrayBlockInsert (Int position)
 
ArrayBlockErase (Int position)
 
ArrayBlockPop ()
 
Int GetIndex (const ArrayBlock &x) const
 
ArrayBlockSplitBlock (Int blockIdx, Int localIdx)
 
void UpdateSubmittedElementCount (const ArrayBlock *block, Int cnt)
 
Int GetSubmittedElementCount () const
 
Int GetMemorySize () const
 

Private Types

using Super = BaseArray< ArrayBlock, BASEARRAY_DEFAULT_CHUNK_SIZE, BASEARRAYFLAGS::NONE, ForwardAllocator >
 

Private Member Functions

ArrayBlockInsertOnly (Int position)
 

Private Attributes

Super _array
 
Int _usedBlockCnt
 
Int _submittedElementCnt
 
Int _isContinuous
 
Int _reserved
 

Member Typedef Documentation

◆ Super

Constructor & Destructor Documentation

◆ ArrayOfBlocks() [1/4]

◆ ArrayOfBlocks() [2/4]

ArrayOfBlocks ( const ForwardAllocator a)
explicit

◆ ArrayOfBlocks() [3/4]

ArrayOfBlocks ( ForwardAllocator &&  a)
explicit

◆ ArrayOfBlocks() [4/4]

Member Function Documentation

◆ Reset()

void Reset ( )

◆ Flush()

void Flush ( )

◆ GetCount()

Int GetCount ( ) const

◆ IsEmpty()

Bool IsEmpty ( ) const

◆ IsPopulated()

Bool IsPopulated ( ) const

◆ IsContinuous()

Bool IsContinuous ( ) const

◆ MarkAsNoncontinuous()

void MarkAsNoncontinuous ( )

◆ operator[]() [1/2]

ArrayBlock& operator[] ( Int  index)

◆ operator[]() [2/2]

const ArrayBlock& operator[] ( Int  index) const

◆ Begin() [1/2]

Super::Iterator Begin ( )

◆ Begin() [2/2]

Super::ConstIterator Begin ( ) const

◆ GetLast() [1/2]

ArrayBlock* GetLast ( )
Returns
Pointer to the last ArrayBlock (undefined if the array is empty).

◆ Disconnect()

Super Disconnect ( )

◆ GetLast() [2/2]

const ArrayBlock* GetLast ( ) const
Returns
Pointer to the last ArrayBlock (undefined if the array is empty).

◆ Append()

ArrayBlock* Append ( )

◆ Insert()

ArrayBlock* Insert ( Int  position)

◆ Erase()

ArrayBlock* Erase ( Int  position)

◆ Pop()

ArrayBlock* Pop ( )

◆ GetIndex()

Int GetIndex ( const ArrayBlock x) const

◆ SplitBlock()

ArrayBlock* SplitBlock ( Int  blockIdx,
Int  localIdx 
)

◆ UpdateSubmittedElementCount()

void UpdateSubmittedElementCount ( const ArrayBlock block,
Int  cnt 
)

◆ GetSubmittedElementCount()

Int GetSubmittedElementCount ( ) const

◆ GetMemorySize()

Int GetMemorySize ( ) const

Calculates the memory usage for this array. The array element class must have a public member GetMemorySize that returns an element's size.

Returns
Memory size in bytes.

◆ InsertOnly()

ArrayBlock* InsertOnly ( Int  position)
private

Member Data Documentation

◆ _array

Super _array
private

◆ _usedBlockCnt

Int _usedBlockCnt
private

◆ _submittedElementCnt

Int _submittedElementCnt
private

◆ _isContinuous

Int _isContinuous
private

◆ _reserved

Int _reserved
private