Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
TBitArray< Allocator > Class Template Reference

#include <BitArray.h>

Classes

class  FConstIterator
 
class  FConstReverseIterator
 
class  FIterator
 

Public Member Functions

 TBitArray (const bool Value=false, const int32 InNumBits=0)
 
FORCEINLINE TBitArray (TBitArray &&Other)
 
FORCEINLINE TBitArray (const TBitArray &Copy)
 
FORCEINLINE TBitArrayoperator= (TBitArray &&Other)
 
FORCEINLINE TBitArrayoperator= (const TBitArray &Copy)
 
int32 Add (const bool Value)
 
void Empty (int32 ExpectedNumBits=0)
 
void Reset ()
 
void Init (bool Value, int32 InNumBits)
 
FORCENOINLINE void SetRange (int32 Index, int32 Num, bool Value)
 
void RemoveAt (int32 BaseIndex, int32 NumBitsToRemove=1)
 
void RemoveAtSwap (int32 BaseIndex, int32 NumBitsToRemove=1)
 
uint32 GetAllocatedSize (void) const
 
int32 Find (bool bValue) const
 
FORCEINLINE bool Contains (bool bValue) const
 
int32 FindAndSetFirstZeroBit ()
 
FORCEINLINE bool IsValidIndex (int32 InIndex) const
 
FORCEINLINE int32 Num () const
 
FORCEINLINE FBitReference operator[] (int32 Index)
 
FORCEINLINE const FConstBitReference operator[] (int32 Index) const
 
FORCEINLINE FBitReference AccessCorrespondingBit (const FRelativeBitReference &RelativeReference)
 
FORCEINLINE const FConstBitReference AccessCorrespondingBit (const FRelativeBitReference &RelativeReference) const
 
FORCEINLINE const uint32GetData () const
 
FORCEINLINE uint32GetData ()
 

Private Types

typedef Allocator::template ForElementType< uint32AllocatorType
 

Private Member Functions

FORCENOINLINE void Realloc (int32 PreviousNumBits)
 

Static Private Member Functions

template<typename BitArrayType >
static FORCEINLINE TEnableIf< TContainerTraits< BitArrayType >::MoveWillEmptyContainer >::Type MoveOrCopy (BitArrayType &ToArray, BitArrayType &FromArray)
 
template<typename BitArrayType >
static FORCEINLINE TEnableIf<!TContainerTraits< BitArrayType >::MoveWillEmptyContainer >::Type MoveOrCopy (BitArrayType &ToArray, BitArrayType &FromArray)
 

Private Attributes

AllocatorType AllocatorInstance
 
int32 NumBits
 
int32 MaxBits
 

Friends

class FScriptBitArray
 
template<typename >
class TConstSetBitIterator
 
template<typename , typename >
class TConstDualSetBitIterator
 

Detailed Description

template<typename Allocator>
class TBitArray< Allocator >

A dynamically sized bit array. An array of Booleans. They stored in one bit/Boolean. There are iterators that efficiently iterate over only set bits.

Definition at line 153 of file BitArray.h.

Member Typedef Documentation

◆ AllocatorType

template<typename Allocator >
typedef Allocator::template ForElementType<uint32> TBitArray< Allocator >::AllocatorType
private

Definition at line 701 of file BitArray.h.

Constructor & Destructor Documentation

◆ TBitArray() [1/3]

template<typename Allocator >
TBitArray< Allocator >::TBitArray ( const bool Value = false,
const int32 InNumBits = 0 )
inlineexplicit

Minimal initialization constructor.

Parameters
Value- The value to initial the bits to.
InNumBits- The initial number of bits in the array.

Definition at line 170 of file BitArray.h.

◆ TBitArray() [2/3]

template<typename Allocator >
FORCEINLINE TBitArray< Allocator >::TBitArray ( TBitArray< Allocator > && Other)
inline

Move constructor.

Definition at line 180 of file BitArray.h.

