UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TBitArray< Allocator > Class Template Reference

#include <BitArray.h>

Classes

class  FConstIterator
 
class  FConstReverseIterator
 
struct  FConstWordIterator
 
class  FIterator
 
class  FReverseIterator
 
struct  FWordIterator
 

Public Types

typedef Allocator::template ForElementType< uint32AllocatorType
 

Public Member Functions

constexpr TBitArray ()
 
consteval TBitArray (EConstEval)
 
UE_FORCEINLINE_HINT TBitArray (bool bValue, int32 InNumBits)
 
UE_FORCEINLINE_HINT TBitArray (TBitArray &&Other)
 
UE_FORCEINLINE_HINT TBitArray (const TBitArray &Copy)
 
template<typename OtherAllocator >
UE_FORCEINLINE_HINT TBitArray (const TBitArray< OtherAllocator > &Copy)
 
UE_FORCEINLINE_HINT TBitArrayoperator= (TBitArray &&Other)
 
UE_FORCEINLINE_HINT TBitArrayoperator= (const TBitArray &Copy)
 
template<typename OtherAllocator >
UE_FORCEINLINE_HINT TBitArrayoperator= (const TBitArray< OtherAllocator > &Copy)
 
UE_FORCEINLINE_HINT bool operator== (const TBitArray< Allocator > &Other) const
 
UE_FORCEINLINE_HINT bool operator< (const TBitArray< Allocator > &Other) const
 
UE_FORCEINLINE_HINT bool operator!= (const TBitArray< Allocator > &Other) const
 
void CheckInvariants () const
 
void Serialize (FArchive &Ar)
 
int32 Add (const bool Value)
 
int32 Add (const bool Value, int32 NumBitsToAdd)
 
template<typename InWordType >
int32 AddRange (const InWordType *ReadBits, int32 NumBitsToAdd, int32 ReadOffsetBits=0)
 
template<typename OtherAllocator >
int32 AddRange (const TBitArray< OtherAllocator > &ReadBits, int32 NumBitsToAdd, int32 ReadOffsetBits=0)
 
int32 AddUninitialized (int32 NumBitsToAdd)
 
void Insert (bool Value, int32 Index)
 
void Insert (bool Value, int32 Index, int32 NumBitsToAdd)
 
template<typename InWordType >
void InsertRange (const InWordType *ReadBits, int32 Index, int32 NumBitsToAdd, int32 ReadOffsetBits=0)
 
template<typename OtherAllocator >
void InsertRange (const TBitArray< OtherAllocator > &ReadBits, int32 Index, int32 NumBitsToAdd, int32 ReadOffsetBits=0)
 
void InsertUninitialized (int32 Index, int32 NumBitsToAdd)
 
void Empty (int32 ExpectedNumBits=0)
 
void Reserve (int32 Number)
 
void Reset ()
 
UE_FORCEINLINE_HINT void Init (bool bValue, int32 InNumBits)
 
void SetNumUninitialized (int32 InNumBits)
 
template<typename ValueType >
FORCENOINLINE void SetNum (int32 InNumBits, ValueType bValue)
 
FORCENOINLINE void SetRange (int32 Index, int32 NumBitsToSet, bool Value)
 
template<typename InWordType >
void SetRangeFromRange (int32 Index, int32 NumBitsToSet, const InWordType *ReadBits, int32 ReadOffsetBits=0)
 
template<typename OtherAllocator >
UE_FORCEINLINE_HINT void SetRangeFromRange (int32 Index, int32 NumBitsToSet, const TBitArray< OtherAllocator > &ReadBits, int32 ReadOffsetBits=0)
 
template<typename InWordType >
UE_FORCEINLINE_HINT void GetRange (int32 Index, int32 NumBitsToGet, InWordType *WriteBits, int32 WriteOffsetBits=0) const
 
void RemoveAt (int32 BaseIndex, int32 NumBitsToRemove=1)
 
void RemoveAtSwap (int32 BaseIndex, int32 NumBitsToRemove=1)
 
uint32 GetAllocatedSize (void) const
 
