Navigation
API > API/Runtime > API/Runtime/Core
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.
| Name | TBitArray |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Containers/BitArray.h |
| Include Path | #include "Containers/BitArray.h" |
Syntax
template<typename Allocator>
class TBitArray
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Containers/BitArray.h | |||
constexpr TBitArray () |
Containers/BitArray.h | ||
consteval TBitArray
(
EConstEval |
Containers/BitArray.h | ||
| Move constructor. | Containers/BitArray.h | ||
| Copy constructor. | Containers/BitArray.h | ||
TBitArray
(
bool bValue, |
Minimal initialization constructor. | Containers/BitArray.h |
Classes
| Name | Remarks |
|---|---|
| FConstIterator | Const BitArray iterator. |
| FConstReverseIterator | Const reverse iterator. |
| FIterator | BitArray iterator. |
| FReverseIterator | Reverse iterator. |
Structs
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| AllocatorType | Allocator::template ForElementType< uint32 > | Containers/BitArray.h | |
| WordType | uint32 | Containers/BitArray.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FullWordMask | WordType | Containers/BitArray.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AllocatorInstance | AllocatorType | Containers/BitArray.h | ||
| MaxBits | int32 | Containers/BitArray.h | ||
| NumBits | int32 | Containers/BitArray.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FBitReference AccessCorrespondingBit
(
const FRelativeBitReference& RelativeReference |
Containers/BitArray.h | ||
const FConstBitReference AccessCorrespondingBit
(
const FRelativeBitReference& RelativeReference |
Containers/BitArray.h | ||
int32 Add
(
const bool Value |
Adds a bit to the array with the given value. | Containers/BitArray.h | |
int32 Add
(
const bool Value, |
Adds multiple bits to the array with the given value. | Containers/BitArray.h | |
int32 AddRange
(
const InWordType* ReadBits, |
Adds multiple bits read from the given pointer. | Containers/BitArray.h | |
| Adds multiple bits read from the given BitArray. | Containers/BitArray.h | ||
int32 AddUninitialized
(
int32 NumBitsToAdd |
Inserts space for multiple bits at the end of the array. | Containers/BitArray.h | |
| Containers/BitArray.h | |||
| Enables range-based for loops, DO NOT USE DIRECTLY. | Containers/BitArray.h | ||
void BitwiseNOT() |
Perform a bitwise NOT on all the bits in this array | Containers/BitArray.h | |
void CheckInvariants() |
Checks the invariants of this class | Containers/BitArray.h | |
TBitArray & CombineWithBinaryOp
(
const TBitArray< OtherAllocator >& InOther, |
Perform a custom bitwise operation on this bit array with another. | Containers/BitArray.h | |
TBitArray & CombineWithBitwiseAND
(
const TBitArray< OtherAllocator >& InOther, |
Perform a bitwise AND on this bit array with another. | Containers/BitArray.h | |
TBitArray & CombineWithBitwiseOR
(
const TBitArray< OtherAllocator >& InOther, |
Return the bitwise OR of two bit arrays. | Containers/BitArray.h | |
TBitArray & CombineWithBitwiseXOR
(
const TBitArray< OtherAllocator >& InOther, |
Return the bitwise XOR of two bit arrays. | Containers/BitArray.h | |
bool CompareSetBits
(
const TBitArray< OtherAllocator >& Other, |
Returns true if Other contains all the same set bits as this, accounting for differences in length. | Containers/BitArray.h | |
bool Contains
(
bool bValue |
Checks if the array contains the specified value (true/false). | Containers/BitArray.h | |
void CountBytes
(
FArchive& Ar |
Tracks the container's memory use through an archive. | Containers/BitArray.h | |
int32 CountSetBits
(
int32 FromIndex, |
Count the number of set bits in this array FromIndex <= bit < ToIndex | Containers/BitArray.h | |
void Empty
(
int32 ExpectedNumBits |
Removes all bits from the array, potentially leaving space allocated for an expected number of bits about to be added. | Containers/BitArray.h | |
| Containers/BitArray.h | |||
| Containers/BitArray.h | |||
int32 Find
(
bool bValue |
Finds the first occurrence of the specified value (true/false) in the array, and returns the bit index. | Containers/BitArray.h | |
int32 FindAndSetFirstZeroBit
(
int32 StartIndex |
Finds the first occurrence of a zero bit in the array and sets it to one, returning the bit index. | Containers/BitArray.h | |
int32 FindAndSetLastZeroBit () |
Finds the last occurrence of a zero bit in the array and sets it to one, returning the bit index. | Containers/BitArray.h | |
int32 FindFrom
(
bool bValue, |
Finds the first occurrence of the specified value (true/false) in the array, starting from the given bit index, and returns the bit index. | Containers/BitArray.h | |
int32 FindFrom
(
bool bValue, |
Finds the first occurrence of the specified value (true/false) in the array, starting from the given bit index, and returns the bit index. | Containers/BitArray.h | |
int32 FindLast
(
bool bValue |
Finds the last occurrence of the specified value (true/false) in the array, and returns the bit index. | Containers/BitArray.h | |
int32 FindLastFrom
(
bool bValue, |
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. | Containers/BitArray.h | |
uint32 GetAllocatedSize() |
Helper function to return the amount of memory allocated by this container | Containers/BitArray.h | |
uint32 * GetData () |
Containers/BitArray.h | ||
const uint32 * GetData () |
Containers/BitArray.h | ||
void GetRange
(
int32 Index, |
Reads a range of bits within the array and writes them to the given pointer. | Containers/BitArray.h | |
void Init
(
bool bValue, |
Resets the array's contents. | Containers/BitArray.h | |
void Insert
(
bool Value, |
Adds a bit with the given value at the given index in the array. | Containers/BitArray.h | |
void Insert
(
bool Value, |
Inserts multiple bits with the given value into the array, starting at the given Index. | Containers/BitArray.h | |
void InsertRange
(
const TBitArray< OtherAllocator >& ReadBits, |
Inserts multiple bits read from the given BitArray into the array, starting at the given index. | Containers/BitArray.h | |
void InsertRange
(
const InWordType* ReadBits, |
Inserts multiple bits read from the given pointer, starting at the given index. | Containers/BitArray.h | |
void InsertUninitialized
(
int32 Index, |
Inserts space for multiple bits into the array, starting at the given index. | Containers/BitArray.h | |
bool IsEmpty () |
Returns true if the bit array is empty and contains no elements. | Containers/BitArray.h | |
bool IsValidIndex
(
int32 InIndex |
Accessors. | Containers/BitArray.h | |
int32 Max() |
Containers/BitArray.h | ||
int32 Num() |
Containers/BitArray.h | ||
int32 PadToNum
(
int32 DesiredNum, |
Pad this bit array with the specified value to ensure that it is at least the specified length. | Containers/BitArray.h | |
| Containers/BitArray.h | |||
| Containers/BitArray.h | |||
void RemoveAt
(
int32 BaseIndex, |
Removes bits from the array. | Containers/BitArray.h | |
void RemoveAtSwap
(
int32 BaseIndex, |
Removes bits from the array by swapping them with bits at the end of the array. | Containers/BitArray.h | |
| Containers/BitArray.h | |||
| Containers/BitArray.h | |||
void Reserve
(
int32 Number |
Reserves memory such that the array can contain at least Number bits. | Containers/BitArray.h | |
void Reset() |
Removes all bits from the array retaining any space already allocated. | Containers/BitArray.h | |
void Serialize
(
FArchive& Ar |
Serializer | Containers/BitArray.h | |
void SetNum
(
int32 InNumBits, |
Sets the number of bits, initializing any potentially added bits to the given value. | Containers/BitArray.h | |
void SetNumUninitialized
(
int32 InNumBits |
Sets number of bits without initializing new bits. | Containers/BitArray.h | |
void SetRange
(
int32 Index, |
Sets or unsets a range of bits within the array. | Containers/BitArray.h | |
void SetRangeFromRange
(
int32 Index, |
Sets range of bits within the TBitArray to the values read out of a pointer. | Containers/BitArray.h | |
void SetRangeFromRange
(
int32 Index, |
Sets range of bits within this TBitArray to the values read out another TBitArray. | Containers/BitArray.h | |
void WriteMemoryImage
(
FMemoryImageWriter& Writer |
Containers/BitArray.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TBitArray BitwiseAND
(
const TBitArray< AllocatorA >& A, |
Return the bitwise AND of two bit arrays. | Containers/BitArray.h | |
static TBitArray BitwiseOR
(
const TBitArray< AllocatorA >& A, |
Return the bitwise OR of two bit arrays. | Containers/BitArray.h | |
static TBitArray BitwiseXOR
(
const TBitArray< AllocatorA >& A, |
Return the bitwise XOR of two bit arrays. | Containers/BitArray.h | |
static void Move
(
BitArrayType& ToArray, |
Containers/BitArray.h | ||
static void SetWords
(
uint32* Words, |
Containers/BitArray.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool operator!=
(
const TBitArray< Allocator >& Other |
Containers/BitArray.h | ||
const FConstBitReference operator[]
(
int32 Index |
Containers/BitArray.h | ||
FBitReference operator[]
(
int32 Index |
Containers/BitArray.h | ||
| Assignment operator. | Containers/BitArray.h | ||
| Move assignment. | Containers/BitArray.h | ||
| Containers/BitArray.h | |||
bool operator==
(
const TBitArray< Allocator >& Other |
Containers/BitArray.h |