◆ TBitArray() [3/3]

template<typename Allocator >
FORCEINLINE TBitArray< Allocator >::TBitArray ( const TBitArray< Allocator > & Copy)
inline

Copy constructor.

Definition at line 188 of file BitArray.h.

Member Function Documentation

◆ AccessCorrespondingBit() [1/2]

template<typename Allocator >
FORCEINLINE FBitReference TBitArray< Allocator >::AccessCorrespondingBit ( const FRelativeBitReference & RelativeReference)
inline

Definition at line 547 of file BitArray.h.

◆ AccessCorrespondingBit() [2/2]

template<typename Allocator >
FORCEINLINE const FConstBitReference TBitArray< Allocator >::AccessCorrespondingBit ( const FRelativeBitReference & RelativeReference) const
inline

Definition at line 557 of file BitArray.h.

◆ Add()

template<typename Allocator >
int32 TBitArray< Allocator >::Add ( const bool Value)
inline

Adds a bit to the array with the given value.

Returns
The index of the added bit.

Definition at line 254 of file BitArray.h.

◆ Contains()

template<typename Allocator >
FORCEINLINE bool TBitArray< Allocator >::Contains ( bool bValue) const
inline

Definition at line 487 of file BitArray.h.

◆ Empty()

template<typename Allocator >
void TBitArray< Allocator >::Empty ( int32 ExpectedNumBits = 0)
inline

Removes all bits from the array, potentially leaving space allocated for an expected number of bits about to be added.

Parameters
ExpectedNumBits- The expected number of bits about to be added.

Definition at line 282 of file BitArray.h.

◆ Find()

template<typename Allocator >
int32 TBitArray< Allocator >::Find ( bool bValue) const
inline

Finds the first true/false bit in the array, and returns the bit index. If there is none, INDEX_NONE is returned.

Definition at line 459 of file BitArray.h.

◆ FindAndSetFirstZeroBit()

template<typename Allocator >
int32 TBitArray< Allocator >::FindAndSetFirstZeroBit ( )
inline

Finds the first zero bit in the array, sets it to true, and returns the bit index. If there is none, INDEX_NONE is returned.

Definition at line 496 of file BitArray.h.

◆ GetAllocatedSize()

template<typename Allocator >
uint32 TBitArray< Allocator >::GetAllocatedSize ( void ) const
inline

Helper function to return the amount of memory allocated by this container

Returns
number of bytes allocated by this container

Definition at line 450 of file BitArray.h.

◆ GetData() [1/2]

template<typename Allocator >
FORCEINLINE uint32 * TBitArray< Allocator >::GetData ( )
inline

Definition at line 695 of file BitArray.h.

◆ GetData() [2/2]

template<typename Allocator >
FORCEINLINE const uint32 * TBitArray< Allocator >::GetData ( ) const
inline

Definition at line 690 of file BitArray.h.

◆ Init()

template<typename Allocator >
void TBitArray< Allocator >::Init ( bool Value,
int32 InNumBits )
inline

Resets the array's contents.

Parameters
Value- The value to initial the bits to.
NumBits- The number of bits in the array.

Definition at line 311 of file BitArray.h.

◆ IsValidIndex()

template<typename Allocator >
FORCEINLINE bool TBitArray< Allocator >::IsValidIndex ( int32 InIndex) const
inline

Definition at line 525 of file BitArray.h.

◆ MoveOrCopy() [1/2]

template<typename Allocator >
template<typename BitArrayType >
static FORCEINLINE TEnableIf< TContainerTraits< BitArrayType >::MoveWillEmptyContainer >::Type TBitArray< Allocator >::MoveOrCopy ( BitArrayType & ToArray,
BitArrayType & FromArray )
inlinestaticprivate

Definition at line 232 of file BitArray.h.

◆ MoveOrCopy() [2/2]