void CountBytes (FArchive &Ar) const
 
int32 Find (bool bValue) const
 
template<typename IndexType >
UE_FORCEINLINE_HINT int32 FindFrom (bool bValue, IndexType StartIndex) const
 
template<typename IndexType >
UE_FORCEINLINE_HINT int32 FindFrom (bool bValue, IndexType StartIndex, IndexType EndIndexExclusive) const
 
int32 FindLast (bool bValue) const
 
template<typename IndexType >
int32 FindLastFrom (bool bValue, IndexType EndIndexInclusive) const
 
UE_FORCEINLINE_HINT bool Contains (bool bValue) const
 
int32 FindAndSetFirstZeroBit (int32 StartIndex=0)
 
int32 FindAndSetLastZeroBit ()
 
template<typename OtherAllocator , typename BinaryOpType >
TBitArrayCombineWithBinaryOp (const TBitArray< OtherAllocator > &InOther, EBitwiseOperatorFlags InFlags, BinaryOpType &&InBinaryOp)
 
template<typename OtherAllocator >
TBitArrayCombineWithBitwiseAND (const TBitArray< OtherAllocator > &InOther, EBitwiseOperatorFlags InFlags)
 
template<typename OtherAllocator >
TBitArrayCombineWithBitwiseOR (const TBitArray< OtherAllocator > &InOther, EBitwiseOperatorFlags InFlags)
 
template<typename OtherAllocator >
TBitArrayCombineWithBitwiseXOR (const TBitArray< OtherAllocator > &InOther, EBitwiseOperatorFlags InFlags)
 
void BitwiseNOT ()
 
int32 CountSetBits (int32 FromIndex=0, int32 ToIndex=INDEX_NONE) const
 
template<typename OtherAllocator >
bool CompareSetBits (const TBitArray< OtherAllocator > &Other, const bool bMissingBitValue) const
 
int32 PadToNum (int32 DesiredNum, bool bPadValue)
 
UE_FORCEINLINE_HINT bool IsValidIndex (int32 InIndex) const
 
bool IsEmpty () const
 
UE_FORCEINLINE_HINT int32 Num () const
 
UE_FORCEINLINE_HINT int32 Max () const
 
UE_FORCEINLINE_HINT FBitReference operator[] (int32 Index)
 
UE_FORCEINLINE_HINT const FConstBitReference operator[] (int32 Index) const
 
UE_FORCEINLINE_HINT FBitReference AccessCorrespondingBit (const FRelativeBitReference &RelativeReference)
 
UE_FORCEINLINE_HINT const FConstBitReference AccessCorrespondingBit (const FRelativeBitReference &RelativeReference) const
 
UE_FORCEINLINE_HINT const uint32GetData () const
 
UE_FORCEINLINE_HINT uint32GetData ()
 
UE_FORCEINLINE_HINT FIterator begin ()
 
UE_FORCEINLINE_HINT FConstIterator begin () const
 
UE_FORCEINLINE_HINT FIterator end ()
 
UE_FORCEINLINE_HINT FConstIterator end () const
 
UE_FORCEINLINE_HINT FReverseIterator rbegin ()
 
UE_FORCEINLINE_HINT FConstReverseIterator rbegin () const
 
UE_FORCEINLINE_HINT FReverseIterator rend ()
 
UE_FORCEINLINE_HINT FConstReverseIterator rend () const
 
void WriteMemoryImage (FMemoryImageWriter &Writer) const
 

Static Public Member Functions

template<typename AllocatorA , typename AllocatorB >
static TBitArray BitwiseAND (const TBitArray< AllocatorA > &A, const TBitArray< AllocatorB > &B, EBitwiseOperatorFlags InFlags)
 
template<typename AllocatorA , typename AllocatorB >
static TBitArray BitwiseOR (const TBitArray< AllocatorA > &A, const TBitArray< AllocatorB > &B, EBitwiseOperatorFlags InFlags)
 
template<typename AllocatorA , typename AllocatorB >
static TBitArray BitwiseXOR (const TBitArray< AllocatorA > &A, const TBitArray< AllocatorB > &B, EBitwiseOperatorFlags InFlags)
 

Friends

template<typename , typename >
class TScriptBitArray
 
template<typename >
class TConstSetBitIterator
 
template<typename , typename , bool >
class TConstDualSetBitIterator
 
template<typename AllocatorA , typename AllocatorB , typename OutAllocator , typename ProjectionType >
void UE::Core::Private::BitwiseBinaryOperatorImpl (const TBitArray< AllocatorA > &, const TBitArray< AllocatorB > &, TBitArray< OutAllocator > &, EBitwiseOperatorFlags, ProjectionType &&)
 
template<typename OtherAllocator , typename OutAllocator , typename ProjectionType >
void UE::Core::Private::BitwiseOperatorImpl (const TBitArray< OtherAllocator > &, TBitArray< OutAllocator > &, EBitwiseOperatorFlags, ProjectionType &&)
 

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.

Member Typedef Documentation

◆ AllocatorType

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

Constructor & Destructor Documentation

◆ TBitArray() [1/6]

template<typename Allocator >
constexpr TBitArray< Allocator >::TBitArray ( )
inlineconstexpr

◆ TBitArray() [2/6]

◆ TBitArray() [3/6]

template<typename Allocator >
UE_FORCEINLINE_HINT TBitArray< Allocator >::TBitArray ( bool  bValue,
int32  InNumBits 
)
inlineexplicit

Minimal initialization constructor.

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

◆ TBitArray() [4/6]

Move constructor.

◆ TBitArray() [5/6]

Copy constructor.

◆ TBitArray() [6/6]

Member Function Documentation

◆ AccessCorrespondingBit() [1/2]

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

◆ AccessCorrespondingBit() [2/2]

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

◆ Add() [1/2]

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.

◆ Add() [2/2]

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

Adds multiple bits to the array with the given value.

Returns
The index of the first added bit.

◆ AddRange() [1/2]

template<typename Allocator >
template<typename InWordType >
int32 TBitArray< Allocator >::AddRange ( const InWordType ReadBits,
int32  NumBitsToAdd,
int32  ReadOffsetBits = 0 
)
inline

Adds multiple bits read from the given pointer.

Parameters
ReadBitsThe address of sized integers to read the bits from. Bits are read from ReadBits in the current platform's mathematical bitorder (ReadBits[0] & 0x1, ReadBits[0] & 0x2, ... ReadBits[0] & 0x100, ... ReadBits[0] & 0x80000000, ReadBits[1] & 0x1 ...
NumBitsToAddThe number of bits to add. Must be >= 0.
ReadOffsetBitsNumber of bits into ReadBits at which to start reading. Must be >= 0.
Returns
The index of the first added bit.

◆ AddRange() [2/2]

template<typename Allocator >
int32 TBitArray< Allocator >::AddRange ( const TBitArray< OtherAllocator > &  ReadBits,
int32  NumBitsToAdd,
int32  ReadOffsetBits = 0 
)
inline

Adds multiple bits read from the given BitArray.

Parameters
ReadBitsThe value to set the bits to.
NumBitsToAddThe number of bits to add. Must be >= 0.
ReadOffsetBitsNumber of bits into ReadBits at which to start reading. Must be >= 0.
Returns
The index of the first added bit.

◆ AddUninitialized()

template<typename Allocator >
int32 TBitArray< Allocator >::AddUninitialized ( int32  NumBitsToAdd)
inline

Inserts space for multiple bits at the end of the array. The inserted bits are set to arbitrary values and should be written using SetRange or otherwise before being read.

Parameters
NumBitsToAddThe number of bits to add. Must be >= 0.

◆ begin() [1/2]

Enables range-based for loops, DO NOT USE DIRECTLY.

◆ begin() [2/2]

◆ BitwiseAND()

template<typename Allocator >
static TBitArray TBitArray< Allocator >::BitwiseAND ( const TBitArray< AllocatorA > &  A,
const TBitArray< AllocatorB > &  B,
EBitwiseOperatorFlags  InFlags 
)
inlinestatic

Return the bitwise AND of two bit arrays. The resulting bit array will be sized according to InFlags.

◆ BitwiseNOT()

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

Perform a bitwise NOT on all the bits in this array

◆ BitwiseOR()

template<typename Allocator >
static TBitArray TBitArray< Allocator >::BitwiseOR ( const TBitArray< AllocatorA > &  A,
const TBitArray< AllocatorB > &  B,
EBitwiseOperatorFlags  InFlags 
)
inlinestatic

Return the bitwise OR of two bit arrays. The resulting bit array will be sized according to InFlags.

◆ BitwiseXOR()

template<typename Allocator >
static TBitArray TBitArray< Allocator >::BitwiseXOR ( const TBitArray< AllocatorA > &  A,
const TBitArray< AllocatorB > &  B,
EBitwiseOperatorFlags  InFlags 
)
inlinestatic

Return the bitwise XOR of two bit arrays. The resulting bit array will be sized according to InFlags.

◆ CheckInvariants()

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

Checks the invariants of this class

◆ CombineWithBinaryOp()

template<typename Allocator >
TBitArray & TBitArray< Allocator >::CombineWithBinaryOp ( const TBitArray< OtherAllocator > &  InOther,
EBitwiseOperatorFlags  InFlags,
BinaryOpType &&  InBinaryOp 
)
inline

Perform a custom bitwise operation on this bit array with another. This array receives the result and will be sized max(A.Num(), B.Num()).

◆ CombineWithBitwiseAND()

template<typename Allocator >
TBitArray & TBitArray< Allocator >::CombineWithBitwiseAND ( const TBitArray< OtherAllocator > &  InOther,
EBitwiseOperatorFlags  InFlags 
)
inline

Perform a bitwise AND on this bit array with another. This array receives the result and will be sized max(A.Num(), B.Num()).

◆ CombineWithBitwiseOR()

template<typename Allocator >
TBitArray & TBitArray< Allocator >::CombineWithBitwiseOR ( const TBitArray< OtherAllocator > &  InOther,
EBitwiseOperatorFlags  InFlags 
)
inline

Return the bitwise OR of two bit arrays. The resulting bit array will be sized according to InFlags.

◆ CombineWithBitwiseXOR()

template<typename Allocator >
TBitArray & TBitArray< Allocator >::CombineWithBitwiseXOR ( const TBitArray< OtherAllocator > &  InOther,
EBitwiseOperatorFlags  InFlags 
)
inline

Return the bitwise XOR of two bit arrays. The resulting bit array will be sized according to InFlags.

◆ CompareSetBits()

template<typename Allocator >
bool TBitArray< Allocator >::CompareSetBits ( const TBitArray< OtherAllocator > &  Other,
const bool  bMissingBitValue 
) const
inline

Returns true if Other contains all the same set bits as this, accounting for differences in length. Similar to operator== but can handle different length arrays by zero or one-filling missing bits.

Parameters
OtherThe array to compare against
bMissingBitValueThe value to use for missing bits when considering bits that are outside the range of either array
Returns
true if this array matches Other, including any missing bits, false otherwise

◆ Contains()

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

Checks if the array contains the specified value (true/false).

Parameters
bValueThe value (true/false) to check for.
Returns
true if the array contains the specified value, false otherwise.

◆ CountBytes()

template<typename Allocator >
void TBitArray< Allocator >::CountBytes ( FArchive Ar) const
inline

Tracks the container's memory use through an archive.

◆ CountSetBits()

template<typename Allocator >
int32 TBitArray< Allocator >::CountSetBits ( int32  FromIndex = 0,
int32  ToIndex = INDEX_NONE 
) const
inline

Count the number of set bits in this array FromIndex <= bit < ToIndex

◆ 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.

◆ end() [1/2]

◆ end() [2/2]

◆ Find()

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

Finds the first occurrence of the specified value (true/false) in the array, and returns the bit index. If the specified value is not found, INDEX_NONE is returned.

Parameters
bValueThe value (true/false) to search for.
Returns
The index of the first occurrence of the specified value (true/false), or INDEX_NONE if not found.

◆ FindAndSetFirstZeroBit()

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

Finds the first occurrence of a zero bit in the array and sets it to one, returning the bit index. If there are no zero bits in the array, INDEX_NONE is returned.

Parameters
StartIndexThe index to start the search from. Defaults to 0.
Returns
The index of the first occurrence of a zero bit that was successfully set to one, or INDEX_NONE if not found.

◆ FindAndSetLastZeroBit()

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

Finds the last occurrence of a zero bit in the array and sets it to one, returning the bit index. If there are no zero bits in the array, INDEX_NONE is returned.

Returns
The index of the last occurrence of a zero bit that was successfully set to one, or INDEX_NONE if not found.

◆ FindFrom() [1/2]

template<typename Allocator >
template<typename IndexType >
UE_FORCEINLINE_HINT int32 TBitArray< Allocator >::FindFrom ( bool  bValue,
IndexType  StartIndex 
) const
inline

Finds the first occurrence of the specified value (true/false) in the array, starting from the given bit index, and returns the bit index. If the specified value is not found from the given index, INDEX_NONE is returned.

Parameters
bValueThe value (true/false) to search for.
StartIndexThe index to start the search from.
Precondition
StartIndex is expected to be in the inclusive range [0, Num()].
Returns
The index of the first occurrence of the specified value (true/false) from StartIndex, or INDEX_NONE if not found.

◆ FindFrom() [2/2]

template<typename Allocator >
template<typename IndexType >
UE_FORCEINLINE_HINT int32 TBitArray< Allocator >::FindFrom ( bool  bValue,
IndexType  StartIndex,
IndexType  EndIndexExclusive 
) const
inline

Finds the first occurrence of the specified value (true/false) in the array, starting from the given bit index, and returns the bit index. If the specified value is not found from the given index, INDEX_NONE is returned.

Parameters
bValueThe value (true/false) to search for.
StartIndexThe index to start the search from.
EndIndexExclusiveThe index to end the search at.
Precondition
StartIndex is expected to be in the inclusive range [0, Num()].
EndIndexExclusive is expected to be in the inclusive range [0, Num()].
Returns
The index of the first occurrence of the specified value (true/false) from StartIndex to EndIndexExclusive, or INDEX_NONE if not found.

◆ FindLast()

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

Finds the last occurrence of the specified value (true/false) in the array, and returns the bit index. If the specified value is not found, INDEX_NONE is returned.

Parameters
bValueThe value (true/false) to search for.
Returns
The index of the last occurrence of the specified value (true/false), or INDEX_NONE if not found.

◆ FindLastFrom()

template<typename Allocator >
template<typename IndexType >
int32 TBitArray< Allocator >::FindLastFrom ( bool  bValue,
IndexType  EndIndexInclusive 
) const
inline

Finds the last occurrence of the specified value (true/false) in the array starting the (reverse) search from the given bit index, and returns the bit index. If the specified value is not found, INDEX_NONE is returned.

Parameters
bValueThe value (true/false) to search for.
EndIndexInclusiveThe index to start the (reverse) search from.
Returns
The index of the last occurrence of the specified value (true/false) from EndIndexInclusive, or INDEX_NONE if not found.

◆ 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

◆ GetData() [1/2]

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

◆ GetData() [2/2]

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

◆ GetRange()

template<typename Allocator >
template<typename InWordType >
UE_FORCEINLINE_HINT void TBitArray< Allocator >::GetRange ( int32  Index,
int32  NumBitsToGet,
InWordType WriteBits,
int32  WriteOffsetBits = 0 
) const
inline

Reads a range of bits within the array and writes them to the given pointer.

Parameters
IndexThe index of the first bit to read; must be 0 <= Index <= Num().
NumBitsToGetThe number of bits to read, must satisify 0 <= NumBitsToGet && Index + NumBitsToGet <= Num().
WriteBitsThe address of sized integers to write the bits to. Bits are written into WriteBits in the current platform's mathematical bitorder (WriteBits[0] & 0x1, WriteBits[0] & 0x2, ... WriteBits[0] & 0x100, ... WriteBits[0] & 0x80000000, WriteBits[1] & 0x1 ...
WriteOffsetBitsNumber of bits into WriteBits at which to start writing.

◆ Init()

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

Resets the array's contents. Use TBitArray(bool bValue, int32 InNumBits) instead of default constructor and Init().

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

◆ Insert() [1/2]

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

Adds a bit with the given value at the given index in the array.

Parameters
ValueThe value of the bit to add
Index- The index at which to add; must be 0 <= Index <= Num().

◆ Insert() [2/2]

template<typename Allocator >
void TBitArray< Allocator >::Insert ( bool  Value,
int32  Index,
int32  NumBitsToAdd 
)
inline

Inserts multiple bits with the given value into the array, starting at the given Index.

Parameters
ValueThe value of the bits to add
IndexThe index at which to add; must be 0 <= Index <= Num().
NumBitsToAddThe number of bits to add. Must be >= 0.

◆ InsertRange() [1/2]

template<typename Allocator >
template<typename InWordType >
void TBitArray< Allocator >::InsertRange ( const InWordType ReadBits,
int32  Index,
int32  NumBitsToAdd,
int32  ReadOffsetBits = 0 
)
inline

Inserts multiple bits read from the given pointer, starting at the given index.

Parameters
ReadBitsThe address of sized integers to read the bits from. Bits are read from ReadBits in the current platform's mathematical bitorder (ReadBits[0] & 0x1, ReadBits[0] & 0x2, ... ReadBits[0] & 0x100, ... ReadBits[0] & 0x80000000, ReadBits[1] & 0x1 ...
IndexThe index at which to add; must be 0 <= Index <= Num().
NumBitsToAddThe number of bits to add. Must be >= 0.
ReadOffsetBitsNumber of bits into ReadBits at which to start reading.

◆ InsertRange() [2/2]

template<typename Allocator >
void TBitArray< Allocator >::InsertRange ( const TBitArray< OtherAllocator > &  ReadBits,
int32  Index,
int32  NumBitsToAdd,
int32  ReadOffsetBits = 0 
)
inline

Inserts multiple bits read from the given BitArray into the array, starting at the given index.

Parameters
ReadBitsThe value to set the bits to.
IndexThe index at which to add; must be 0 <= Index <= Num().
NumBitsToAddThe number of bits to add. Must be >= 0.
ReadOffsetBitsNumber of bits into ReadBits at which to start reading.

◆ InsertUninitialized()

template<typename Allocator >
void TBitArray< Allocator >::InsertUninitialized ( int32  Index,
int32  NumBitsToAdd 
)
inline

Inserts space for multiple bits into the array, starting at the given index. The inserted bits are set to arbitrary values and should be written using SetRange or otherwise before being read.

Parameters
IndexThe index at which to add; must be 0 <= Index <= Num().
NumBitsToAddThe number of bits to add. Must be >= 0.

◆ IsEmpty()

template<typename Allocator >
bool TBitArray< Allocator >::IsEmpty ( ) const
inline

Returns true if the bit array is empty and contains no elements.

Returns
True if the bit array is empty.
See also
Num

◆ IsValidIndex()

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

◆ Max()

template<typename Allocator >
UE_FORCEINLINE_HINT int32 TBitArray< Allocator >::Max ( ) const
inline

◆ Num()

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

◆ operator!=()

template<typename Allocator >
UE_FORCEINLINE_HINT bool TBitArray< Allocator >::operator!= ( const TBitArray< Allocator > &  Other) const
inline

◆ operator<()

template<typename Allocator >
UE_FORCEINLINE_HINT bool TBitArray< Allocator >::operator< ( const TBitArray< Allocator > &  Other) const
inline

◆ operator=() [1/3]

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

Assignment operator.

◆ operator=() [2/3]

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

◆ operator=() [3/3]

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

Move assignment.

◆ operator==()

template<typename Allocator >
UE_FORCEINLINE_HINT bool TBitArray< Allocator >::operator== ( const TBitArray< Allocator > &  Other) const
inline

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

◆ PadToNum()

template<typename Allocator >
int32 TBitArray< Allocator >::PadToNum ( int32  DesiredNum,
bool  bPadValue 
)
inline

Pad this bit array with the specified value to ensure that it is at least the specified length. Does nothing if Num() >= DesiredNum.

Parameters
DesiredNumThe desired number of elements that should exist in the array.
bPadValueThe value to pad with (0 or 1)
Returns
The number of bits that were added to the array, or 0 if Num() >= DesiredNum.

◆ rbegin() [1/2]

◆ rbegin() [2/2]

◆ 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.

◆ RemoveAtSwap()

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

◆ rend() [1/2]

◆ rend() [2/2]

◆ Reserve()

template<typename Allocator >
void TBitArray< Allocator >::Reserve ( int32  Number)
inline

Reserves memory such that the array can contain at least Number bits.

@Number The number of bits to reserve space for.

◆ Reset()

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

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

◆ Serialize()

template<typename Allocator >
void TBitArray< Allocator >::Serialize ( FArchive Ar)
inline

Serializer

◆ SetNum()

template<typename Allocator >
template<typename ValueType >
FORCENOINLINE void TBitArray< Allocator >::SetNum ( int32  InNumBits,
ValueType  bValue 
)
inline

Sets the number of bits, initializing any potentially added bits to the given value.

◆ SetNumUninitialized()

template<typename Allocator >
void TBitArray< Allocator >::SetNumUninitialized ( int32  InNumBits)
inline

Sets number of bits without initializing new bits.

◆ SetRange()

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

Sets or unsets a range of bits within the array.

Parameters
IndexThe index of the first bit to set; must be 0 <= Index <= Num().
NumBitsToSetThe number of bits to set, must satisify Index + NumBitsToSet <= Num().
ValueThe value to set the bits to.

◆ SetRangeFromRange() [1/2]

template<typename Allocator >
template<typename InWordType >
void TBitArray< Allocator >::SetRangeFromRange ( int32  Index,
int32  NumBitsToSet,
const InWordType ReadBits,
int32  ReadOffsetBits = 0 
)
inline

Sets range of bits within the TBitArray to the values read out of a pointer.

Parameters
IndexThe index of the first bit to set; must be 0 <= Index <= Num().
NumBitsToSetThe number of bits to set, must satisify 0 <= NumBitsToSet && Index + NumBitsToSet <= Num().
ReadBitsThe address of sized integers to read the bits from. Bits are read from ReadBits in the current platform's mathematical bitorder (ReadBits[0] & 0x1, ReadBits[0] & 0x2, ... ReadBits[0] & 0x100, ... ReadBits[0] & 0x80000000, ReadBits[1] & 0x1 ...
ReadOffsetBitsNumber of bits into ReadBits at which to start reading.

◆ SetRangeFromRange() [2/2]

template<typename Allocator >
UE_FORCEINLINE_HINT void TBitArray< Allocator >::SetRangeFromRange ( int32  Index,
int32  NumBitsToSet,
const TBitArray< OtherAllocator > &  ReadBits,
int32  ReadOffsetBits = 0 
)
inline

Sets range of bits within this TBitArray to the values read out another TBitArray.

Parameters
IndexThe index of the first bit to set; must be 0 <= Index <= Num().
NumBitsToSetThe number of bits to set, must satisify 0 <= NumBitsToSet && Index + NumBitsToSet <= Num().
ReadBitsThe value to set the bits to.
ReadOffsetBitsNumber of bits into ReadBits at which to start reading.

◆ WriteMemoryImage()

template<typename Allocator >
void TBitArray< Allocator >::WriteMemoryImage ( FMemoryImageWriter Writer) const
inline

Friends And Related Symbol Documentation

◆ TConstDualSetBitIterator

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

◆ TConstSetBitIterator

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

◆ TScriptBitArray

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

◆ UE::Core::Private::BitwiseBinaryOperatorImpl

◆ UE::Core::Private::BitwiseOperatorImpl


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