template<typename Allocator >
template<typename BitArrayType >
static FORCEINLINE TEnableIf<!TContainerTraits< BitArrayType >::MoveWillEmptyContainer >::Type TBitArray< Allocator >::MoveOrCopy ( BitArrayType & ToArray,
BitArrayType & FromArray )
inlinestaticprivate

Definition at line 243 of file BitArray.h.

◆ Num()

template<typename Allocator >
FORCEINLINE int32 TBitArray< Allocator >::Num ( ) const
inline

Definition at line 530 of file BitArray.h.

◆ operator=() [1/2]

template<typename Allocator >
FORCEINLINE TBitArray & TBitArray< Allocator >::operator= ( const TBitArray< Allocator > & Copy)
inline

Assignment operator.

Definition at line 211 of file BitArray.h.

◆ operator=() [2/2]

template<typename Allocator >
FORCEINLINE TBitArray & TBitArray< Allocator >::operator= ( TBitArray< Allocator > && Other)
inline

Move assignment.

Definition at line 198 of file BitArray.h.

◆ operator[]() [1/2]

template<typename Allocator >
FORCEINLINE FBitReference TBitArray< Allocator >::operator[] ( int32 Index)
inline

Definition at line 531 of file BitArray.h.

◆ operator[]() [2/2]

template<typename Allocator >
FORCEINLINE const FConstBitReference TBitArray< Allocator >::operator[] ( int32 Index) const
inline

Definition at line 539 of file BitArray.h.

◆ Realloc()

template<typename Allocator >
FORCENOINLINE void TBitArray< Allocator >::Realloc ( int32 PreviousNumBits)
inlineprivate

Definition at line 707 of file BitArray.h.

◆ RemoveAt()

template<typename Allocator >
void TBitArray< Allocator >::RemoveAt ( int32 BaseIndex,
int32 NumBitsToRemove = 1 )
inline

Removes bits from the array.

Parameters
BaseIndex- The index of the first bit to remove.
NumBitsToRemove- The number of consecutive bits to remove.

Definition at line 388 of file BitArray.h.

◆ RemoveAtSwap()

template<typename Allocator >
void TBitArray< Allocator >::RemoveAtSwap ( int32 BaseIndex,
int32 NumBitsToRemove = 1 )
inline

Definition at line 418 of file BitArray.h.

◆ Reset()

template<typename Allocator >
void TBitArray< Allocator >::Reset ( )
inline

Removes all bits from the array retaining any space already allocated.

Definition at line 298 of file BitArray.h.

◆ SetRange()

template<typename Allocator >
FORCENOINLINE void TBitArray< Allocator >::SetRange ( int32 Index,
int32 Num,
bool Value )
inline

Sets or unsets a range of bits within the array.

Parameters
IndexThe index of the first bit to set.
NumThe number of bits to set.
ValueThe value to set the bits to.

Definition at line 327 of file BitArray.h.

Friends And Related Symbol Documentation

◆ FScriptBitArray

template<typename Allocator >
friend class FScriptBitArray
friend

Definition at line 155 of file BitArray.h.

◆ TConstDualSetBitIterator

template<typename Allocator >
template<typename , typename >
friend class TConstDualSetBitIterator
friend

Definition at line 163 of file BitArray.h.

◆ TConstSetBitIterator

template<typename Allocator >
template<typename >
friend class TConstSetBitIterator
friend

Definition at line 160 of file BitArray.h.

Member Data Documentation

◆ AllocatorInstance

template<typename Allocator >
AllocatorType TBitArray< Allocator >::AllocatorInstance
private

Definition at line 703 of file BitArray.h.

◆ MaxBits

template<typename Allocator >
int32 TBitArray< Allocator >::MaxBits
private

Definition at line 705 of file BitArray.h.

◆ NumBits

template<typename Allocator >
int32 TBitArray< Allocator >::NumBits
private

Definition at line 704 of file BitArray.h.


The documentation for this class was generated from the following file: